├── LICENSE ├── README.md ├── lib ├── BASE64加解密.js ├── IP地址查询.js ├── Last_day.js ├── relationship.js ├── vip视频解析2.0.js ├── weixin.js ├── wenti.js ├── 一键AES加解密.js ├── 二维码生成.js ├── 二维码识别.js ├── 亲戚关系.js ├── 倒数日.js ├── 历史上的今天.js ├── 号码归属地查询.js ├── 图片转链接.js ├── 密码生成器.js ├── 成语词典.js ├── 文字翻译.js ├── 文字识别.js ├── 时间截转换.js ├── 每日一句(英文励志).js ├── 百度搜图.js ├── 短网址生成.js ├── 短视频解析(web).js ├── 网页源码浏览.js ├── 网页翻译器.js ├── 聊天机器人.js ├── 脚本一键BASE64.js ├── 视频搜索.js ├── 调色板2.0.js ├── 身份证查询.js ├── 进制计算器.js └── 音乐下载.js ├── main.js ├── project.json ├── res ├── ic_card_giftcard_black_48dp.png ├── ic_exit_to_app_black_48dp.png ├── ic_help_outline_black_48dp.png ├── ic_info_outline_black_48dp.png ├── ic_keyboard_backspace_black_48dp.png ├── ic_message_black_48dp.png ├── ic_refresh_black_48dp.png ├── ic_share_black_48dp.png ├── ic_touch_app_black_48dp.png ├── logo.png └── splashIcon.png └── 多功能工具箱_v0.29.10.apk /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 wu737 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 多功能工具箱 2 | --- 3 | ## 简介 4 | 多功能工具箱是一款类似于一个木函的多应用集成软件,这里我们集合了一些常用到的功能。 5 | 由于之前的版本过于臃肿,添加新功能非常复杂,特此重新排版整合整合,把功能分开,这样便于添加新功能。 6 | 工具箱里面的脚本部分是从Auto.js的QQ群收集而来的,由于时间久远,已经不知道脚本作者是谁了,未能联系到作者,在这里说声抱歉,如有侵权,请联系我们。我们将会及时删除。 7 | 8 | 9 | >基于 [Auto.js Pro 8.0](https://pro.autojs.org/) 。理解上和电脑版的按键精灵的区别不大。同时带上 [hyb1996](https://github.com/hyb1996) 大佬的开源的 free 版的 auto.js,参见这个仓库 [Auto.js](https://github.com/hyb1996/Auto.js) ,里面有相关的使用,有兴趣给这个点个星星哈哈哈,是个超棒的项目呢。 10 | 11 | 12 | ## 主要功能 13 | 1. 文字翻译 14 | 2. 文字识别 15 | 3. 成语词典 16 | 4. 号码归属地查询 17 | 5. IP地址查询 18 | 6. 身份证查询 19 | 7. 聊天机器人(图灵接口) 20 | 8. 密码生成器 21 | 9. 网页源码浏览 22 | 10. 调色板2.0 23 | 11. 每日一句(引文励志) 24 | 12. 短网址生成 25 | 13. 二维码生成 26 | 14. 二维码识别 27 | 15. 图片转链接 28 | 16. 音乐下载器 29 | 17. 一键AES加/解密 30 | 18. 脚本一键BASE64 31 | 19. 进制计算器 32 | 20. VIP视频解析2.0 33 | 21. 短视频解析(web) 34 | 22. 历史上的今天 35 | 23. 百度搜图 36 | 24. 视频搜索 37 | 25. 网页翻译器 38 | 26. BASE64加解密 39 | 27. 时间截转换 40 | 28. 亲戚关系查询 41 | 29. 倒数日 42 | 43 | >PS:由于部分脚本的服务是从网上寻找的,由于api变动或者网站迁移,现在可能有部分功能现在可能已经用不了。 44 | 如果你有什么好的脚本,欢迎提issue。 45 | 如果你有什么好的脚本,欢迎提issue。 46 | 如果你有什么好的脚本,欢迎提issue。 47 | 48 | ## 脚本主界面截图 49 | >配色、UI都有点难看,将就一下吧,能用就行了 50 | 51 | ![界面一](http://abc.svip925.top/pan/uploads/2019.jpg) 52 | 53 | 54 | ## 运行问题 55 | - 方式一 下载这个项目代码,导入手机 ``/sdcard/脚本/`` 目录下, 然后下载Auto.js, 选择```main.js```运行。 56 | - 方式二 直接下载打包好的APK文件,安装运行。 57 | 58 | ## 源码打包问题 59 | >注意:下载源码后,如果需要打包的话,请把```lib```目录下的脚本文件名文件修改成英文文件名,同时修改```main.js```里面的对应的内容。 60 | 61 | # LICENSE 62 | MIT 63 | -------------------------------------------------------------------------------- /lib/BASE64加解密.js: -------------------------------------------------------------------------------- 1 | "ui"; 2 | ui.layout( 3 | 4 | 5 | 7 | BASE64加/解密 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ); 32 | ui.jia.click(() => { 33 | let str = ui.input.text(); 34 | if (str.length > 1) { 35 | ui.output.setText(ec(str)); 36 | } 37 | }); 38 | 39 | ui.jie.click(() => { 40 | let str = ui.input.text(); 41 | if (str.length > 1) { 42 | ui.output.setText(b64(str)); 43 | } 44 | }); 45 | 46 | ui.zha.click(() => { 47 | ui.input.setText(getClip()); 48 | }); 49 | 50 | ui.cl1.click(() => { 51 | ui.input.setText(""); 52 | }); 53 | 54 | ui.cpy.click(() => { 55 | let str = ui.output.text(); 56 | if (str.length > 1) { 57 | setClip(str); 58 | toast("复制成功"); 59 | } 60 | }); 61 | 62 | ui.cl2.click(() => { 63 | ui.output.setText(""); 64 | }); 65 | 66 | function ec(str) { 67 | return java.lang.String(android.util.Base64.encode(java.lang.String(str).getBytes(), 2)); 68 | } 69 | 70 | function b64(str) { 71 | return java.lang.String(android.util.Base64.decode(java.lang.String(str).getBytes(), 0)); 72 | } -------------------------------------------------------------------------------- /lib/IP地址查询.js: -------------------------------------------------------------------------------- 1 | "ui"; 2 | ui.layout( 3 | 4 | 5 | 6 | 当前的IP地址: 7 | 8 | 9 | 10 | 11 | 26 | 27 | 28 | ); 29 | ui.ID.on("touch", () => { 30 | ui.t1.setText("标题") 31 | ui.ID.setHint("") 32 | if (ui.Password.getText() == "") { 33 | ui.t2.setText("") 34 | ui.Password.setHint("内容") 35 | } 36 | }); 37 | 38 | ui.Password.on("touch", () => { 39 | ui.t2.setText("内容") 40 | ui.Password.setHint("") 41 | if (ui.ID.getText() == "") { 42 | ui.t1.setText("") 43 | ui.ID.setHint("标题") 44 | } 45 | }); 46 | ui.Login.on("click", () => { 47 | if (ui.ID.getText() != "") { 48 | if (ui.Password.getText() != "") { 49 | sc_send(ui.ID.text(), ui.Password.text()) 50 | } else { 51 | ui.Password.setError("请输入详细内容描述") 52 | } 53 | } else { 54 | ui.ID.setError("请输入标题") 55 | } 56 | }); 57 | ui.bg.on("touch", () => { 58 | if (ui.Password.getText() == "") { 59 | ui.t2.setText("") 60 | ui.Password.setHint("内容") 61 | } 62 | if (ui.ID.getText() == "") { 63 | ui.t1.setText("") 64 | ui.ID.setHint("标题") 65 | } 66 | }); 67 | ui.exit.on("click", () => { 68 | ui.finish(); 69 | }); 70 | function sc_send(text, desp) { 71 | let key = "SCU47059T2b9500c63e4d90d57c008cedbc46d12f5c9759c03578e"; 72 | http.post("https://sc.ftqq.com/" + key + ".send", { 73 | 'text': "多功能工具箱:" + text, 74 | 'desp': desp 75 | }, { 76 | headers: { 77 | 'header': 'Content-type: application/x-www-form-urlencoded', 78 | } 79 | }, function (res) { 80 | if (res.body.json().errmsg == "success") { 81 | dialogs.alert("提示", "开发者已经收到,在这里感谢您的反馈,因为有您,我们会越来越好。\n\n祝您生活愉快🌹🌹"); 82 | } 83 | }); 84 | } 85 | -------------------------------------------------------------------------------- /lib/一键AES加解密.js: -------------------------------------------------------------------------------- 1 | "ui"; 2 | ui.layout( 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | ); 13 | ui.calc.click(() => { 14 | startChooseFile("image/*"); 15 | }); 16 | 17 | ui.up.click(() => { 18 | threads.start(function () { 19 | let ert = ui.text_test.text(); 20 | if (ert) { 21 | let wsx = Dist(ui.text_test.text()); 22 | if (wsx) { 23 | ui.run(() => { 24 | ui.text_url.setText(wsx); 25 | }); 26 | } 27 | } else { toast("请先选择图片"); } 28 | }); 29 | }); 30 | ui.text_url.click(() => { 31 | let xbj = ui.text_url.text(); 32 | if (xbj) { 33 | setClip(xbj); 34 | toast("复制成功"); 35 | } 36 | }); 37 | 38 | function Dist(imgPath) { 39 | deypath = "/sdcard/Android/dey.dex"; 40 | if (files.isFile(deypath)) { 41 | try { 42 | runtime.loadDex(deypath); 43 | importPackage(com.google.zxing); 44 | importPackage(com.google.zxing.common); 45 | importPackage(com.google.zxing.client.j2se); 46 | var pixels = images.readPixels(imgPath); 47 | var w = pixels.width; 48 | var h = pixels.height; 49 | var binaryBitmap = new BinaryBitmap(new HybridBinarizer( 50 | new RGBLuminanceSource(w, h, pixels.data))); 51 | var qrCodeResult = new MultiFormatReader().decode(binaryBitmap); 52 | let edc = qrCodeResult.getText(); 53 | toastLog(edc); 54 | return edc; 55 | } catch (e) { toast("识别错误!!"); return false; } 56 | } else { confirm("插件下载", "识别二维码需要下载插件,下载?", (value) => { if (value) { down(); } else { toast("不下载将无法使用二维码识别功能") } }) } 57 | } 58 | function down() { 59 | threads.start(function () { 60 | let url = "http://bmob-cdn-21628.b0.upaiyun.com/2018/11/18/20cefe4640fa37fa8032197d0d502a7b.dex"; 61 | let res = http.get(url); 62 | if (res.statusCode != 200) { 63 | toast("下载失败"); 64 | } 65 | files.writeBytes("/sdcard/Android/dey.dex", res.body.bytes()); 66 | toast("下载成功"); 67 | }); 68 | } 69 | 70 | function startChooseFile(mimeType, callback) { 71 | var i = new android.content.Intent(android.content.Intent.ACTION_GET_CONTENT); 72 | i.setType(mimeType); 73 | ResultIntent.startActivityForResult(i, function (resultCode, data) { 74 | if (resultCode != activity.RESULT_OK) return; 75 | var f = URIUtils_uriToFile(data.getData()); 76 | ui.run(() => { 77 | ui.text_test.setText(f); 78 | }); 79 | }); 80 | } 81 | var ResultIntent = { 82 | intentCallback: {}, 83 | init: function () { 84 | activity.getEventEmitter().on("activity_result", (requestCode, resultCode, data) => { 85 | this.onActivityResult(requestCode, resultCode, data); 86 | }); 87 | }, 88 | startActivityForResult: function (intent, callback) { 89 | var i; 90 | for (i = 0; i < 65536; i++) { 91 | if (!(i in this.intentCallback)) break; 92 | } 93 | if (i >= 65536) { 94 | toast("启动Intent失败:同时请求的Intent过多"); 95 | return; 96 | } 97 | this.intentCallback[i] = callback; 98 | activity.startActivityForResult(intent, i); 99 | }, 100 | onActivityResult: function (requestCode, resultCode, data) { 101 | var cb = this.intentCallback[requestCode]; 102 | if (!cb) return; 103 | delete this.intentCallback[requestCode]; 104 | cb(resultCode, data); 105 | } 106 | }; 107 | ResultIntent.init(); 108 | 109 | function URIUtils_uriToFile(uri) { //Source : https://www.cnblogs.com/panhouye/archive/2017/04/23/6751710.html 110 | var r = null, 111 | cursor, column_index, selection = null, 112 | selectionArgs = null, 113 | isKitKat = android.os.Build.VERSION.SDK_INT >= 19, 114 | docs; 115 | if (uri.getScheme().equalsIgnoreCase("content")) { 116 | if (isKitKat && android.provider.DocumentsContract.isDocumentUri(activity, uri)) { 117 | if (String(uri.getAuthority()) == "com.android.externalstorage.documents") { 118 | docs = String(android.provider.DocumentsContract.getDocumentId(uri)).split(":"); 119 | if (docs[0] == "primary") { 120 | return android.os.Environment.getExternalStorageDirectory() + "/" + docs[1]; 121 | } 122 | } else if (String(uri.getAuthority()) == "com.android.providers.downloads.documents") { 123 | uri = android.content.ContentUris.withAppendedId( 124 | android.net.Uri.parse("content://downloads/public_downloads"), 125 | parseInt(android.provider.DocumentsContract.getDocumentId(uri)) 126 | ); 127 | } else if (String(uri.getAuthority()) == "com.android.providers.media.documents") { 128 | docs = String(android.provider.DocumentsContract.getDocumentId(uri)).split(":"); 129 | if (docs[0] == "image") { 130 | uri = android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI; 131 | } else if (docs[0] == "video") { 132 | uri = android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI; 133 | } else if (docs[0] == "audio") { 134 | uri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; 135 | } 136 | selection = "_id=?"; 137 | selectionArgs = [docs[1]]; 138 | } 139 | } 140 | try { 141 | cursor = activity.getContentResolver().query(uri, ["_data"], selection, selectionArgs, null); 142 | if (cursor && cursor.moveToFirst()) { 143 | r = String(cursor.getString(cursor.getColumnIndexOrThrow("_data"))); 144 | } 145 | } catch (e) { 146 | log(e) 147 | } 148 | if (cursor) cursor.close(); 149 | return r; 150 | } else if (uri.getScheme().equalsIgnoreCase("file")) { 151 | return String(uri.getPath()); 152 | } 153 | return null; 154 | } -------------------------------------------------------------------------------- /lib/亲戚关系.js: -------------------------------------------------------------------------------- 1 | "ui"; 2 | ui.layout( 3 | 4 | 亲戚称谓 OR 关系计算器 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 要找的称谓 14 | 15 | 获取到的结果 16 | 17 | 点击添加关系 18 | 19 | 20 | 21 | 22 | 23 | 24 | ); 25 | var relationship = require("./lib/relationship.js"); 26 | var isMe = false, 27 | isSex = false; 28 | ui.in.setClickable(false); 29 | ui.in.setEnabled(false); 30 | ui.in.setFocusable(false); 31 | ui.in2.setClickable(false); 32 | ui.in2.setEnabled(false); 33 | ui.in2.setFocusable(false); 34 | ui.list.setFocusable(false); 35 | 36 | var txt = ["父", "母", "夫", "妻", "子", "女", "兄", "弟", "姐", "妹", "DEL", "AC", "COPY", "EXIT"]; 37 | var txt2 = ["爸爸", "妈妈", "老公", "老婆", "儿子", "女儿", "哥哥", "弟弟", "姐姐", "妹妹"]; 38 | 39 | ui.list.setDataSource(txt); 40 | 41 | ui.isMe.on("check", (checked) => { 42 | isMe = checked; 43 | }); 44 | ui.isSex.on("check", (checked) => { 45 | isSex = checked; 46 | }); 47 | ui.list.on("item_click", function(item, i) { 48 | switch (item) { 49 | case "DEL": 50 | ui.run(function() { 51 | let del = (ui.in.text().length > 2) ? 3 : 2; 52 | ui.in.setText(ui.in.text().slice(0, -del)); 53 | }); 54 | break; 55 | case "AC": 56 | ui.in.setText(""); 57 | break; 58 | case "COPY": 59 | setClip(ui.in.text()); 60 | break; 61 | case "EXIT": 62 | exit(); 63 | break; 64 | default: 65 | let txtStr = (ui.in.text().length == 0) ? ui.in.text() + txt2[i] : ui.in.text() + "的" + txt2[i]; 66 | ui.in.setText(txtStr); 67 | } 68 | }); 69 | ui.in.addTextChangedListener(new android.text.TextWatcher({ 70 | afterTextChanged: function(key) { 71 | if (key != '') { 72 | var options = { 73 | text: ui.in.text(), //输入的文本 74 | sex: (isSex == true) ? 0 : 1, //自己的性别:0女性,1男性 75 | type: "default", //转换类型:'default'算称谓,'chain'算关系(此时reverse无效) 76 | reverse: (isMe == true) ? true : false //称呼方式:true对方称呼我,false我称呼对方 77 | }; 78 | let call = relationship(options); 79 | let callTxt = ""; 80 | if (call.length == 0) callTxt = "啊,暂时没有合适的称谓,这样吧,男的叫哥哥,女的叫姐姐"; 81 | for (let i = 0; i < call.length; i++) { 82 | callTxt = callTxt + "\n" + call[i]; 83 | } 84 | ui.run(function() { 85 | ui.in2.setText(callTxt); 86 | }); 87 | } 88 | } 89 | })); -------------------------------------------------------------------------------- /lib/倒数日.js: -------------------------------------------------------------------------------- 1 | "ui"; 2 | ui.layout( 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | ); 23 | threads.start(function() { 24 | eval(files.read("./lib/Last_day.js")); 25 | let festList = initFestList(); 26 | var array = []; 27 | for (let v in festList) { 28 | array.push({ 29 | "title": festList[v].festName, 30 | "data": festList[v].festDay, 31 | "time": festList[v].festNextTime 32 | }); 33 | } 34 | ui.run(function() { 35 | ui.List.setDataSource(array); 36 | }); 37 | }); 38 | ui.List.on("item_click", function(item) { 39 | app.openUrl("https://baike.baidu.com/item/" + item.title); 40 | }); -------------------------------------------------------------------------------- /lib/历史上的今天.js: -------------------------------------------------------------------------------- 1 | "ui"; 2 | ui.layout( 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | ); 11 | var txt = []; 12 | lishi(); 13 | ui.run(function () { 14 | ui.List.setDataSource(txt); 15 | }); 16 | function lishi() { 17 | threads.start(function () { 18 | let now = new Date(); 19 | 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.json(); 20 | return Handle(res); 21 | }) 22 | }; 23 | function Handle(str) { 24 | var json = str; 25 | for (let i = 0; i < json.result.length; i++) { 26 | txt.push({ 27 | title: json.result[i].year + "-" + json.result[i].month + "-" + json.result[i].day + " " + json.result[i].title 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/号码归属地查询.js: -------------------------------------------------------------------------------- 1 | "ui"; 2 | 3 | ui.layout( 4 | 5 | 6 | 手机号码(段): 7 | 8 | 9 | 7 | 8 | 9 | 10 | 11 | ); 12 | 13 | ui.calc.click(() => { 14 | startChooseFile("*/*"); 15 | }); 16 | 17 | ui.up.click(() => { 18 | threads.start(function () { 19 | let wsx = 上传图片(ui.text_test.text()); 20 | ui.run(() => { 21 | ui.text_url.setText(wsx); 22 | }); 23 | }); 24 | }); 25 | ui.text_test.click(() => { 26 | let xllj = ui.text_test.text(); 27 | if (xllj) { 28 | setClip(xllj); 29 | toast("复制成功"); 30 | } 31 | }); 32 | 33 | ui.text_url.click(() => { 34 | let xbj = ui.text_url.text(); 35 | if (xbj) { 36 | setClip(xbj); 37 | toast("复制成功"); 38 | } 39 | }); 40 | function 上传图片(path) { 41 | var url = "http://pic.sogou.com/pic/upload_pic.jsp"; 42 | var res = http.postMultipart(url, { 43 | "file": open(path), 44 | }); 45 | var t = res.body.string(); 46 | return t; 47 | } 48 | 49 | 50 | function startChooseFile(mimeType, callback) { 51 | var i = new android.content.Intent(android.content.Intent.ACTION_GET_CONTENT); 52 | i.setType(mimeType); 53 | ResultIntent.startActivityForResult(i, function (resultCode, data) { 54 | if (resultCode != activity.RESULT_OK) return; 55 | var f = URIUtils_uriToFile(data.getData()); 56 | ui.run(() => { 57 | ui.text_test.setText(f); 58 | }); 59 | }); 60 | } 61 | var ResultIntent = { 62 | intentCallback: {}, 63 | init: function () { 64 | activity.getEventEmitter().on("activity_result", (requestCode, resultCode, data) => { 65 | this.onActivityResult(requestCode, resultCode, data); 66 | }); 67 | }, 68 | startActivityForResult: function (intent, callback) { 69 | var i; 70 | for (i = 0; i < 65536; i++) { 71 | if (!(i in this.intentCallback)) break; 72 | } 73 | if (i >= 65536) { 74 | toast("启动Intent失败:同时请求的Intent过多"); 75 | return; 76 | } 77 | this.intentCallback[i] = callback; 78 | activity.startActivityForResult(intent, i); 79 | }, 80 | onActivityResult: function (requestCode, resultCode, data) { 81 | var cb = this.intentCallback[requestCode]; 82 | if (!cb) return; 83 | delete this.intentCallback[requestCode]; 84 | cb(resultCode, data); 85 | } 86 | }; 87 | ResultIntent.init(); 88 | 89 | function URIUtils_uriToFile(uri) { //Source : https://www.cnblogs.com/panhouye/archive/2017/04/23/6751710.html 90 | var r = null, 91 | cursor, column_index, selection = null, 92 | selectionArgs = null, 93 | isKitKat = android.os.Build.VERSION.SDK_INT >= 19, 94 | docs; 95 | if (uri.getScheme().equalsIgnoreCase("content")) { 96 | if (isKitKat && android.provider.DocumentsContract.isDocumentUri(activity, uri)) { 97 | if (String(uri.getAuthority()) == "com.android.externalstorage.documents") { 98 | docs = String(android.provider.DocumentsContract.getDocumentId(uri)).split(":"); 99 | if (docs[0] == "primary") { 100 | return android.os.Environment.getExternalStorageDirectory() + "/" + docs[1]; 101 | } 102 | } else if (String(uri.getAuthority()) == "com.android.providers.downloads.documents") { 103 | uri = android.content.ContentUris.withAppendedId( 104 | android.net.Uri.parse("content://downloads/public_downloads"), 105 | parseInt(android.provider.DocumentsContract.getDocumentId(uri)) 106 | ); 107 | } else if (String(uri.getAuthority()) == "com.android.providers.media.documents") { 108 | docs = String(android.provider.DocumentsContract.getDocumentId(uri)).split(":"); 109 | if (docs[0] == "image") { 110 | uri = android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI; 111 | } else if (docs[0] == "video") { 112 | uri = android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI; 113 | } else if (docs[0] == "audio") { 114 | uri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; 115 | } 116 | selection = "_id=?"; 117 | selectionArgs = [docs[1]]; 118 | } 119 | } 120 | try { 121 | cursor = activity.getContentResolver().query(uri, ["_data"], selection, selectionArgs, null); 122 | if (cursor && cursor.moveToFirst()) { 123 | r = String(cursor.getString(cursor.getColumnIndexOrThrow("_data"))); 124 | } 125 | } catch (e) { 126 | log(e) 127 | } 128 | if (cursor) cursor.close(); 129 | return r; 130 | } else if (uri.getScheme().equalsIgnoreCase("file")) { 131 | return String(uri.getPath()); 132 | } 133 | return null; 134 | } -------------------------------------------------------------------------------- /lib/密码生成器.js: -------------------------------------------------------------------------------- 1 | "ui"; 2 | ui.layout( 3 | 4 | 5 | 复杂密码生成器 6 | 7 | 8 | 设置要生成密码的长度和数量 9 | a 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | ); 31 | ui.str.setChecked(true); 32 | ui.STR.setChecked(true); 33 | ui.num.setChecked(true); 34 | ui.sym.setChecked(true); 35 | ui.text_output.setCursorVisible(false); 36 | ui.text_output.setFocusable(false); 37 | ui.text_output.setHint(' 本程序是百度应用"随机密码生成器"的移植版,唯一不同的是,本程序可以一次性生成多条密码.'); 38 | 39 | var str = 'abcdefghijklmnopqrstuvwxyz'; 40 | var STR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; 41 | var num = '0123456789'; 42 | var sym = '+=-@#~,.[]()!%^*$'; 43 | 44 | ui.make.click(function () { 45 | var PassLength = ui.passlength.text(); 46 | var PassNum = ui.passnum.text(); 47 | if (PassLength == '') { toast('密码长度不能为空!'); return; } 48 | if (PassNum == '') { PassNum = 1; } 49 | if (PassLength < 6 || PassLength > 32) { 50 | toast('长度设置非法!'); 51 | return; 52 | } else if (PassNum == 0) { 53 | toast('生成数量不可为"0"!'); 54 | return; 55 | } 56 | 57 | var text = new Array(); 58 | if (ui.str.isChecked()) { text.push(str); } 59 | if (ui.STR.isChecked()) { text.push(STR); } 60 | if (ui.num.isChecked()) { text.push(num); } 61 | if (ui.sym.isChecked()) { text.push(sym); } 62 | if (!ui.str.isChecked() && !ui.STR.isChecked() && !ui.num.isChecked() && !ui.sym.isChecked()) { 63 | toast('请选择密码的组合元素'); 64 | return; 65 | } 66 | 67 | function randPassword() { 68 | var pw = ''; 69 | for (i = 0; i < PassLength; i++) { 70 | var strpos = random(0, text.length - 1); 71 | pw += text[strpos].charAt(random(0, text[strpos].length - 1)); 72 | } 73 | return pw; 74 | } 75 | var Result1 = ''; 76 | for (var j = 0; j < PassNum; j++) { 77 | var Result = randPassword(); 78 | if (j > 0) { 79 | Result1 += '\n'; 80 | } 81 | Result1 += Result; 82 | 83 | } 84 | ui.text_output.setText(Result1); 85 | }); 86 | 87 | ui.copy.click(function () { 88 | var PasswordText = ui.text_output.text(); 89 | if (PasswordText != null && PasswordText != '') { 90 | setClip(PasswordText); 91 | var ClipText = getClip(); 92 | if (ClipText == PasswordText) { 93 | toast('已复制到剪贴板!') 94 | } else { 95 | toast('写入剪贴板失败!') 96 | } 97 | } else { 98 | toast('请先生成密码!'); 99 | } 100 | return; 101 | }); -------------------------------------------------------------------------------- /lib/成语词典.js: -------------------------------------------------------------------------------- 1 | "ui"; 2 | var Examples = "起早贪黑\n闻鸡起舞\n默默无闻\n精卫填海\n一叶障目"; 3 | var tip = "功能使用教程\n1.在此区域输入要查询的成语,可批量查询(一个成语一行,具体看可以看示例\n2.\"历史\"查看刚才查询的成语,有时候查询失败,可以点历史在查询一遍\n3.长按 \"历史\"可以查看 \"保存\"的文件\n4.“保存”可以把输入框中的内容进行保存,默认路径在\"/sdcard/成语意思.txt\"\n5.长按 \"保存\"把此区域的文本复制\n6.\“导入\”可以把提前编辑好的成语(一个成语一行)导入查看或查询,默认导入路径\"/sdcard/成语.txt\"\n7.“示例”批量查询成语及导入的标准格式\n\n \n 此脚本并不完美,有兴趣可自行修改\n "; 4 | ui.layout( 5 | 6 | 7 | 成语字典 v1.5 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ); 22 | var list = ["auto", "zh", "en", "yue", "wyw", "jp", "kor", "fra", "cht"]; 23 | ui.ok.on("click", () => { 24 | let txt = ui.get.text(); 25 | var fo = ui.sp1.getSelectedItemPosition(); 26 | var to = ui.sp2.getSelectedItemPosition(); 27 | if (txt) { 28 | var ok1 = threads.start(function () { 29 | let as = Baidu_To(txt, list[fo], list[to + 1]); 30 | if (as) { 31 | ui.run(() => { 32 | ui.te.setText(as); 33 | }); 34 | } else { ui.te.setText(ui.get.text()) }; 35 | }); 36 | } 37 | }); 38 | 39 | ui.copy.on("click", () => { 40 | let tt = ui.te.text(); 41 | if (tt) { 42 | toast("已复制"); 43 | setClip(tt); 44 | } 45 | }); 46 | ui.clos.on("click", () => { 47 | ui.get.setText(""); 48 | ui.te.setText(""); 49 | }); 50 | 51 | function Baidu_To(str,from,to) { 52 | function getMd5(string) { 53 | return java.math.BigInteger(1, java.security.MessageDigest.getInstance("MD5").digest(java.lang.String(string).getBytes())).toString(16) 54 | } 55 | let salt = (new Date).getTime(); 56 | let sign = getMd5("20180125000118573" + str + salt + "O_PrebY0tsdbHjKNOaDf"); 57 | let res = http.post("http://api.fanyi.baidu.com/api/trans/vip/translate?", { 58 | q: str, 59 | appid: "20180125000118573", 60 | salt: salt, 61 | from: from, 62 | to: to, 63 | sign: sign 64 | }); 65 | try{ 66 | str = JSON.parse(res.body.string()).trans_result.map(val => val.dst).join('\n'); 67 | return str; 68 | }catch(e){ 69 | log(e); 70 | toastLog("翻译出现错误!!"); 71 | } 72 | } -------------------------------------------------------------------------------- /lib/文字识别.js: -------------------------------------------------------------------------------- 1 | "ui"; 2 | ui.layout( 3 | 4 | 5 | 6 | 7 | 28 | 29 | 30 | 31 | 32 | 33 | 结果: 34 | 35 | 36 | 37 | 38 | 39 | 41 | 42 | 时间转换成时间截 43 | 44 | 时间: 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 结果: 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | ); 63 | var isOn; 64 | Time(); 65 | ui.in1.setText(String((new Date().getTime())).slice(0, -3)); 66 | ui.in2.setText(toTime()); 67 | 68 | ui.stop.click(() => { 69 | if (ui.stop.text() == "停止") { 70 | ui.stop.text("开始"); 71 | isOn = 0; 72 | } else { 73 | Time(); 74 | ui.stop.text("停止"); 75 | isOn = 1; 76 | } 77 | }); 78 | ui.now.click(() => { 79 | toast("已复制到剪贴板"); 80 | setClip(ui.now.text()); 81 | }); 82 | ui.zh1.click(() => { 83 | ui.ot1.setText(toTime(parseInt(ui.in1.text() + "000"))); 84 | }); 85 | 86 | ui.zh2.click(() => { 87 | ui.ot2.setText(String(toDate(ui.in2.text() + "000"))); 88 | }); 89 | 90 | ui.fz1.click(() => { 91 | let txt1 = ui.ot1.text() 92 | if (txt1.length > 1) { 93 | toast("已复制到剪贴板"); 94 | setClip(txt1); 95 | } 96 | }); 97 | ui.fz2.click(() => { 98 | let txt2 = ui.ot2.text() 99 | if (txt2.length > 1) { 100 | toast("已复制到剪贴板"); 101 | setClip(txt2); 102 | } 103 | }); 104 | 105 | ui.zt1.click(() => { 106 | ui.in1.setText(getClip()); 107 | }); 108 | 109 | ui.zt2.click(() => { 110 | ui.in2.setText(getClip()); 111 | }); 112 | 113 | ui.cl1.click(() => { 114 | ui.in1.setText(""); 115 | }); 116 | 117 | ui.cl2.click(() => { 118 | ui.in2.setText(""); 119 | }); 120 | 121 | function Time() { 122 | var nowTime = threads.start(function () { 123 | while (isOn) { 124 | sleep(100); 125 | ui.run(function () { 126 | ui.now.setText(String((new Date().getTime())).slice(0, -3)); 127 | }); 128 | } 129 | }); 130 | } 131 | 132 | function toTime(time) { 133 | if (time) { 134 | return new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(time)); 135 | } else { 136 | return new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); 137 | } 138 | } 139 | 140 | function toDate(endTime) { 141 | var date = new Date(); 142 | date.setFullYear(endTime.substring(0, 4)); 143 | date.setMonth(endTime.substring(5, 7) - 1); 144 | date.setDate(endTime.substring(8, 10)); 145 | date.setHours(endTime.substring(11, 13)); 146 | date.setMinutes(endTime.substring(14, 16)); 147 | date.setSeconds(endTime.substring(17, 19)); 148 | return Date.parse(date) / 1000; 149 | } -------------------------------------------------------------------------------- /lib/每日一句(英文励志).js: -------------------------------------------------------------------------------- 1 | "ui"; 2 | ui.layout( 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | ); 29 | c2 = ""; 30 | ui.ayuanma.text("openConsole();//显示控制台 \nconsole.info(\"这是绿色\");//显示"); 31 | ui.ashang.click(() => { 32 | try { 33 | engines.execScript("输入代码", "" + ui.ayuanma.text()); 34 | } catch (e) { 35 | toast("运行失败"); 36 | } 37 | }); 38 | ui.ayou.click(() => { 39 | ui.text.text(""); 40 | }); 41 | ui.afuzhi.click(() => { 42 | setClip(ui.text.text()); 43 | toast("复制成功"); 44 | }); 45 | ui.axia.click(() => { 46 | try { 47 | engines.execScript("结果代码", code()); 48 | } catch (e) { 49 | toast("运行失败"); 50 | } 51 | }); 52 | ui.azuo.click(() => { 53 | ui.ayuanma.text(""); 54 | }); 55 | ui.aok.click(() => { 56 | path = "/sdcard/脚本/base64的脚本.js"; 57 | file = open(path, "w"); 58 | file.write(code()); 59 | file.close(); 60 | toast("已生成脚本放在:" + path + ""); 61 | }); 62 | ui.ajiami.click(() => { 63 | c2 = java.lang.String(android.util.Base64.encode(java.lang.String(ui.ayuanma.text() + "").getBytes(), 0)).replace('\n', ''); 64 | ui.text.text('b64("' + c2 + '")'); 65 | }); 66 | function code() { 67 | return 'engines.execScript("hello world",' + ui.text.text() + ');' + b64; 68 | } 69 | function b64(str) { 70 | return java.lang.String(android.util.Base64.decode(java.lang.String(str).getBytes(), 0)); 71 | } -------------------------------------------------------------------------------- /lib/视频搜索.js: -------------------------------------------------------------------------------- 1 | "ui"; 2 | ui.layout( 3 | 4 | 5 | 6 | 7 | 8 |