From ee9a4a2fb09a1be9ca3581108d7b2380d2fb7833 Mon Sep 17 00:00:00 2001 From: "karl.hudgell" Date: Mon, 7 Sep 2020 15:29:33 +0100 Subject: [PATCH] clean up and new stings --- lang/en.json | 7 +++++-- lib/adb.js | 12 ++++++++++-- lib/common.js | 2 +- package-lock.json | 7 ++++++- package.json | 3 ++- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/lang/en.json b/lang/en.json index 7233a88..2ff8826 100644 --- a/lang/en.json +++ b/lang/en.json @@ -10,7 +10,7 @@ "main-menu-item-8": "Batch Remove Installed Apps", "main-menu-item-9": "Quit", "connection-type-message": "How do you want to connect?", - "connect-wifi-message":"What is your MiWatch IpAdress?", + "connect-wifi-message": "What is your MiWatch IpAdress?", "restore-app-message": "What apps do you want to restore?", "install-compatible-apps-message": "What apps do you want to Install?", "remove-installed-apps-message": "What Installed apps do you want to remove?", @@ -56,5 +56,8 @@ "main-menu-item-10": "Change Watch DPI", "set-dpi-message": "Enter New DPI Value:", "default-dpi-is": "Default DPI is", - "current-dpi-is": "Current DPI is" + "current-dpi-is": "Current DPI is", + "usb-one-device": "Make sure ONLY your watch is connected", + "accept-authorisation": "Please select \"Always Allow\" for authorisation on watch", + "usb-not-connected": "Make sure your watch is not connected via USB" } \ No newline at end of file diff --git a/lib/adb.js b/lib/adb.js index d263fab..bea4686 100644 --- a/lib/adb.js +++ b/lib/adb.js @@ -24,8 +24,8 @@ module.exports = { common.dualLog(element + ' - ' + result.stdout) if (element === "data\\apps\\simpleweather_base.apk") { - await common.downloadFile('http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Others/simpleweather_split_config.armeabi_v7a.apk', './data/apps/simpleweather_split_config.armeabi_v7a.apk') - await common.downloadFile('http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Others/simpleweather_split_config.xhdpi.apk', './data/apps/simpleweather_split_config.xhdpi.apk') + await common.downloadFile('https://github.com/karl0ss/MiWatchKleaner-APKs/raw/master/Others/simpleweather_split_config.armeabi_v7a.apk', './data/apps/simpleweather_split_config.armeabi_v7a.apk') + await common.downloadFile('https://github.com/karl0ss/MiWatchKleaner-APKs/raw/master/Others/simpleweather_split_config.xhdpi.apk', './data/apps/simpleweather_split_config.xhdpi.apk') await shellExec(adbRun + ' install-multiple "data\\apps\\simpleweather_base.apk" "data\\apps\\simpleweather_split_config.armeabi_v7a.apk" "data\\apps\\simpleweather_split_config.xhdpi.apk"').then(async function (result) { common.log(result) common.dualLog('simple-weather-activated-on-watch') @@ -154,6 +154,10 @@ module.exports = { watchConnection: async (value) => { Language.setActiveLang(globalVariables.language) if (value.connection === "usb") { + common.dualLog(await Language.get('usb-one-device', 'whiteBright')) + await common.pause(2000) + common.dualLog(await Language.get('accept-authorisation', 'whiteBright')) + await common.pause(3000) await module.exports.killAdbServer() result = await shellExec(adbRun + ' devices') console.log(result.stdout) @@ -171,7 +175,11 @@ module.exports = { } } if (value.connection === "wifi") { + common.dualLog(await Language.get('usb-not-connected', 'whiteBright')) + await common.pause(2000) const value = await inquirer.connectWifi(); + common.dualLog(await Language.get('accept-authorisation', 'whiteBright')) + await common.pause(3000) await module.exports.killAdbServer() result = await shellExec(adbRun + ' connect ' + value.connectWifi) logger.info("Connect Wifi Result " + result.stdout) diff --git a/lib/common.js b/lib/common.js index bca6df4..57cef39 100644 --- a/lib/common.js +++ b/lib/common.js @@ -70,7 +70,7 @@ module.exports = { }, getCompatibleAppsList: async () => { let settings = { method: "Get" }; - const response = await fetch("http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/compatibleApps.json", settings) + const response = await fetch("https://raw.githubusercontent.com/karl0ss/MiWatchKleaner-APKs/master/compatibleApps.json", settings) .then(res => res.json()) return response }, diff --git a/package-lock.json b/package-lock.json index 6fc065a..d6072f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "miwatchkleaner", - "version": "3.1.2", + "version": "3.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1242,6 +1242,11 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, + "settings-store": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/settings-store/-/settings-store-1.4.1.tgz", + "integrity": "sha512-AJ7EYdaL9TksOStjablB/6EqOJN8ZW97Kp3Vi+YuPDoegRuCJvsbZolxoqHpgSFG2Jc8trQGF+0RPeN5My2G/A==" + }, "shell-exec": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/shell-exec/-/shell-exec-1.0.2.tgz", diff --git a/package.json b/package.json index 9804180..5b4586e 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "repository": { "type": "git", - "url": "http://kithub.cf/Karl/MiWatchKleaner.git" + "url": "https://github.com/karl0ss/MiWatchKleaner.git" }, "author": "Karl Hudgell", "license": "ISC", @@ -28,6 +28,7 @@ "node-fetch": "^2.6.0", "perfect-logger": "^2.0.1", "pkg": "^4.4.7", + "settings-store": "^1.4.1", "shell-exec": "^1.0.2", "shelljs": "^0.8.4" },