all working 2.0.0
This commit is contained in:
parent
522d92c55f
commit
5268d10ae7
@ -1,54 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"name": "Google Fit",
|
|
||||||
"url": "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Google/GoogleFit.apk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Google Maps",
|
|
||||||
"url": "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Google/GoogleMaps.apk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Google Quick Search",
|
|
||||||
"url": "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Google/GoogleQuickSearch.apk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Google TTS",
|
|
||||||
"url": "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Google/GoogleTTS.apk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Google Translate",
|
|
||||||
"url": "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Google/GoogleTranslate.apk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Google Wear Keyboard",
|
|
||||||
"url": "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Google/WearKeyboard.apk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Google Calculator",
|
|
||||||
"url": "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Google/GoogleCalc.apk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Google Clock",
|
|
||||||
"url": "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Google/GoogleClock.apk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Google Services",
|
|
||||||
"url": "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Google/GoogleServices.apk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Pujie Black",
|
|
||||||
"url": "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Others/Pujie.apk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "AccuWeather",
|
|
||||||
"url": "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Others/AccuWeather.apk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Ultimate Alexa",
|
|
||||||
"url": "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Others/UltimateAlexa.apk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "MoreLocale",
|
|
||||||
"url": "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/Others/MoreLocale.apk"
|
|
||||||
}
|
|
||||||
]
|
|
@ -1,65 +1,73 @@
|
|||||||
const inquirer = require("inquirer");
|
const inquirer = require("inquirer");
|
||||||
const files = require("./files");
|
const files = require("./files");
|
||||||
const fs = require('fs')
|
const rp = require('request-promise-native')
|
||||||
|
|
||||||
|
let compatibleApps
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
mainMenu: () => {
|
mainMenu: () => {
|
||||||
const questions = [
|
const questions = [{
|
||||||
{
|
type: "list",
|
||||||
type: "list",
|
name: "mainMenu",
|
||||||
name: "mainMenu",
|
message: "What do you want to do?",
|
||||||
message: "What do you want to do?",
|
choices: [
|
||||||
choices: [
|
"Connect to MiWatch via Wifi",
|
||||||
"Connect to MiWatch via Wifi",
|
"Remove Xiaomi Apps",
|
||||||
"Remove Xiaomi Apps",
|
"Restore Xiaomi Apps",
|
||||||
"Restore Xiaomi Apps",
|
"Install Compatible Apps",
|
||||||
"Install Compatible Apps",
|
"Quit"
|
||||||
"Quit"
|
],
|
||||||
],
|
filter: function (val) {
|
||||||
filter: function (val) {
|
return val.toLowerCase();
|
||||||
return val.toLowerCase();
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
];
|
}, ];
|
||||||
return inquirer.prompt(questions);
|
return inquirer.prompt(questions);
|
||||||
},
|
},
|
||||||
connectWifi: () => {
|
connectWifi: () => {
|
||||||
const questions = [
|
const questions = [{
|
||||||
{
|
type: "input",
|
||||||
type: "input",
|
name: "connectWifi",
|
||||||
name: "connectWifi",
|
message: "What is your MiWatch IpAdress?",
|
||||||
message: "What is your MiWatch IpAdress?",
|
}, ];
|
||||||
},
|
|
||||||
];
|
|
||||||
return inquirer.prompt(questions);
|
return inquirer.prompt(questions);
|
||||||
},
|
},
|
||||||
removeAppsList: async () => {
|
removeAppsList: async () => {
|
||||||
const packages = await files.loadPackageList();
|
const packages = await files.loadPackageList();
|
||||||
|
|
||||||
const questions = [
|
const questions = [{
|
||||||
{
|
type: "checkbox",
|
||||||
type: "checkbox",
|
name: "removeAppsList",
|
||||||
name: "removeAppsList",
|
message: "What apps do you want to remove?",
|
||||||
message: "What apps do you want to remove?",
|
choices: packages.apps,
|
||||||
choices: packages.apps,
|
}, ];
|
||||||
},
|
|
||||||
];
|
|
||||||
return inquirer.prompt(questions);
|
return inquirer.prompt(questions);
|
||||||
},
|
},
|
||||||
compatibleApps: async () => {
|
compatibleApps: async () => {
|
||||||
const compatibleApps = JSON.parse(fs.readFileSync('./data/compatibleApps.json', 'utf8'));
|
await module.exports.getCompatibleApps()
|
||||||
const appList = []
|
const appList = []
|
||||||
for (let element of compatibleApps) {
|
for (let element of compatibleApps) {
|
||||||
appList.push(element.name)
|
appList.push(element.name)
|
||||||
}
|
}
|
||||||
const questions = [
|
const questions = [{
|
||||||
{
|
type: "checkbox",
|
||||||
type: "checkbox",
|
name: "removeAppsList",
|
||||||
name: "removeAppsList",
|
message: "What apps do you want to remove?",
|
||||||
message: "What apps do you want to remove?",
|
choices: appList,
|
||||||
choices: appList,
|
}, ];
|
||||||
},
|
|
||||||
];
|
|
||||||
return inquirer.prompt(questions);
|
return inquirer.prompt(questions);
|
||||||
},
|
},
|
||||||
};
|
getCompatibleApps: async () => {
|
||||||
|
var options = {
|
||||||
|
method: 'GET',
|
||||||
|
uri: 'http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/compatibleApps.json',
|
||||||
|
};
|
||||||
|
|
||||||
|
await rp(options)
|
||||||
|
.then(function (response) {
|
||||||
|
compatibleApps = JSON.parse(response)
|
||||||
|
})
|
||||||
|
.catch(function (err) {
|
||||||
|
console.log('compatibleApps.json Not Found')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
28
package-lock.json
generated
28
package-lock.json
generated
@ -1025,11 +1025,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
||||||
"integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA=="
|
"integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA=="
|
||||||
},
|
},
|
||||||
"promise-android-tools": {
|
|
||||||
"version": "2.0.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/promise-android-tools/-/promise-android-tools-2.0.4.tgz",
|
|
||||||
"integrity": "sha512-1q3QA8TpDBNNEY3wXwJdjeb6cHYp+gse07cmYaxsjQQu8hGNv5gzbPq5beUwizXVkmSTf6jBxyezly2RhFP8WQ=="
|
|
||||||
},
|
|
||||||
"psl": {
|
"psl": {
|
||||||
"version": "1.8.0",
|
"version": "1.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
|
||||||
@ -1106,6 +1101,24 @@
|
|||||||
"throttleit": "^1.0.0"
|
"throttleit": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"request-promise-core": {
|
||||||
|
"version": "1.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.3.tgz",
|
||||||
|
"integrity": "sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ==",
|
||||||
|
"requires": {
|
||||||
|
"lodash": "^4.17.15"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"request-promise-native": {
|
||||||
|
"version": "1.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.8.tgz",
|
||||||
|
"integrity": "sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ==",
|
||||||
|
"requires": {
|
||||||
|
"request-promise-core": "1.1.3",
|
||||||
|
"stealthy-require": "^1.1.1",
|
||||||
|
"tough-cookie": "^2.3.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"resolve": {
|
"resolve": {
|
||||||
"version": "1.17.0",
|
"version": "1.17.0",
|
||||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
|
||||||
@ -1201,6 +1214,11 @@
|
|||||||
"tweetnacl": "~0.14.0"
|
"tweetnacl": "~0.14.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"stealthy-require": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz",
|
||||||
|
"integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks="
|
||||||
|
},
|
||||||
"stream-meter": {
|
"stream-meter": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/stream-meter/-/stream-meter-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/stream-meter/-/stream-meter-1.0.4.tgz",
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"path-exists": "^4.0.0",
|
"path-exists": "^4.0.0",
|
||||||
"pkg": "^4.4.7",
|
"pkg": "^4.4.7",
|
||||||
"promise-android-tools": "^2.0.4",
|
"request-promise-native": "^1.0.8",
|
||||||
"shell-exec": "^1.0.2"
|
"shell-exec": "^1.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,16 +8,36 @@ const {
|
|||||||
DownloaderHelper
|
DownloaderHelper
|
||||||
} = require('node-downloader-helper');
|
} = require('node-downloader-helper');
|
||||||
const getFilesIn = require('get-files-in')
|
const getFilesIn = require('get-files-in')
|
||||||
|
const http = require('http')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
compatibleApps: async () => {
|
compatibleApps: async () => {
|
||||||
common.header('Install Compatible Apps')
|
common.header('Install Compatible Apps')
|
||||||
const compatibleApps = JSON.parse(fs.readFileSync('./data/compatibleApps.json', 'utf8'));
|
let compatibleApps
|
||||||
|
let url = "http://kithub.cf/Karl/MiWatchKleaner-APKs/raw/master/compatibleApps.json";
|
||||||
|
http.get(url, (res) => {
|
||||||
|
let body = "";
|
||||||
|
|
||||||
|
res.on("data", (chunk) => {
|
||||||
|
body += chunk;
|
||||||
|
});
|
||||||
|
|
||||||
|
res.on("end", () => {
|
||||||
|
try {
|
||||||
|
compatibleApps = JSON.parse(body);
|
||||||
|
// do something with JSON
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error.message);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
}).on("error", (error) => {
|
||||||
|
console.error(error.message);
|
||||||
|
});
|
||||||
|
|
||||||
const value = await inquirer.compatibleApps();
|
const value = await inquirer.compatibleApps();
|
||||||
|
|
||||||
await shellExec('rm ./data/apps/*.apk').then(function (result) {
|
await shellExec('rm ./data/apps/*.apk').then(function (result) {});
|
||||||
// console.log('Installing ' + element + ' - ' + result.stdout);
|
|
||||||
});
|
|
||||||
|
|
||||||
for (let element of value.removeAppsList) {
|
for (let element of value.removeAppsList) {
|
||||||
for (let element2 of compatibleApps) {
|
for (let element2 of compatibleApps) {
|
||||||
@ -35,8 +55,9 @@ module.exports = {
|
|||||||
const apkList = await getFilesIn('./data/apps', matchFiletypes = ['apk'], checkSubDirectories = false)
|
const apkList = await getFilesIn('./data/apps', matchFiletypes = ['apk'], checkSubDirectories = false)
|
||||||
|
|
||||||
for (let element of apkList) {
|
for (let element of apkList) {
|
||||||
|
console.log('Installing ' + element)
|
||||||
await shellExec('adb install -r ' + element).then(function (result) {
|
await shellExec('adb install -r ' + element).then(function (result) {
|
||||||
console.log('Installing ' + element + ' - ' + result.stdout);
|
console.log(element + ' - ' + result.stdout);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log(chalk.green('Compatible Apps Installed'))
|
console.log(chalk.green('Compatible Apps Installed'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user