生活随笔
收集整理的這篇文章主要介紹了
autojs脚本apk安装器
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
由于想要做資源網站,想到了app彈窗引流,但是多數apk都有加殼無法批量修改!
所以決定使用安裝器推廣方式,以下是autojs方案
"ui";showLoginUI();
ui.statusBarColor("#000000")//顯示登錄界面
function showLoginUI(){ui.layout(<frame><vertical h="auto" align="center" margin="0 50"><linear gravity="center"><text w="auto" gravity="center" color="#111111" size="16">當前應用:大學資源網 1.0.0</text></linear><linear gravity="center"><text w="56" gravity="center" color="#111111" size="16"></text></linear><linear gravity="center"><button id="login" text="下載其他資源"/><button id="register" text="安裝當前應用"/></linear><linear gravity="center"><button id="QQ" text=" 分享到QQ "/><button id="WX" text="復制資源鏈接"/></linear><linear gravity="center"><text w="56" gravity="center" color="#111111" size="16"></text></linear><linear gravity="center"><text w="auto" gravity="center" color="#111111" size="16">卸載此安裝器不會影響已安裝應用</text></linear></vertical></frame>);ui.login.on("click", () => {app.openUrl("https://z.msdnxz.com");});ui.register.on("click", () => showRegisterUI());ui.QQ.on("click", () => QQUI());ui.WX.on("click", () => WXUI());};
function showRegisterUI(){
//讀入文件
var apkurl=files.path("./apk/1.apk")
var newApkFile=new java.io.File(apkurl);
var intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
var type = "application/vnd.android.package-archive";
var uri;
if (device.sdkInt > 23) {//創建urluri = Packages["androidx"].core.content.FileProvider.getUriForFile(context, app.fileProviderAuthority, newApkFile);intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
} else {uri = Uri.fromFile(newApkFile);
}
intent.setDataAndType(uri, type);
app.startActivity(intent);
};function QQUI(){
app.startActivity({action: "android.intent.action.SEND",type: "text/*",extras: {"android.intent.extra.TEXT": "如無法打開鏈接,請復制到瀏覽器訪問,https://msdnxz.lanzoui.com/b00zlnrna"},packageName: "com.tencent.mobileqq",className: "com.tencent.mobileqq.activity.JumpActivity"
});
};function WXUI() {setClip("如無法打開鏈接,請復制到瀏覽器訪問,https://msdnxz.lanzoui.com/b00zlnrna");toast("復制成功");
};
示例文件
總結
以上是生活随笔為你收集整理的autojs脚本apk安装器的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。