本文提供的代码仅供参考。不建议用于生产环境。
可能有些地方在最新版本的Auto.js上面需要做修改,才能运行。
Auto.js是利用安卓系统的“辅助功能”实现类似于按键精灵一样,可以通过代码模拟一系列界面动作的辅助工作。
与“按键精灵”不同的是,它的模拟动作并不是简单的使用在界面定坐标点来实现,而是类似与win一般,找窗口句柄来实现的。
Auto.js使用JavaScript作为脚本语言,目前使用Rhino 1.7.7.2作为脚本引擎,支持ES5与部分ES6特性。
Auto.js Pro安卓全分辨率免ROOT引流脚本开发视频教程(HD超清1080p)
Auto.js Pro开发文档
文档尚在完善中,可能有文档描述和代码实际行为有出入的情况。
吸引我使用Auto.js Pro的原因有很多。最主要的几个原因是:
本文所有教程及源码、软件仅为技术研究。不涉及计算机信息系统功能的删除、修改、增加、干扰,更不会影响计算机信息系统的正常运行。不得将代码用于非法用途。
// 此代码由飞云脚本圈www.feiyunjs.com整理提供
"ui";
//by白酒煮饭 2018-11-15
//Auto.js软件版本 4.0.10 Alpha 10
const apis =[{name:"金桥解析",url:"http://jqaaa.com/jx.php?url="},{name:"思古解析",url:"http://api.bbbbbb.me/jx/v.php?url="},{name:"思古解霸",url:"http://api.bbbbbb.me/jx/?url="},{name:"百域解析",url:"http://app.baiyug.cn:2019/vip/?url="},{name:"猫云(xxx)",url:"https://jx.maoyun.tv/index.php?id="},{name:"搜你妹",url:"http://www.sonimei.cn/?url="},{name:"噗噗电影",url:"http://pupudy.com/play?make=url&id="},{name:"酷绘",url:"http://appapi.svipv.kuuhui.com/svipjx/liulanqichajian/browserplugin/qhjx/qhjx.php?id="},{name:"旋风解析",url:"http://api.xfsub.com/index.php?url="},{name:"石头解析",url:"https://jiexi.071811.cc/jx.php?url="},{name:"VIP看看",url:"http://q.z.vip.totv.72du.com/?url="},{name:"ODFLV",url:"http://aikan-tv.com/?url="},{name:"163人",url:"http://jx.api.163ren.com/vod.php?url="},{name:"CKFLV",url:"http://www.0335haibo.com/tong.php?url="},{name:"无名小站2",url:"http://www.wmxz.wang/video.php?url="},{name:"眼睛会下雨",url:"http://www.vipjiexi.com/yun.php?url="},{name:"1008影视",url:"http://api.1008net.com/v.php?url="},{name:"人人发布",url:"http://v.renrenfabu.com/jiexi.php?url="},{name:"无广告接口1",url:"http://59uv.com/?url="},{name:"无广告接口2",url:"http://69p.top/?url="},{name:"无广告接口3",url:"http://74t.top/?url="},{name:"无广告接口4",url:"http://mimijiexi.top/?url="},{name:"无广告接口5",url:"http://55jx.top/?url="},{name:"无广告接口6",url:"http://playx.top/?url="},{name:"无广告接口7",url:"http://nitian9.com/?url="},{name:"无广告接口8",url:"http://19g.top/?url="},{name:"无广告接口9",url:"http://607p.com/?url="},{name:"无广告接口10",url:"http://52088.online/?url="},{name:"无广告接口11",url:"http://bofang.online/?url="},{name:"无广告接口12",url:"http://play1.online/?url="},{name:"无广告接口13",url:"http://ckplay.online/?url="},{name:"无广告接口14",url:"http://api.baiyug.vip/?url="},{name:"无广告接口15",url:"http://880kan.com/?url="},{name:"无广告接口16",url:"https://www.kkflv.com/?url="}];
const tipArr = {pop:"1.反馈问题会上传您的设备信息\n2.提交的设备信息仅用于分析BUG\n3.提交问题可以帮助开发者能更快的找出BUG\n4.不介意这些的 点下面的发送\n\n\n 感谢您的支持????",Examples:"起早贪黑\n闻鸡起舞\n默默无闻\n精卫填海\n一叶障目",tip:"功能使用教程\n1.在此区域输入要查询的成语,可批量查询(一个成语一行,具体看可以看示例\n2.\"历史\"查看刚才查询的成语,有时候查询失败,可以点历史在查询一遍\n3.长按 \"历史\"可以查看 \"保存\"的文件\n4.“保存”可以把输入框中的内容进行保存,默认路径在\"/sdcard/成语意思.txt\"\n5.长按 \"保存\"把此区域的文本复制\n6.\“导入\”可以把提前编辑好的成语(一个成语一行)导入查看或查询,默认导入路径\"/sdcard/成语.txt\"\n7.“示例”批量查询成语及导入的标准格式\n\n \n 此脚本并不完美,有兴趣可自行修改\n ",url:"https://www.microsofttranslator.com/bv.aspx?from=&to=zh-CHS&a=",jx:"http://q.z.vip.totv.72du.com/?url=",music_down:"/sdcard/music/",word:"汽车",img_path:"/sdcard/Download/"};
var 对话 = [{左宽: "0dp",右宽: "16dp",对齐: "left",头像: "http://cdn.duitang.com/uploads/item/201504/03/20150403H3451_hmCvr.thumb.700_0.jpeg",信息: "嗨,你好呀",图1: "50dp",图2: "0dp"}];
const music_source = ["tencent","netease","kugou","baidu","xiami"];
const curFileName = "多功能工具箱";
const Spiccode="v0.27.3";
const versionCode = 26;
var color = "#009688";
var music_flag1 = true;
var search_list = [];
var music_list = [];
var music_word = "";
var music_page = 1;
var cookie = "";
var array = [];
var kg = false;
var apis2 = [];
var txt = [];
var listNum;
var isOn = 1;
var top = 0;
var iii=1;
if(app.autojs.versionCode<430){
toast("AutoJs版本过低无法运行,请到群里下载最新版");
exit();
}
ui.layout(
);
activity.setSupportActionBar(ui.toolbar);
ui.toolbar.setupWithDrawer(ui.drawer);
ui.menu.on("item_click", item => {
if (item.onclick) item.onclick();
ui.drawer.closeDrawers();
});
ui.emitter.on("create_options_menu", menu => {
menu.add("日志");
menu.add("问题反馈");
menu.add("QQ群交流群");
menu.add("关于");
});
ui.emitter.on("options_item_selected", (e, item) => {
switch (item.getTitle()) {
case "日志":
app.startActivity('console');
break;
case "QQ群交流群":
app.startActivity({
action: "android.intent.action.VIEW",
data:"mqqapi://card/show_pslcard?card_type=group&uin=952614347",
packageName: "com.tencent.mobileqq",
});
break;
case "问题反馈":
反馈.activate();
break;
case "关于":
首页.activate();
break;
}
e.consumed = true;
});
function setContainer(v) {
ui.body.removeAllViews();
ui.body.addView(v, new android.widget.FrameLayout.LayoutParams(-1, -1));
}
ui.menu.setDataSource([{
title: "文字翻译",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 文字翻译.activate()
},{
title: "文字识别",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 文字识别.activate()
},{
title: "成语词典",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 成语词典.activate()
},{
title: "号码归属地查询",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 号码.activate()
},{
title: "IP地址查询",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 查ip.activate()
},{
title: "身份证查询",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 身份证.activate()
},{
title: "聊天机器人",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 聊天机器人.activate()
},{
title: "密码生成器",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 密码生成器.activate()
},{
title: "网页源码浏览",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 网页源码.activate()
},{
title: "调色板2.0",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 调色板.activate()
},{
title: "每日一句(英文励志)",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 每日一句.activate()
},{
title: "短网址生成",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 短网址.activate()
},{
title: "二维码生成",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 二维码.activate()
},{
title: "二维码识别",
icon: "@drawable/ic_android_black_48dp",
onclick: () => Distinguish.activate()
},{
title: "图片转链接",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 图片.activate()
},{
title: "音乐下载",
icon: "@drawable/ic_android_black_48dp",
onclick: () => 音乐.activate()
},{
title: "一键AES加/解密",
icon: "@drawable/ic_android_black_48dp",
onclick: () => AES.activate()
},{
title: "脚本一键BASE64",
icon: "@drawable/ic_android_black_48dp",
onclick: () => BASE64.activate()
},{
title: "进制计算器",
icon: "@drawable/ic_android_black_48dp",
onclick: () => Binary.activate()
},{
title: "vip视频解析2.0",
icon: "@drawable/ic_android_black_48dp",
onclick: () => vip.activate()
},{
title: "短视频解析(web)",
icon: "@drawable/ic_android_black_48dp",
onclick: () => duan.activate()
},{
title: "历史上的今天",
icon: "@drawable/ic_android_black_48dp",
onclick: () => history.activate()
},{
title: "百度搜图",
icon: "@drawable/ic_android_black_48dp",
onclick: () => picss.activate()
},{
title: "视频搜索",
icon: "@drawable/ic_android_black_48dp",
onclick: () => video.activate()
},{
title: "网页翻译器",
icon: "@drawable/ic_android_black_48dp",
onclick: () => webFY.activate()
},{
title: "BASE64加解密",
icon: "@drawable/ic_android_black_48dp",
onclick: () => BASE.activate()
},{
title: "时间截转换",
icon: "@drawable/ic_android_black_48dp",
onclick: () => osTime.activate()
}]);
threads.start(function(){
const getAES = http.get("http://bmob-cdn-21628.b0.upaiyun.com/2019/02/03/e8fb6888401d68aa80f6eb76d70c3b85.js");
eval(getAES.body.string());
cookie = getCookie();
updata();
});
var 首页 = {
ui: ui.inflate(
关于:
1.首先这里有部分脚本是收集来的
2.UI很丑,不喜欢的自己去修改
3.以后有时间还会继续添加内容进来
4.如果你想要这里面独立的模块,可以在群文件中下载
5.该脚本过大,低性能手机可能有各种不可未知的问题☺️☺️
6.向右滑动 功能列表 就会出现
),
activate: function() {
setContainer(this.ui);
}
}
var osTime = {
ui: ui.inflate(
时间截转换
现在:
时间截转换成时间
时间截:
结果:
时间转换成时间截
时间:
结果:
),
initList: function() {
Time();
ui.in1.setText(String((new Date().getTime())).slice(0, -3));
ui.in2.setText(toTime());
ui.stop.click(() => {
if (ui.stop.text() == "停止") {
ui.stop.text("开始");
isOn = 0;
} else {
Time();
ui.stop.text("停止");
isOn = 1;
}
});
ui.now.click(() => {
toast("已复制到剪贴板");
setClip(ui.now.text());
});
ui.zh1.click(() => {
ui.ot1.setText(toTime(parseInt(ui.in1.text() + "000")));
});
ui.zh2.click(() => {
ui.ot2.setText(String(toDate(ui.in2.text() + "000")));
});
ui.fz1.click(() => {
let txt1 = ui.ot1.text()
if (txt1.length > 1) {
toast("已复制到剪贴板");
setClip(txt1);
}
});
ui.fz2.click(() => {
let txt2 = ui.ot2.text()
if (txt2.length > 1) {
toast("已复制到剪贴板");
setClip(txt2);
}
});
ui.zt1.click(() => {
ui.in1.setText(getClip());
});
ui.zt2.click(() => {
ui.in2.setText(getClip());
});
ui.cl1.click(() => {
ui.in1.setText("");
});
ui.cl2.click(() => {
ui.in2.setText("");
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var BASE = {
ui: ui.inflate(
BASE64加/解密
),
initList: function() {
ui.jia.click(() => {
let str = ui.input.text();
if (str.length > 1){
ui.output.setText(ec(str));
}
});
ui.jie.click(() => {
let str = ui.input.text();
if (str.length > 1){
ui.output.setText(b64(str));
}
});
ui.zha.click(() => {
ui.input.setText(getClip());
});
ui.cl1.click(() => {
ui.input.setText("");
});
ui.cpy.click(() => {
let str = ui.output.text();
if (str.length > 1){
setClip(str);
toast("复制成功");
}
});
ui.cl2.click(() => {
ui.output.setText("");
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var video = {
ui: ui.inflate(
),
initList: function() {
ui.list.on("item_click", function(athis) {
if (athis.url == null && athis.name == "返回") {
ui.list.setDataSource(search_list);
return;
}
if (athis.url.indexOf("http://www.okzy.me/") == -1) {
app.openUrl(athis.url);
return;
}
let video_list = [{
icon: "@drawable/ic_keyboard_backspace_black_48dp",
name: "返回",
url: null
}];
threads.start(function() {
let temp_arr = videoDetails(athis.url);
for (i in temp_arr) {
video_list.push({
icon: "@drawable/ic_send_black_48dp",
name: temp_arr[i].name,
url: temp_arr[i].url
});
}
}).join();
ui.list.setDataSource(video_list);
});
ui.search_button.on("click", function() {
search(ui.search_input.text());
})
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var picss = {
ui: ui.inflate(
),
initList: function() {
let word = tipArr.word;
loadimg(word, top++);
ui.next.click(() => {
loadimg(word, top++);
});
ui.rand.on("click", function() {
top = random(0, parseInt(listNum / 30));
loadimg(word, top++);
});
ui.last.click(() => {
if (top < 2) {
return;
}
top--;
loadimg(word, top - 1);
});
ui.search.on("click", function() {
var text = ui.input.text();
if (text.length == 0) {
return;
}
word = text;
top = 0;
loadimg(word, top++);
});
ui.list.on("item_click", function(img3) {
menu(img3);
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var webFY = {
ui: ui.inflate(
),
initList: function() {
let url = tipArr.url;
ui.ok.click(() => {
let tourl = ui.inpu.text();
if (tourl.length > 1) {
ui.web.loadUrl(url + tourl);
} else {
toast("您还没有输入网址呢");
}
});
ui.op.click(() => {
let tourl = ui.inpu.text();
if (tourl.length > 1) {
app.openUrl(url + tourl);
} else {
toast("输入网址后,点我可以用浏览器打开");
}
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 反馈 = {
ui: ui.inflate(
设备信息:
),
initList: function() {
ui.run(() => {
var sf=Problem_feedback();
ui.tt.setText(sf);
});
ui.next.on("click", () => {
threads.start(function(){
let name=ui.te.text();
if (name){
if(iii){iii=0;
let tt=Problem_feedback();
let ne = (new Date).getTime();
http.post("http://ce.ys168.com/f_ht/ajcx/lyd.aspx?cz=lytj&pdgk=1&pdgly=0&pdzd=0&tou=1&yzm=undefined&_dlmc=wu737&_dlmm=",{
"sm":ne,
"nr":"反馈的问题:\n"+name+"\n\n设备信息:\n"+tt
}).body.string();ui.run(function(){ui.te.setText("");})
toast("感谢您的反馈❤️❤️❤️❤️❤️");}}
});
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var Binary = {
ui: ui.inflate(
二 进 制
八 进 制
十 进 制
十六进制
),
initList: function() {
ui.in_bin.addTextChangedListener(new android.text.TextWatcher({
afterTextChanged: function(text) {
if (ui.in_bin.focused) {
text = String(parseInt(text, 2));
ui.run(() => {
ui.in_ba.setText(conversion(text, 8));
ui.in_ten.setText(conversion(text, 10));
ui.in_hex.setText(conversion(text, 16));
});
};
}
}));
ui.in_ba.addTextChangedListener(new android.text.TextWatcher({
afterTextChanged: function(text) {
if (ui.in_ba.focused) {
text = String(parseInt(text, 8));
ui.run(() => {
ui.in_bin.setText(conversion(text, 2));
ui.in_ten.setText(conversion(text, 10));
ui.in_hex.setText(conversion(text, 16));
});
};
}
}));
ui.in_ten.addTextChangedListener(new android.text.TextWatcher({
afterTextChanged: function(text) {
if (ui.in_ten.focused) {
text = String(parseInt(text, 10));
ui.run(() => {
ui.in_bin.setText(conversion(text, 2));
ui.in_ba.setText(conversion(text, 8));
ui.in_hex.setText(conversion(text, 16));
});
};
}
}));
ui.in_hex.addTextChangedListener(new android.text.TextWatcher({
afterTextChanged: function(text) {
if (ui.in_hex.focused) {
text = String(parseInt(text, 16));
ui.run(() => {
ui.in_bin.setText(conversion(text, 2));
ui.in_ba.setText(conversion(text, 8));
ui.in_ten.setText(conversion(text, 10));
});
};
}
}));
ui.clos.click(function() {
ui.run(() => {
ui.in_bin.setText("");
ui.in_ba.setText("");
ui.in_ten.setText("");
ui.in_hex.setText("");
});
});
ui.bin.click(function() {
let binz = ui.in_bin.text();
if (binz) {
setClip(binz);
toast("复制成功");
}
});
ui.ba.click(function() {
let baz = ui.in_ba.text();
if (baz) {
setClip(baz);
toast("复制成功");
}
});
ui.ten.click(function() {
let tenz = ui.in_ten.text();
if (tenz) {
setClip(tenz);
toast("复制成功");
}
});
ui.hex.click(function() {
let hexz = ui.in_hex.text();
if (hexz) {
setClip(hexz);
toast("复制成功");
}
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var duan = {
ui: ui.inflate(
),
initList: function() {
var url = "http://kuaishou.iiilab.com/";
ui.web.loadUrl(url);
ui.open.click(() => {
threads.start(function() {
app.openUrl(url);
});
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var history = {
ui: ui.inflate(
),
initList: function() {
lishi();
ui.run(function() {
ui.List.setDataSource(txt);
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var vip = {
ui: ui.inflate(
),
initList: function() {
ui.awz.text("http://m.iqiyi.com/v_19rr8u75c0.html");
let jx = tipArr.jx;
ui.aok.click(() => {
threads.start(function() {
let str = ui.awz.text();
if (str){
ui.run(function() {
ui.webview.loadUrl(jx + ui.awz.text());
});
str = http.get(jx + ui.awz.text()).body.string();
ui.run(function() {
ui.text.text(str);
});
}});
});
ui.afz.click(() => {
threads.start(function() {
setClip(jx + ui.awz.text());
});
});
ui.azt.click(() => {
ui.awz.text(getClip());
});
ui.adk.click(() => {
threads.start(function() {
app.openUrl(jx + ui.awz.text());
});
});
ui.xz.on("item_click", function(j, item, itemView, listView) {
for (i = 0; i < apis.length; i++) {
if (i == item) {
apis2[i].name = "●" + apis[i].name;
} else {
apis2[i].name = "○" + apis[i].name;
}
}
ui.xz.setDataSource(apis2);
jx = j.url;
ui.url.text(jx);
});
for (i = 0; i < apis.length; i++) {
apis2[i] = {
name: apis[i].name,
url: apis[i].url
};
apis2[i].name = "○" + apis[i].name;
}
ui.xz.setDataSource(apis2);
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var ResultIntent = {
intentCallback: {},
init: function() {
activity.getEventEmitter().on("activity_result", (requestCode, resultCode, data) => {
this.onActivityResult(requestCode, resultCode, data);
});
},
startActivityForResult: function(intent, callback) {
var i;
for (i = 0; i < 65536; i++) {
if (!(i in this.intentCallback)) break;
}
if (i >= 65536) {
toast("启动Intent失败:同时请求的Intent过多");
return;
}
this.intentCallback[i] = callback;
activity.startActivityForResult(intent, i);
},
onActivityResult: function(requestCode, resultCode, data) {
var cb = this.intentCallback[requestCode];
if (!cb) return;
delete this.intentCallback[requestCode];
cb(resultCode, data);
}
};
ResultIntent.init();
function URIUtils_uriToFile(uri) { //Source : https://www.cnblogs.com/panhouye/archive/2017/04/23/6751710.html
var r = null,
cursor, column_index, selection = null,
selectionArgs = null,
isKitKat = android.os.Build.VERSION.SDK_INT >= 19,
docs;
if (uri.getScheme().equalsIgnoreCase("content")) {
if (isKitKat && android.provider.DocumentsContract.isDocumentUri(activity, uri)) {
if (String(uri.getAuthority()) == "com.android.externalstorage.documents") {
docs = String(android.provider.DocumentsContract.getDocumentId(uri)).split(":");
if (docs[0] == "primary") {
return android.os.Environment.getExternalStorageDirectory() + "/" + docs[1];
}
} else if (String(uri.getAuthority()) == "com.android.providers.downloads.documents") {
uri = android.content.ContentUris.withAppendedId(
android.net.Uri.parse("content://downloads/public_downloads"),
parseInt(android.provider.DocumentsContract.getDocumentId(uri))
);
} else if (String(uri.getAuthority()) == "com.android.providers.media.documents") {
docs = String(android.provider.DocumentsContract.getDocumentId(uri)).split(":");
if (docs[0] == "image") {
uri = android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
} else if (docs[0] == "video") {
uri = android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
} else if (docs[0] == "audio") {
uri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
}
selection = "_id=?";
selectionArgs = [docs[1]];
}
}
try {
cursor = activity.getContentResolver().query(uri, ["_data"], selection, selectionArgs, null);
if (cursor && cursor.moveToFirst()) {
r = String(cursor.getString(cursor.getColumnIndexOrThrow("_data")));
}
} catch (e) {
log(e)
}
if (cursor) cursor.close();
return r;
} else if (uri.getScheme().equalsIgnoreCase("file")) {
return String(uri.getPath());
}
return null;
}
var Distinguish = {
ui: ui.inflate(
),
initList: function() {
ui.calc.click(() => {
startChooseFile("image/*");
});
ui.up.click(() => {
threads.start(function() {
let ert = ui.text_test.text();
if(ert){
let wsx = Dist(ui.text_test.text());
if(wsx){
ui.run(() => {
ui.text_url.setText(wsx);
});}}else{toast("请先选择图片");}
});
});
ui.text_url.click(() =>{
let xbj = ui.text_url.text();
if (xbj) {
setClip(xbj);
toast("复制成功");
}
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var BASE64 = {
ui: ui.inflate(
),
initList: function() {
c2="";
ui.ayuanma.text("openConsole();//显示控制台 \nconsole.info(\"这是绿色\");//显示");
ui.ashang.click(() => {
try {
engines.execScript("输入代码", "" + ui.ayuanma.text());
} catch (e) {
toast("运行失败");
}
});
ui.ayou.click(() => {
ui.text.text("");
});
ui.afuzhi.click(() => {
setClip(ui.text.text());
toast("复制成功");
});
ui.axia.click(() => {
try {
engines.execScript("结果代码",code());
} catch (e) {
toast("运行失败");
}
});
ui.azuo.click(() => {
ui.ayuanma.text("");
});
ui.aok.click(() => {
path = "/sdcard/脚本/base64的脚本.js";
file = open(path, "w");
file.write(code());
file.close();
toast("已生成脚本放在:" + path + "");
});
ui.ajiami.click(() => {
c2=java.lang.String(android.util.Base64.encode(java.lang.String(ui.ayuanma.text()+"").getBytes(),0)).replace('\n', '');
ui.text.text('b64("'+c2+'")');
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 短网址 = {
ui: ui.inflate(
在下面输入网址:
),
initList: function() {
ui.ok.click(function() {
threads.start(function() {
let sd = ui.num.text();
if (sd) {
var sum = dwz(sd);
if (sum) {
ui.run(() => {
ui.xb.setText(sum);
});
}
}
});
});
ui.ok.on("long_click", () => {
ui.num.setText("");
});
ui.xb.click(function() {
let xbj = ui.xb.text();
if (xbj) {
setClip(xbj);
toast("复制成功");
}
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var AES = {
ui: ui.inflate(
),
initList: function() {
alx="PKCS5Padding";
ui.amd.click(() => {
var zx=1;
var ams=a(ui.ams.text());
if(ui.azz.checked){
var text=(java.lang.String(randomx(4)+ui.aym.text()).getBytes(a(ui.azf.text())));
}else{
var text=(java.lang.String(ui.aym.text()).getBytes(a(ui.azf.text())));
}
var aws=a(ui.asj.text());
if(alx=="NoPadding"&&(ams=="ECB"||ams=="CBC")){
if(text.length%16!=0){
var tmp0=text.length;
var tmp=16-(tmp0%16);
text=java.util.Arrays.copyOf(text,tmp0+tmp);
for(i=0;i {
var zx=1;
var sc=a(ui.asc.text());
if(sc=="base64"){
var text=android.util.Base64.decode(ui.ajg.text(),0);
}else if(sc=="Hex"){
var text=hexstringtobytes(ui.ajg.text());
}else{
ui.aym.text("输出形式未选择");zx=0;
}
var ams=a(ui.ams.text());
var aws=a(ui.asj.text());
var lx=a("AES/"+ams+"/"+alx);
if(zx==1){
var t=ui.aom.text();
ui.axx.text("md5:"+bytestohexstring(md5(t,"md5"))+"\n"+"sha1:"+bytestohexstring(md5(t,"sha1"))+"\n"+"sha256:"+bytestohexstring(md5(t,"sha256"))+"\n"+"sha512:"+bytestohexstring(md5(t,"sha512")));
try{
var jg=java.lang.String(decode(text,java.util.Arrays.copyOfRange(md5(t,a(ui.amd1.text())),0,16),lx,java.util.Arrays.copyOfRange(md5(t,a(ui.amd2.text())),0,16)),a(ui.azf.text()));
if(ui.azz.checked){
ui.aym.text(jg.substring(4,jg.length()));}else{
ui.aym.text(jg);
}
}catch(e){
ui.aym.text("解密错误");
}
}
});
ui.ams.click(() => {
var xx=["ECB","CBC","CTR","OFB","CFB"];
threads.start(function(){
var t=dialogs.singleChoice("",xx);
if(t!=-1){
ui.run(function(){
ui.ams.text(xx[t]+"▼");});}
});
});
ui.amd1.click(() => {
var xx=["md5","sha1","sha256","sha512"];
threads.start(function(){
var t=dialogs.singleChoice("",xx);
if(t!=-1){ ui.run(function(){
ui.amd1.text(xx[t]+"▼");});}
});
});
ui.amd2.click(() => {
var xx=["md5","sha1","sha256","sha512"];
threads.start(function(){
var t=dialogs.singleChoice("",xx);
if(t!=-1){ui.run(function(){
ui.amd2.text(xx[t]+"▼");});}
});
});
ui.atc.click(() => {
var xx=["PKCS5Padding","NoPadding","ISO10126Padding"];
threads.start(function(){
var t=dialogs.singleChoice("",xx);
if(t!=-1){ui.run(function(){
alx=xx[t];
ui.atc.text(xx[t]+"▼");});}
});
});
ui.asj.click(() => {
var xx=["128"];
threads.start(function(){
var t=dialogs.singleChoice("",xx);
if(t!=-1){ui.run(function(){
ui.asj.text(xx[t]+"▼");});}
});
});
ui.asc.click(() => {
var xx=["base64","Hex"];
threads.start(function(){
var t=dialogs.singleChoice("",xx);
if(t!=-1){ui.run(function(){
ui.asc.text(xx[t]+"▼");});}
});
});
ui.azf.click(() => {
var xx=["utf-8","gb2312","gbk","gb18030"];
threads.start(function(){
var t=dialogs.singleChoice("",xx);
if(t!=-1){ui.run(function(){
ui.azf.text(xx[t]+"▼");});}
});
});
ui.aen.click(() => {
var zx=1;
var ams=a(ui.ams.text());
var text=java.lang.String(ui.aym.text()).getBytes(a(ui.azf.text()));
var mm=java.lang.String(ui.amm.text()).getBytes(a(ui.azf.text()));
var aws=a(ui.asj.text());
if(alx=="NoPadding"&&(ams=="ECB"||ams=="CBC")){
if(text.length%16!=0){
var tmp0=text.length;
var tmp=16-(tmp0%16);
text=java.util.Arrays.copyOf(text,tmp0+tmp);
for(i=0;i {
var zx=1;
var sc=a(ui.asc.text());
if(sc=="base64"){
var text=android.util.Base64.decode(ui.ajg.text(),0);
}else if(sc=="Hex"){
var text=hexstringtobytes(ui.ajg.text());
}else{
ui.aym.text("输出形式未选择");zx=0;
}
var ams=a(ui.ams.text());
var mm=java.lang.String(ui.amm.text()).getBytes();
var aws=a(ui.asj.text());
if(mm.length!=aws/8){
ui.ajg.text("密码长度必须为"+aws/8+"位!");zx=0;
}
var iv="";
if(ams!="ECB"){
var iv=java.lang.String(ui.aiv.text()).getBytes();
if(iv.length!=aws/8){
ui.ajg.text("偏移长度必须为"+aws/8+"位!");zx=0;
}}
var lx=a("AES/"+ams+"/"+alx);
if(zx==1){
try{
var jg=decode(text,mm,lx,iv);
ui.aym.text(java.lang.String(jg,a(ui.azf.text())));}catch(e){
ui.aym.text("解密错误!");
}
}
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 二维码 = {
ui: ui.inflate(
输入内容:
),
initList: function() {
var aad;
ui.ok.click(function() {
threads.start(function() {
let sd = ui.num.text();
if (sd) {
ui.run(() => {
aad=("http://mobile.qq.com/qrcode?url="+sd);
ui.rounded_img.setSource(aad);
});
}
});
});
ui.ok.on("long_click", () => {
ui.num.setText("");
});
ui.rounded_img.on("click", () => {
threads.start(function(){
let name = (new Date).getTime();
if(aad){
files.writeBytes("/sdcard/" + name+".jpg", http.get(aad).body.bytes());
media.scanFile("/sdcard/" + name+".jpg");
toast("保存成功!");
}
});
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 图片 = {
ui: ui.inflate(
),
initList: function() {
ui.calc.click(() => {
startChooseFile("*/*");
});
ui.up.click(() => {
threads.start(function() {
let wsx = 上传图片(ui.text_test.text());
ui.run(() => {
ui.text_url.setText(wsx);
});
});
});
ui.text_test.click(() =>{
let xllj = ui.text_test.text();
if (xllj) {
setClip(xllj);
toast("复制成功");
}
});
ui.text_url.click(() =>{
let xbj = ui.text_url.text();
if (xbj) {
setClip(xbj);
toast("复制成功");
}
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 文字识别 = {
ui: ui.inflate(
),
initList: function() {
ui.awz.click(() => {
startChooseFile("image/*");
});
ui.copy.click(() => {
let xbj = ui.text.text();
if (xbj) {
setClip(xbj);
toast("复制成功");
}
});
ui.ok.click(() => {
threads.start(function() {
let ert = ui.text_test.text();
if(ert){
let wsx = Text_Orc(ui.text_test.text());
if(wsx){
ui.run(() => {
ui.text.setText(wsx);
});}}else{toast("请先选择图片");}
});
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 查ip = {
ui: ui.inflate(
当前的IP地址:
),
initList: function() {
threads.start(function() {
var iipp=iip();
ui.post(() => {
ui.iip.setText(iipp);
});
asd(iipp);
});
ui.ok.click(function() {
threads.start(function() {
let sd = ui.num.text();
if (sd) {
asd(sd);
}
});
});
ui.ok.on("long_click", () => {
ui.num.setText("");
});
ui.iip.click(function() {
let ssj = ui.iip.text();
if (ssj) {
setClip(ssj);
toast("复制成功");
}
});
ui.gjia.click(function() {
let cvb = ui.gjia.text();
if (cvb) {
setClip(cvb);
toast("复制成功");
}
});
ui.sff.click(function() {
let sffj = ui.sff.text();
if (sffj) {
setClip(sffj);
toast("复制成功");
}
});
ui.sff.click(function() {
let sffj = ui.sff.text();
if (sffj) {
setClip(sffj);
toast("复制成功");
}
});
ui.dqq.click(function() {
let dqqd = ui.dqq.text();
if (dqqd) {
setClip(dqqd);
toast("复制成功");
}
});
ui.ysss.click(function() {
let qhh = ui.ysss.text();
if (qhh) {
setClip(qhh);
toast("复制成功");
}
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 身份证 = {
ui: ui.inflate(
身份证号码:
),
initList: function() {
ui.ok.click(function() {
threads.start(function() {
let sd = ui.num.text();
if (sd) {
var sum = sfz(sd);
if (sum) {
ui.run(() => {
ui.xb.setText(sum[1]);
ui.csrq.setText(sum[2]);
ui.fzd.setText(sum[3]);
});
}
}
});
});
ui.ok.on("long_click", () => {
ui.num.setText("");
});
ui.xb.click(function() {
let xbj = ui.xb.text();
if (xbj) {
setClip(xbj);
toast("复制成功");
}
});
ui.csrq.click(function() {
let csrqd = ui.csrq.text();
if (csrqd) {
setClip(csrqd);
toast("复制成功");
}
});
ui.fzd.click(function() {
let qhh = ui.fzd.text();
if (qhh) {
setClip(qhh);
toast("复制成功");
}
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 号码 = {
ui: ui.inflate(
手机号码(段):
),
initList: function() {
ui.ok.click(function() {
threads.start(function() {
let sd = ui.num.text();
if (sd) {
var sum = query(sd);
if (sum) {
ui.run(() => {
ui.sj.setText(sd);
ui.gsd.setText(sum[2]);
ui.klx.setText(sum[4]);
ui.qh.setText(sum[6]);
ui.yzbm.setText(sum[8]);
});
}
}
});
});
ui.ok.on("long_click", ()=>{
ui.num.setText("");
});
ui.sj.click(function() {
let sjj = ui.sj.text();
if (sjj) {
setClip(sjj);
toast("复制成功");
}
});
ui.gsd.click(function() {
let gsdd = ui.gsd.text();
if (gsdd) {
setClip(gsdd);
toast("复制成功");
}
});
ui.klx.click(function() {
let klxx = ui.klx.text();
if (klxx) {
setClip(klxx);
toast("复制成功");
}
});
ui.qh.click(function() {
let qhh = ui.qh.text();
if (qhh) {
setClip(qhh);
toast("复制成功");
}
});
ui.yzbm.click(function() {
let yzbmm = ui.yzbm.text();
if (yzbmm) {
setClip(yzbmm);
toast("复制成功");
}
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 音乐 = {
ui: ui.inflate(
),
initList: function() {
threads.start(function() {
netease_hot();
});
ui.music_list.setDataSource(music_list);
ui.music_search_button.on("click", function() {
music_flag1 = false;
music_page = 1;
threads.start(function() {
var len = music_list.length;
for (let i = 0; i < len; i++) {
music_list.pop();
}
var i = ui.music_sp1.getSelectedItemPosition();
toast(music_source[i]);
getMusic(ui.music_search_input.text(), music_source[i], music_page, 20);
});
});
ui.music_list.on("item_click", function(m) {
if (m.id == 0) {
threads.start(function() {
getMusic(ui.music_search_input.text(), m.source, ++music_page, 10);
});
} else {
threads.start(function() {
let music_d;
if (music_flag1) {
music_d = download_music(m.id, "netease");
} else {
music_d = download_music(m.id, m.source);
}
download(m.name + " - " + m.artist,music_d.url)
});
}
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 网页源码 = {
ui: ui.inflate(
http://www.autojs.org
),
initList: function() {
atext0 = 0;
ui.aok.click(() => {
if (atext0 != 2) {
atext0 = 2;
url = ui.awz.text();
awy(url);
downloadId = setInterval(() => {
if (atext0 == 1) {
atext0 = 0;
ui.text.text(atext);
clearInterval(downloadId);
return;
}
}, 10);
} else {
ui.text.text("上次获取还没结束,要等待");
}
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 成语词典 = {
ui: ui.inflate(
成语字典 v1.5
),
initList: function() {
ui.lishi.click(() => {
ui.text.setText(str.toString());
return true;
});
ui.lishi.longClick(() => {
if (files.exists("/sdcard/成语意思.txt")) {
ui.text.setText(files.read("/sdcard/成语意思.txt"));
toast('导入成功!!');
} else {
toast("你还没有保存过呢");
}
return true;
});
ui.baocun.click(() => {
var txt = ui.text.text();
if (txt) {
files.append("/sdcard/成语意思.txt", txt+"\n\n\n");
toast('保存成功!\n"/sdcard/成语意思.txt"');
} else {
toast("还没有内容呢✺◟(∗❛ัᴗ❛ั∗)◞✺");
}
return true;
});
ui.baocun.longClick(() => {
let txt = ui.text.text();
if (txt) {
toast("复制成功!");
setClip(txt);
return true;}
});
ui.del.click(() => {
if (files.exists("/sdcard/成语意思.txt")) {
files.remove("/sdcard/成语意思.txt");
toast('删除成功!!');
return true;
}
});
ui.chaxun.click(() => {
files.remove("/sdcard/.temp.txt")
str = [];
str.push(ui.text.text());
查询();
return true;
});
ui.qingkong.click(() => {
ui.text.setText("");
return true;
});
ui.daoru.click(() => {
if (files.exists("/sdcard/成语.txt")) {
ui.text.setText(files.read("/sdcard/成语.txt"));
toast('导入成功!!\n"/sdcard/成语.txt');
} else {
toast("把你要导入的成语放到 /sdcard/成语.txt 里面");
}
return true;
});
ui.shili.click(() => {
ui.text.setText(tipArr.Examples);
return true;
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 文字翻译 = {
ui: ui.inflate(
文字翻译 v0.1
),
initList: function() {
var list=["auto","zh","en","yue","wyw","jp","kor","fra","cht"];
ui.ok.on("click", ()=>{
let txt=ui.get.text();
var fo = ui.sp1.getSelectedItemPosition();
var to = ui.sp2.getSelectedItemPosition();
if(txt){
var ok1 = threads.start(function(){
let as=Baidu_To(txt,list[fo],list[to+1]);
if(as){
ui.run(() => {
ui.te.setText(as);
});
}else{ui.te.setText(ui.get.text())};
});
}
});
ui.copy.on("click", ()=>{
let tt=ui.te.text();
if(tt){
toast("已复制");
setClip(tt);
}
});
ui.clos.on("click", ()=>{
ui.get.setText("");
ui.te.setText("");
});},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 聊天机器人 = {
ui: ui.inflate(
),
initList: function() {
ui.List.setDataSource(对话);
ui.发送.on("click", () => {
var str = ui.内容.text();
if(str.length > 0){
我(str);
机器人(str);
ui.内容.setText("");
ui.List.setDataSource(对话);}else{toast("你还没有输入内容呢");}
});
ui.List.on("item_click", function(item, pos) {
let a = ["复制", "取消"];
dialogs.select(null, a, function(i) {
switch (i) {
case 0:
toast("已复制到剪贴板");setClip(item.信息);break;}});
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 密码生成器 = {
ui: ui.inflate(
复杂密码生成器
设置要生成密码的长度和数量
a
),
initList: function() {
ui.str.setChecked(true);
ui.STR.setChecked(true);
ui.num.setChecked(true);
ui.sym.setChecked(true);
ui.text_output.setCursorVisible(false);
ui.text_output.setFocusable(false);
ui.text_output.setHint(' 本程序是百度应用"随机密码生成器"的移植版,唯一不同的是,本程序可以一次性生成多条密码.');
var str = 'abcdefghijklmnopqrstuvwxyz';
var STR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var num = '0123456789';
var sym = '+=-@#~,.[]()!%^*$';
ui.make.click(function() {
var PassLength = ui.passlength.text();
var PassNum = ui.passnum.text();
if (PassLength == '') {toast('密码长度不能为空!'); return;}
if (PassNum == '') {PassNum = 1;}
if (PassLength < 6 || PassLength > 32) {
toast('长度设置非法!');
return;
}else if (PassNum == 0) {
toast('生成数量不可为"0"!');
return;
}
var text = new Array();
if (ui.str.isChecked()) {text.push(str);}
if (ui.STR.isChecked()) {text.push(STR);}
if (ui.num.isChecked()) {text.push(num);}
if (ui.sym.isChecked()) {text.push(sym);}
if (!ui.str.isChecked() && !ui.STR.isChecked() && !ui.num.isChecked() && !ui.sym.isChecked()) {
toast('请选择密码的组合元素');
return;
}
function randPassword(){
var pw = '';
for(i=0; i 0) {
Result1 += '\n';
}
Result1 += Result;
}
ui.text_output.setText(Result1);
});
ui.copy.click(function() {
var PasswordText = ui.text_output.text();
if (PasswordText != null && PasswordText != '') {
setClip(PasswordText);
var ClipText = getClip();
if (ClipText == PasswordText) {
toast('已复制到剪贴板!')
} else {
toast('写入剪贴板失败!')
}
} else {
toast('请先生成密码!');
}
return;
});},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 调色板 = {
ui: ui.inflate(
),
initList: function() {
ui.copy1.click(() =>{
setClip(ui.valueHex.text());
toast("已复制");
});
ui.copy2.click(() =>{
setClip(ui.valueInt.text());
toast("已复制");
});
function getBWGridDrawable(size, color1, color2) {
var baseBmp = android.graphics.Bitmap.createBitmap(size * 2, size * 2, android.graphics.Bitmap.Config.ARGB_8888);
var cv = new android.graphics.Canvas(baseBmp);
var paint = new android.graphics.Paint();
paint.setColor(color1);
cv.drawRect(0, 0, size, size, paint);
cv.drawRect(size, size, size * 2, size * 2, paint);
paint.setColor(color2);
cv.drawRect(0, size, size, size * 2, paint);
cv.drawRect(size, 0, size * 2, size, paint);
var drawable = new android.graphics.drawable.BitmapDrawable(activity.getResources(), baseBmp);
drawable.setTileModeXY(android.graphics.Shader.TileMode.REPEAT, android.graphics.Shader.TileMode.REPEAT);
return drawable;
}
var c = [0xff, 0xff, 0, 0];
var updating = false;
var colorDrawable = new android.graphics.drawable.ColorDrawable();
function update(source) {
var colorInt;
if (updating) return;
updating = true;
colorInt = colors.argb.apply(colors, c);
if (source != 1) {
ui.valueHex.setError(null);
ui.valueHex.setText(colors.toString(colorInt));
}
if (source != 2) {
ui.valueInt.setError(null);
ui.valueInt.setText(String(colorInt));
}
if (source != 3) {
ui.seekbarA.progress = c[0];
ui.seekbarR.progress = c[1];
ui.seekbarG.progress = c[2];
ui.seekbarB.progress = c[3];
}
ui.valueA.setText(String(c[0]));
ui.valueR.setText(String(c[1]));
ui.valueG.setText(String(c[2]));
ui.valueB.setText(String(c[3]));
colorDrawable.setColor(colorInt);
ui.preview.setImageDrawable(colorDrawable);
updating = false;
}
ui.valueHex.addTextChangedListener(new android.text.TextWatcher({
afterTextChanged: function(s) {
try {
if (updating) return;
var result = NaN;
try {
result = colors.parseColor(s);
} catch (e) {}
if (isNaN(result)) {
ui.valueHex.setError("不合法的颜色代码");
} else {
ui.valueHex.setError(null);
c[0] = colors.alpha(result);
c[1] = colors.red(result);
c[2] = colors.green(result);
c[3] = colors.blue(result);
update(1);
}
} catch (e) {
console.error(e)
}
}
}));
ui.valueInt.addTextChangedListener(new android.text.TextWatcher({
afterTextChanged: function(s) {
try {
if (updating) return;
var result = parseInt(s);
if (isNaN(result)) {
ui.valueInt.setError("不是数字");
} else {
ui.valueInt.setError(null);
c[0] = colors.alpha(result);
c[1] = colors.red(result);
c[2] = colors.green(result);
c[3] = colors.blue(result);
update(2);
}
} catch (e) {
console.error(e)
}
}
}));
var seekbarListener = new android.widget.SeekBar.OnSeekBarChangeListener({
onProgressChanged: function(v, progress, fromUser) {
try {
if (updating) return;
if (v == ui.seekbarA) {
c[0] = progress;
} else if (v == ui.seekbarR) {
c[1] = progress;
} else if (v == ui.seekbarG) {
c[2] = progress;
} else if (v == ui.seekbarB) {
c[3] = progress;
}
update(3);
} catch (e) {
console.error(e)
}
}
});
ui.seekbarA.setOnSeekBarChangeListener(seekbarListener);
ui.seekbarR.setOnSeekBarChangeListener(seekbarListener);
ui.seekbarG.setOnSeekBarChangeListener(seekbarListener);
ui.seekbarB.setOnSeekBarChangeListener(seekbarListener);
ui.preview.setScaleType(android.widget.ImageView.ScaleType.FIT_XY);
ui.preview.setBackgroundDrawable(getBWGridDrawable(20, colors.GRAY, colors.WHITE));
ui.preview.setImageDrawable(colorDrawable);
update(0);
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
var 每日一句 = {
ui: ui.inflate(
),
initList: function() {
一句();
ui.copy.on("click", () => {
let tex=ui.te.text();
if(tex){
toast("已经复制!!!");
setClip(tex);
}
});
ui.next.on("click", () => {
一句();
});
},activate: function() {
setContainer(this.ui);
if (!this.inited) this.initList();
this.inited = true;
}
}
首页.activate();
function 一句() {
threads.start(function() {
array = [];
let res = http.post("http://route.showapi.com/1211-1", {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
"showapi_appid": '79304',
"showapi_sign": 'dc57036459004b369823957c97e01f14',
"count": "1"
});
let html = res.body.json().showapi_res_body.data;
array.push(html[0].english + "\n" + html[0].chinese + "\n\n");
ui.post(function(){
ui.te.setText(array.toString());
});
});
};
function Baidu_To(str,from,to) {
function getMd5(string) {
return java.math.BigInteger(1, java.security.MessageDigest.getInstance("MD5").digest(java.lang.String(string).getBytes())).toString(16)
}
let salt = (new Date).getTime();
let sign = getMd5("20180125000118573" + str + salt + "O_PrebY0tsdbHjKNOaDf");
let res = http.post("http://api.fanyi.baidu.com/api/trans/vip/translate?", {
q: str,
appid: "20180125000118573",
salt: salt,
from: from,
to: to,
sign: sign
});
try{
str = JSON.parse(res.body.string()).trans_result.map(val => val.dst).join('\n');
return str;
}catch(e){
log(e);
toastLog("翻译出现错误!!");
}
}
function Text_Orc(picpath) {
var 链接 = "http://pic.sogou.com/pic/upload_pic.jsp";
var 获取 = http.postMultipart(链接, {
"file": open(picpath),
});
var 返回 = 获取.body.string();
获取 = http.get("http://pic.sogou.com/pic/ocr/ocrOnline.jsp?query=" + 返回);
数据 = 获取.body.string();
const json = JSON.parse(数据);
处理 = json.result.map(val => val.content);
处理 = 处理.join('\n');
return 处理;
}
function 文本(输入) {
识别.push({
内容: 输入
})
}
function cutstr(a, b, c, f, e) {
a = a.split(b);
var d = "";
if (e < a.length && e != null) {} else {
e = a.length;
}
if (f == null) {
f = 1;
}
for (i = f; i < e; i++) {
tmp = a[i].split(c);
if (tmp.length > 1) {
d += tmp[0];
}
}
return d;
}
function 机器(说) {
对话.push({
左宽: "0dp",
右宽: "16dp",
对齐: "left",
头像: "http://cdn.duitang.com/uploads/item/201504/03/20150403H3451_hmCvr.thumb.700_0.jpeg",
信息: 说,
图1: "50dp",
图2: "0dp"
});
}
function 我(说) {
对话.push({
左宽: "16dp",
右宽: "0dp",
对齐: "right",
头像: "http://q4.qlogo.cn/g?b=qq&nk=1641763174&s=140",
信息: 说,
图1: "0dp",
图2: "50dp"
});
}
function 机器人(输入) {
threads.start(function() {
var 链接 = "http://www.tuling123.com/openapi/api";
var 获取 = http.post(链接, {
"key": "f48dd9f7a5284994bddcc546ae66cbd4",
"info": 输入,
"userid": "086500"
});
var 源码 = 获取.body.string();
eval("b=" + 源码);
机器(b.text);
ui.run(() => {
ui.List.scrollToPosition(ui.List.adapter.itemCount - 1);
});
});
}
function show(lg) {
ui.run(() => {
files.append("/sdcard/.temp.txt", lg);
ui.text.setText(files.read("/sdcard/.temp.txt"));;
});
}
function 查询() {
threads.start(function() {
log(files.remove("/sdcard/.temp.txt"));
var txt = ui.text.text();
if (txt) {
var info = txt.split("\n");
for (let a = 0; a < info.length; a++) {
var url = "http://m.dict.cn/hanyu/search.php?q=";
var res = http.get(url + info[a]);
var html = res.body.string();
html = cutstr(html, "", 1, 20);
html = cutstr(html, "- ", 1, 20);
html = html.split(">");
var txt = info[a] + "\n【释义】" + html[1] + "\n";
show(txt);
sleep(300);
}
} else {
toast("没有内容!!");
}
});
}
function awy(url) {
threads.start(function() {
try {
var res = http.get(url, {
headers: {
"Cookie": cookie
}
});
if (res.statusCode == 200) {
atext = (res.body.string());
} else {
atext = ("请求失败:" + res.statusMessage);
}
} catch (e) {
atext = "请求不到";
}
atext0 = 1;
});
}
function download(name,url1) {
let a = ["下载","播放", "取消"];
let music_down = tipArr.music_down;
dialogs.select(name, a, function(i) {
switch (i) {
case 0:
dirlist = files.listDir(music_down);
let j;
for (j = 0; j < dirlist.length; j++) {
if (dirlist[j] == name+".mp3") {
break;
}
}
if (j == dirlist.length) {
threads.start(function() {
toast(name+" 开始下载。。。");
files.writeBytes(music_down+"/"+name+".mp3", http.get(url1).body.bytes());//
toastLog(name+" 下载成功!");
});
} else {toast("音乐已存在!")}
break;
case 1:
if(files.exists(music_down+"/"+name+".mp3")){
toast(name);
app.viewFile(music_down+"/"+name+".mp3");
}else{toast("还没有下载 ⊙ω⊙");}
break;
}
});
}
function getMusic(word, source, page, num) {
if (!word) {
return;
}
url = "https://y.xuelg.com/api.php?callback=jQuery111305475340320325446_1529241763041&types=search&count=" + num + "&source=" + source + "&pages=" + page + "&name=" + word;
let m = http.get(url).body.string();
eval("m = " + m.substr(m.indexOf('(')));
music_list.pop();
if (m.length == 0) {
toast("没有更多了");
}
for (i in m) {
url = "https://y.xuelg.com/api.php?callback=jQuery111306503234710876828_1529243003818&types=" + "pic" + "&id=" + m[i].pic_id + "&source=" + m[i].source;
mstr = http.get(url).body.string();
eval(mstr = mstr.substr(mstr.indexOf('(')));
mstr = mstr.replace(/\\/g, "");
m[i]["pic"] = mstr.match(/http[^"]*/g)[0];
music_list.push(m[i]);
}
music_list.push({
name: " 加载更多",
pic: "#ffffff",
artist: "",
id: "0"
});
return m;
}
function download_music(id, source) {
url = "https://y.xuelg.com/api.php?callback=jQuery111306503234710876828_1529243003818&types=" + "url" + "&id=" + id + "&source=" + source;
mstr = http.get(url).body.string();
eval(mstr = mstr.substr(mstr.indexOf('(')));
mstr = mstr.replace(/\\/g, "");
m = [];
try {
m["url"] = mstr.match(/url\":\"[^"]*/g)[0].match(/http.*/g)[0];
m["size"] = mstr.match(/size\":[^,]*/g)[0].match(/\d.*/g)[0];
m["br"] = mstr.match(/br\":[^}]*/g)[0].match(/\d.*/g)[0];
} catch (e) {
log(e)
}
return m;
}
function netease_hot() {
url = "https://y.xuelg.com/api.php?callback=jQuery111305475340320325446_1529241763034&types=playlist&id=3778678";
hot = http.get(url).body.string();
hot = hot.match(/"tracks":.*/g)[0];
eval("hot = " + hot.substr(9).replace(/,"trackIds".*/g, ""));
for (i in hot) {
music_list.push({
id: hot[i].id,
name: hot[i].name,
artist: hot[i].ar[0].name,
pic: hot[i].al.picUrl
});
}
return hot;
}
function query(numbel) {
ui.run(() => {
ui.sj.setText("");
ui.gsd.setText("");
ui.klx.setText("");
ui.qh.setText("");
ui.yzbm.setText("");
});
let url = "http://m.ip138.com/mobile.asp?mobile=";
let html = http.get(url + numbel).body.string();
html = cutstr(html, "
", 2, 20);
if (html) {
str = html.replace(/[<>\/tdspan]+/g, "\n").split("\n");
return str;
} else {
toast("您输入的号码有误,请重新输入!");
return false;
}
}
function sfz(ble) {
ui.run(() => {
ui.xb.setText("");
ui.csrq.setText("");
ui.fzd.setText("");
});
let url = "http://qq.ip138.com/shenfenzheng/search.asp";
let html = http.post(url, {
"userid": ble,
"action": "idcard"
}).body.string();
html = cutstr(html, "- ", 12, 16);
html = html.split(">");
if (html.length>2) {
return html;
} else {
toast("身份证号码错误或不存在!");
return false;
}
}
function iip() {
var getIp_api = http.get('http://pv.sohu.com/cityjson?ie=utf-8');
var InetIP = getIp_api.body.string();
eval(InetIP);
return returnCitySN.cip;
}
function chaip(ble) {
ui.run(() => {
ui.sff.setText("");
ui.dqq.setText("");
ui.ysss.setText("");
});
let url = "http://ip.taobao.com/service/getIpInfo.php?ip=";
let html = http.get(url + ble, {
headers: {
'Accept-Language': 'zh-cn,zh;q=0.5',
'User-Agent': 'Mozilla/5.0(Macintosh;IntelMacOSX10_7_0)AppleWebKit/535.11(KHTML,likeGecko)Chrome/17.0.963.56Safari/535.11'
}
}).body.json();
return html;
}
function asd(dd){
let sum = chaip(dd);
if (sum) {
ui.run(() => {
ui.ipp.setText(sum.data.ip);
ui.gjia.setText(sum.data.country);
ui.sff.setText(sum.data.region);
ui.dqq.setText(sum.data.city);
ui.ysss.setText(sum.data.isp);
});
}
}
function 上传图片(path) {
var url = "http://pic.sogou.com/pic/upload_pic.jsp";
var res = http.postMultipart(url, {
"file": open(path),
});
var t = res.body.string();
return t;
}
function dwz(url) {
ui.run(() => {
ui.xb.setText("");
});
let html = http.get("http://api.c7.gg/api.php?url=" + url).body.string();
return html;
}
function Problem_feedback(){
var str = "";
str += "软件版本名称:" + app.versionName;
str += "\n软件版本号:" + app.versionCode;
str += "\n屏幕宽度:" + device.width;
str += "\n屏幕高度:" + device.height;
str += "\n主板:" + device.board;
str += "\n制造商:" + device.brand;
str += "\n型号:" + device.model;
str += "\n产品名称:" + device.product;
str += "\n唯一标识码:" + device.fingerprint;
str += "\nIMEI: " + device.getIMEI();
str += "\nAndroidId: " + device.getAndroidId();
str += "\nMac: " + device.getMacAddress();
str += "\nAPI: " + device.sdkInt;
str += "\n电量: " + device.getBattery();
return str;
}
function updata() {
threads.start(function() {
let res = http.get("http://1024.luaapp.top/data.json", {
headers: {'Cookie': cookie}
});
if (res.statusCode != 200) {
toast("更新失败: " + res.statusCode + " " + res.statusMessage);
return;
}
let json = res.body.json();
if (versionCode < json["versionCode"]) {
if (json["code"] == 0) {
confirm(json["title"] + json["versionName"], json["content"], (value) => {
if (value) {
toast("正在更新。。请稍候。。。。");
basePath = engines.myEngine().cwd();
codePath = basePath + "/" + curFileName + ".js";
downloadCode(json["url"], codePath);
}
});
}
}
});
}
function downloadCode(url, localPath) {
threads.start(function() {
try{
http.get("https://www.apiopen.top/addStatistics?appKey=bb915a1e008921683029b94219b7d9bf&type=123&typeId=1&count=1");
let res = http.get(url, {
headers: {'Cookie': cookie}
});
if (res.statusCode != 200) {
toast("下载失败: " + res.statusCode + " " + res.statusMessage);
return;
}
str = res.body.string();
files.write(localPath, str);
toast("脚本更新完成,正在重新加载。。");
ui.finish();
engines.execScriptFile(localPath);
}catch (e){
log(e);
toast("更新失败");
return false;}
});
}
function lishi() {
threads.start(function() {
let now = new Date();
let res = http.get("https://api.avatardata.cn/HistoryToday/LookUp?key=f7b28a4506af42b297a7925bfb0d9b89&yue=" + (now.getMonth() + 1) + "&ri=" + now.getDate() + "&type=1&page=1&rows=40").body.string();
return Handle(res);
})
};
function code(){
return 'engines.execScript("hello world",'+ui.text.text()+');'+b64;
}
function ec(str) {
return java.lang.String(android.util.Base64.encode(java.lang.String(str).getBytes(), 2));
}
function b64(str){
return java.lang.String(android.util.Base64.decode(java.lang.String(str).getBytes(),0));
}
function encode(byteContent,password,lx,iv){
var key = javax.crypto.spec.SecretKeySpec(password, "AES");
var cipher = javax.crypto.Cipher.getInstance(lx);
if((ui.ams.text()+"")=="ECB▼"){
cipher.init(javax.crypto.Cipher.ENCRYPT_MODE, key);
}else{
cipher.init(javax.crypto.Cipher.ENCRYPT_MODE, key,javax.crypto.spec.IvParameterSpec(iv));
}
return cipher.doFinal(byteContent);
}
function decode(byteContent,password,lx,iv){
var key = javax.crypto.spec.SecretKeySpec(password, "AES");
var cipher = javax.crypto.Cipher.getInstance(lx);
if((ui.ams.text()+"")=="ECB▼"){
cipher.init(javax.crypto.Cipher.DECRYPT_MODE, key);
}else{
cipher.init(javax.crypto.Cipher.DECRYPT_MODE, key,javax.crypto.spec.IvParameterSpec(iv));
}
return cipher.doFinal(byteContent);
}
function md5(str,lx){
var md5 = java.security.MessageDigest.getInstance(lx);
md5.update(java.lang.String(str).getBytes());
return md5.digest();
}
function randomx(n){
var str="";
for(var i=0;i
{if(value){down();}else{toast("不下载将无法使用二维码识别功能")}})}
}
function down(){
threads.start(function(){
let url = "http://bmob-cdn-21628.b0.upaiyun.com/2018/11/18/20cefe4640fa37fa8032197d0d502a7b.dex";
let res = http.get(url);
if(res.statusCode != 200){
toast("下载失败");
}
files.writeBytes("/sdcard/Android/dey.dex", res.body.bytes());
toast("下载成功");});
}
function startChooseFile(mimeType, callback) {
var i = new android.content.Intent(android.content.Intent.ACTION_GET_CONTENT);
i.setType(mimeType);
ResultIntent.startActivityForResult(i, function(resultCode, data) {
if (resultCode != activity.RESULT_OK) return;
var f = URIUtils_uriToFile(data.getData());
ui.run(() => {
ui.text_test.setText(f);
});
});
}
function conversion(text, num) {
if (!parseInt(text)) {
return ""
};
return Number(text).toString(num);
};
function search(word) {
threads.start(function() {
let temp_arr = searchVideo(word);
len = search_list.length;
for (i = 0; i < len; i++) {
search_list.pop();
}
if (temp_arr.length == 0) {
toast("未找到该视频");
}
for (i in temp_arr) {
search_list.push({
icon: "@drawable/ic_play_circle_filled_white_black_48dp",
name: temp_arr[i].name,
url: temp_arr[i].url
});
}
});
ui.list.setDataSource(search_list);
}
function videoDetails(url) {
html = http.get(url).body.string();
while (html.length < 2000) {
sleep(1000);
html = http.get(url).body.string();
}
zhez1 = /checked=\"\" \/>[^$]*.http[^<]*/g //链接和名称
html = html.match(zhez1);
result = [];
for (i in html) {
temp_arr = html[i].split('$');
result.push({
name: temp_arr[0].substr("/checked=\"\" \/>".length - 1),
url: temp_arr[1]
});
}
return result;
}
function searchVideo(word) {
url = "http://www.okzy.me/index.php?m=vod-search&wd=" + word;
html = http.get(url).body.string();
while (html.length < 3000) {
sleep(200);
html = http.get(url).body.string();
}
zhez1 = /class=\"xing_vb4\"><\/span>/g //链接和名称
html = html.match(zhez1);
zhez2 = /[^"]*(?=.html)/g //链接
zhez3 = /[^>]*(?=<\/a>)/g //名称
result = [];
for (i in html)
result.push({
name: html[i].match(zhez3)[0],
url: "http://www.okzy.me/" + html[i].match(zhez2)[0] + ".html"
});
return result;
}
function loadimg(word, num) {
newimgs = []
threads.start(function() {
newimgs1 = getimages(word, num++);
for (i in newimgs1) {
newimgs.push(newimgs1[i]);
}
});
ui.list.setDataSource(newimgs);
}
function getimages(word, num) {
pn = num * 30;
url = "https://image.baidu.com/search/index?tn=baiduimage&ipn=r&ct=201326592&cl=2&lm=-1&st=-1&fr=&sf=1&fmq=1526269427171_R&pv=&ic=0&nc=1&z=&se=1&showtab=0&fb=0&width=&height=&face=0&istype=2&ie=utf-8&word=" + word + "&pn=" + pn;
htmltext = http.get(url).body.string();
thumbzhz = /app.setData\('imgData',.+}/g;
htmltext = htmltext.match(thumbzhz);
if (htmltext == null) {
toast("没有图了");
top--;
return null;
}
imgstr = htmltext[0].substr("app.setData('imgData',".length, htmltext[0].length);
eval(" var imgjson = [" + imgstr + '][0];');
len = imgjson.data.length;
listNum = imgjson.listNum;
images = [];
for (i = 0; i < len - 1; i++) {
images[i] = imgjson.data[i].objURL;
}
return images;
}
function menu(url1) {
let a = ["下载", "取消"];
let img_path = tipArr.img_path;
dialogs.select(null, a, function(i) {
switch (i) {
case 0:
name = url1.replace(/\//g, "_");
dirlist = files.listDir(img_path);
let j;
for (j = 0; j < dirlist.length; j++) {
if (dirlist[j] == name) {
break;
}
}
if (j == dirlist.length) {
threads.start(function() {
files.writeBytes(img_path + name, http.get(url1).body.bytes());
toast("已下载到" + img_path);
});
} else {
toast("图片已存在")
}
break;
}
});
}
function Handle(str) {
var json = JSON.parse(str);
for (let i = 0; i < json.result.length; i++) {
txt.push({
title: json.result[i].year + "-"+ json.result[i].month + "-" +json.result[i].day +" " + json.result[i].title
});
}
}
function Time() {
var nowTime = threads.start(function() {
while (isOn) {
sleep(100);
ui.run(function() {
ui.now.setText(String((new Date().getTime())).slice(0, -3));
});
}
});
}
function toTime(time) {
if (time) {
return new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(time));
} else {
return new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
}
}
function toDate(endTime) {
var date = new Date();
date.setFullYear(endTime.substring(0, 4));
date.setMonth(endTime.substring(5, 7) - 1);
date.setDate(endTime.substring(8, 10));
date.setHours(endTime.substring(11, 13));
date.setMinutes(endTime.substring(14, 16));
date.setSeconds(endTime.substring(17, 19));
return Date.parse(date) / 1000;
}
你可能感兴趣的:(脚本源码)