From 388765c3c9a29f4f608aee2c9d7481fbdd2bdde4 Mon Sep 17 00:00:00 2001 From: Xmader Date: Thu, 17 Oct 2019 00:41:58 -0400 Subject: [PATCH] =?UTF-8?q?v1.2.0=20-=20=E6=94=AF=E6=8C=81=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9=E5=88=B0=20aria2.?= =?UTF-8?q?conf=20=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.xml | 2 +- package-lock.json | 2 +- package.json | 2 +- www/main.js | 228 +++++++++++++++++++++++++++++++++++++--------- 4 files changed, 188 insertions(+), 46 deletions(-) diff --git a/config.xml b/config.xml index 1eba3d2..597a838 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + AriaNgGUI 一个 Aria2 图形界面跨平台客户端 (此为Android版) diff --git a/package-lock.json b/package-lock.json index b030d9b..94e82be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "com.xmader.aria_ng_gui_android", - "version": "1.1.2", + "version": "1.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b21b454..8bb9b67 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.xmader.aria_ng_gui_android", "displayName": "AriaNg GUI for Android", - "version": "1.1.2", + "version": "1.2.0", "description": "一个 Aria2 图形界面跨平台客户端 (此为Android版)", "repository": { "type": "git", diff --git a/www/main.js b/www/main.js index 01d197c..8b94e8e 100644 --- a/www/main.js +++ b/www/main.js @@ -1,5 +1,13 @@ "use strict"; +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } @@ -148,6 +156,80 @@ function () { return function requestWriteExternalStoragePermission() { return _ref.apply(this, arguments); }; +}(); +/** + * 获取文件/目录 Entry + * @param {string} path 文件路径 + * @returns {Promise} + */ + + +var getEntry = function getEntry(path) { + return new Promise(function (resolve, reject) { + window.resolveLocalFileSystemURL(path, resolve, reject); + }); +}; +/** + * 写入文件 + * @param {FileEntry} entry + * @param {BlobPart} data 文件内容 + */ + + +var writeFileEntry = function writeFileEntry(entry, data) { + return new Promise(function (resolve, reject) { + entry.createWriter(function (fileWriter) { + fileWriter.onwriteend = function () { + return resolve(); + }; + + fileWriter.onerror = reject; + var blob = new Blob([data]); + fileWriter.write(blob); + }); + }); +}; +/** + * 读取文件 + * @param {FileEntry} entry + * @returns {Promise} + */ + + +var readFileEntry = +/*#__PURE__*/ +function () { + var _ref2 = _asyncToGenerator( + /*#__PURE__*/ + regeneratorRuntime.mark(function _callee2(entry) { + return regeneratorRuntime.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", new Promise(function (resolve, reject) { + var errorCallback = reject; + entry.file(function (file) { + var reader = new FileReader(); + + reader.onloadend = function () { + resolve(this.result); + }; + + reader.readAsText(file); + }, errorCallback); + })); + + case 1: + case "end": + return _context2.stop(); + } + } + }, _callee2); + })); + + return function readFileEntry(_x) { + return _ref2.apply(this, arguments); + }; }(); // 等待 Cordova 完全加载 @@ -155,11 +237,11 @@ document.addEventListener("deviceready", /*#__PURE__*/ _asyncToGenerator( /*#__PURE__*/ -regeneratorRuntime.mark(function _callee2() { - var appDir, dataDir, aria2FileURL, aria2ConfFileURL, downloadDir, appVersion, logoDiv, copiedFileEntry, copiedAria2FileURL, copiedAria2ConfFileURL, n, res; - return regeneratorRuntime.wrap(function _callee2$(_context2) { +regeneratorRuntime.mark(function _callee4() { + var appDir, dataDir, aria2FileURL, aria2ConfFileURL, downloadDir, appVersion, logoDiv, copiedFileEntry, copiedAria2FileURL, copiedAria2ConfFileURL, confFileEntry, conf, saveLocalConfig, n, res; + return regeneratorRuntime.wrap(function _callee4$(_context4) { while (1) { - switch (_context2.prev = _context2.next) { + switch (_context4.prev = _context4.next) { case 0: appDir = top.cordova.file.applicationDirectory; dataDir = top.cordova.file.dataDirectory; @@ -167,11 +249,11 @@ regeneratorRuntime.mark(function _callee2() { aria2ConfFileURL = appDir + "www/aria2/aria2.conf"; downloadDir = "/storage/emulated/0/Download/"; // 显示 AriaNg GUI for Android 的版本号 - _context2.next = 7; + _context4.next = 7; return top.cordova.getAppVersion.getVersionNumber(); case 7: - appVersion = _context2.sent; + appVersion = _context4.sent; logoDiv = document.getElementById("aria-ng-logo"); logoDiv.title = "AriaNg GUI for Android v".concat(appVersion, " | ").concat(logoDiv.title); // const savedAppVersion = localStorage.getItem("appVersion") // console.log(savedAppVersion) @@ -180,99 +262,159 @@ regeneratorRuntime.mark(function _callee2() { // } // 手动请求 存储空间读写 的权限 - _context2.next = 12; + _context4.next = 12; return requestWriteExternalStoragePermission(); case 12: - _context2.next = 14; + _context4.next = 14; return fileOrDirExistsPromise(dataDir + "aria2.conf"); case 14: - if (_context2.sent) { - _context2.next = 17; + if (_context4.sent) { + _context4.next = 17; break; } - _context2.next = 17; + _context4.next = 17; return copyFilePromise(aria2ConfFileURL, dataDir); case 17: - _context2.next = 19; + _context4.next = 19; return copyFilePromise(aria2FileURL, dataDir); case 19: - copiedFileEntry = _context2.sent; + copiedFileEntry = _context4.sent; // 获取复制到的文件路径 copiedAria2FileURL = copiedFileEntry.nativeURL.replace("file://", ""); - copiedAria2ConfFileURL = copiedAria2FileURL.replace(/\/aria2c$/, "/aria2.conf"); // 运行aria2c前的准备工作 + copiedAria2ConfFileURL = copiedAria2FileURL.replace(/\/aria2c$/, "/aria2.conf"); // 支持保存配置修改到 aria2.conf 配置文件 + + _context4.next = 24; + return getEntry("file://" + copiedAria2ConfFileURL); + + case 24: + confFileEntry = _context4.sent; + conf = ""; + + saveLocalConfig = + /*#__PURE__*/ + function () { + var _ref4 = _asyncToGenerator( + /*#__PURE__*/ + regeneratorRuntime.mark(function _callee3(options) { + return regeneratorRuntime.wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + if (conf) { + _context3.next = 4; + break; + } + + _context3.next = 3; + return readFileEntry(confFileEntry); + + case 3: + conf = _context3.sent; + + case 4: + Object.entries(options).forEach(function (_ref5) { + var _ref6 = _slicedToArray(_ref5, 2), + key = _ref6[0], + value = _ref6[1]; + + var r = new RegExp("^(?:#\\s*)?(".concat(key, "=).*"), "m"); + + if (r.test(conf)) { + conf = conf.replace(r, "$1" + value); + } else { + conf += "\n".concat(key, "=").concat(value); + } + }); + _context3.next = 7; + return writeFileEntry(confFileEntry, conf); + + case 7: + case "end": + return _context3.stop(); + } + } + }, _callee3); + })); + + return function saveLocalConfig(_x2) { + return _ref4.apply(this, arguments); + }; + }(); + + window.saveLocalConfig = saveLocalConfig; // 运行aria2c前的准备工作 // 1. 创建aria2.session会话文件 - _context2.next = 24; + _context4.next = 30; return shellExecPromise(["touch", downloadDir + "aria2.session"]); - case 24: - _context2.next = 26; + case 30: + _context4.next = 32; return shellExecPromise(["chmod", "0777", copiedAria2FileURL]); - case 26: + case 32: // 创建因为端口被占用而运行失败的次数的计数器 n = 0; // 在aria2c异常关闭后自动重启aria2c - case 27: + case 33: if (!true) { - _context2.next = 48; + _context4.next = 54; break; } - _context2.prev = 28; - _context2.next = 31; + _context4.prev = 34; + _context4.next = 37; return shellExecPromise([copiedAria2FileURL, "--conf-path=" + copiedAria2ConfFileURL]); - case 31: - res = _context2.sent; + case 37: + res = _context4.sent; console.log(res.output); // 被手动关闭时取消自动重启aria2c if (!res.output.includes("second(s) has passed. Stopping application.")) { - _context2.next = 35; + _context4.next = 41; break; } - return _context2.abrupt("break", 48); + return _context4.abrupt("break", 54); - case 35: - _context2.next = 46; + case 41: + _context4.next = 52; break; - case 37: - _context2.prev = 37; - _context2.t0 = _context2["catch"](28); - console.log(_context2.t0.output); // 端口被占用达到一定次数后时取消自动重启aria2c + case 43: + _context4.prev = 43; + _context4.t0 = _context4["catch"](34); + console.log(_context4.t0.output); // 端口被占用达到一定次数后时取消自动重启aria2c - if (!_context2.t0.output.includes("Failed to bind a socket, cause: Address already in use")) { - _context2.next = 46; + if (!_context4.t0.output.includes("Failed to bind a socket, cause: Address already in use")) { + _context4.next = 52; break; } if (!(n > 5)) { - _context2.next = 45; + _context4.next = 51; break; } - return _context2.abrupt("break", 48); + return _context4.abrupt("break", 54); - case 45: + case 51: n++; - case 46: - _context2.next = 27; + case 52: + _context4.next = 33; break; - case 48: + case 54: case "end": - return _context2.stop(); + return _context4.stop(); } } - }, _callee2, null, [[28, 37]]); + }, _callee4, null, [[34, 43]]); })), false); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9tYWluLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBOzs7Ozs7QUFPQTtBQUNBLE9BQU8sQ0FBQyxJQUFSO0FBUUE7Ozs7OztBQUtBLElBQU0s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xhcmlhMmNcclxuICAgICAgICAgICAgY29uc3QgcmVzID0gYXdhaXQgc2hlbGxFeGVjUHJvbWlzZShbY29waWVkQXJpYTJGaWxlVVJMLCBcIi0tY29uZi1wYXRoPVwiICsgY29waWVkQXJpYTJDb25mRmlsZVVSTF0pXHJcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKHJlcy5vdXRwdXQpXHJcblxyXG4gICAgICAgICAgICAvLyDooqvmiYvliqjlhbPpl63ml7blj5bmtojoh6rliqjph43lkK9hcmlhMmNcclxuICAgICAgICAgICAgaWYgKHJlcy5vdXRwdXQuaW5jbHVkZXMoXCJzZWNvbmQocykgaGFzIHBhc3NlZC4gU3RvcHBpbmcgYXBwbGljYXRpb24uXCIpKSB7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0gY2F0Y2ggKHJlcykge1xyXG4gICAgICAgICAgICBjb25zb2xlLmxvZyhyZXMub3V0cHV0KVxyXG5cclxuICAgICAgICAgICAgLy8g56uv5Y+j6KKr5Y2g55So6L6+5Yiw5LiA5a6a5qyh5pWw5ZCO5pe25Y+W5raI6Ieq5Yqo6YeN5ZCvYXJpYTJjXHJcbiAgICAgICAgICAgIGlmIChyZXMub3V0cHV0LmluY2x1ZGVzKFwiRmFpbGVkIHRvIGJpbmQgYSBzb2NrZXQsIGNhdXNlOiBBZGRyZXNzIGFscmVhZHkgaW4gdXNlXCIpKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAobiA+IDUpIHtcclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbisrXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbn0sIGZhbHNlKVxyXG4iXX0= \ No newline at end of file +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIj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pblBhdGggPSAoLi4ucGF0aHMpID0+IHtcclxuICAgIHJldHVybiBwYXRocy5qb2luKFwiL1wiKS5yZXBsYWNlKC8oW146XSlcXC97Myx9fChbXi86XSlcXC97Mn0vZywgXCIkMSQyL1wiKVxyXG59XHJcblxyXG4vKipcclxuICog5omL5Yqo6K+35rGCIGFuZHJvaWQucGVybWlzc2lvbi5XUklURV9FWFRFUk5BTF9TVE9SQUdFIOadg+mZkCBcclxuICogQHJldHVybnMge1Byb21pc2U8Ym9vbGVhbj59XHJcbiAqL1xyXG5jb25zdCByZXF1ZXN0V3JpdGVFeHRlcm5hbFN0b3JhZ2VQZXJtaXNzaW9uID0gYXN5bmMgKCkgPT4ge1xyXG5cclxuICAgIC8vIEB0cy1pZ25vcmVcclxuICAgIGNvbnN0IHBlcm1pc3Npb25zID0gd2luZG93LmNvcmRvdmEucGx1Z2lucy5wZXJtaXNzaW9uc1xyXG4gICAgY29uc3QgbmFtZSA9IHBlcm1pc3Npb25zLldSSVRFX0VYVEVSTkFMX1NUT1JBR0VcclxuXHJcbiAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xyXG4gICAgICAgIHBlcm1pc3Npb25zLnJlcXVlc3RQZXJtaXNzaW9uKG5hbWUsIChyZXN1bHQpID0+IHtcclxuICAgICAgICAgICAgaWYgKHJlc3VsdCAmJiByZXN1bHQuaGFzUGVybWlzc2lvbikge1xyXG4gICAgICAgICAgICAgICAgcmVzb2x2ZSh0cnVlKVxyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgcmVqZWN0KGZhbHNlKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSwgKGVycikgPT4ge1xyXG4gICAgICAgICAgICByZWplY3QoZXJyKVxyXG4gICAgICAgIH0pXHJcbiAgICB9KVxyXG5cclxufVxyXG5cclxuLyoqXHJcbiAqIOiOt+WPluaWh+S7ti/nm67lvZUgRW50cnlcclxuICogQHB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o6YeN5ZCvYXJpYTJjXHJcbiAgICB3aGlsZSAodHJ1ZSkge1xyXG4gICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgIC8vIOi/kOihjGFyaWEyY1xyXG4gICAgICAgICAgICBjb25zdCByZXMgPSBhd2FpdCBzaGVsbEV4ZWNQcm9taXNlKFtjb3BpZWRBcmlhMkZpbGVVUkwsIFwiLS1jb25mLXBhdGg9XCIgKyBjb3BpZWRBcmlhMkNvbmZGaWxlVVJMXSlcclxuICAgICAgICAgICAgY29uc29sZS5sb2cocmVzLm91dHB1dClcclxuXHJcbiAgICAgICAgICAgIC8vIOiiq+aJi+WKqOWFs+mXreaXtuWPlua2iOiHquWKqOmHjeWQr2FyaWEyY1xyXG4gICAgICAgICAgICBpZiAocmVzLm91dHB1dC5pbmNsdWRlcyhcInNlY29uZChzKSBoYXMgcGFzc2VkLiBTdG9wcGluZyBhcHBsaWNhdGlvbi5cIikpIHtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSBjYXRjaCAocmVzKSB7XHJcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKHJlcy5vdXRwdXQpXHJcblxyXG4gICAgICAgICAgICAvLyDnq6/lj6PooqvljaDnlKjovr7liLDkuIDlrprmrKHmlbDlkI7ml7blj5bmtojoh6rliqjph43lkK9hcmlhMmNcclxuICAgICAgICAgICAgaWYgKHJlcy5vdXRwdXQuaW5jbHVkZXMoXCJGYWlsZWQgdG8gYmluZCBhIHNvY2tldCwgY2F1c2U6IEFkZHJlc3MgYWxyZWFkeSBpbiB1c2VcIikpIHtcclxuICAgICAgICAgICAgICAgIGlmIChuID4gNSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBuKytcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxufSwgZmFsc2UpXHJcbiJdfQ== \ No newline at end of file