Browse Source

clean up and new stings

karl.hudgell 3 years ago
parent
commit
ee9a4a2fb0
5 changed files with 24 additions and 7 deletions
  1. 5 2
      lang/en.json
  2. 10 2
      lib/adb.js
  3. 1 1
      lib/common.js
  4. 6 1
      package-lock.json
  5. 2 1
      package.json

+ 5 - 2
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"
 }

+ 10 - 2
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)

+ 1 - 1
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
     },

+ 6 - 1
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",

+ 2 - 1
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"
   },