Compare commits

...

2 Commits

Author SHA1 Message Date
karl.hudgell
f2c4cce583 update json 2020-06-22 13:22:19 +01:00
karl.hudgell
d5716fadea 1 click r&r 2020-06-02 11:09:39 +01:00
5 changed files with 34 additions and 4 deletions

View File

@ -1 +1 @@
{"ipAddress":""} {"ipAddress":"192.168.4.210"}

View File

@ -13,6 +13,7 @@ module.exports = {
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",
"1-Click Remove & Install",
"Remove Xiaomi Apps", "Remove Xiaomi Apps",
"Restore Xiaomi Apps", "Restore Xiaomi Apps",
"Install Compatible Apps", "Install Compatible Apps",

View File

@ -5,7 +5,7 @@
"pid": 26780 "pid": 26780
}, },
"RunTIme": { "RunTIme": {
"startTime": 1588233573984, "startTime": 1592828490426,
"pid": 17884 "pid": 34960
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "miwatchkleaner2.0", "name": "miwatchkleaner2.0",
"version": "2.0.4", "version": "2.0.5",
"description": "MiWatch Cleaning Tool", "description": "MiWatch Cleaning Tool",
"main": "app.js", "main": "app.js",
"bin": "app.js", "bin": "app.js",

View File

@ -224,6 +224,32 @@ module.exports = {
}).catch() }).catch()
} }
}, },
oneClick: async () => {
logger.info("1-Click")
common.header('1-Click Remove & Install')
await common.pause(1000)
console.log(chalk.white('Removing Xiaomi Apps'))
await common.pause(1000)
let value = await files.loadPackageList()
for (let element of value.apps) {
await shellExec(adbRun + ' shell pm uninstall -k --user 0 ' + element).then(function (result) {
if (result.stderr != '') {
logger.info('Error ' + result.stderr);
console.log(chalk.redBright('Error - Device not authorised'));
} else {
logger.info('Removing ' + element + ' - ' + result.stdout);
console.log('Removing ' + element + ' - ' + result.stdout);
}
});
}
console.log(chalk.green('Removal Complete'))
await common.pause(2000)
logger.info("Remove Complete")
await common.pause(1000)
console.log(chalk.white('Installing Google Apps'))
await common.pause(1000)
module.exports.mainMenu()
},
mainMenu: async () => { mainMenu: async () => {
common.header('Main Menu') common.header('Main Menu')
if (process.platform === 'win32' || process.platform === 'win64') { if (process.platform === 'win32' || process.platform === 'win64') {
@ -249,6 +275,9 @@ module.exports = {
case 'remove installed apps': case 'remove installed apps':
module.exports.removeCompatibleApps() module.exports.removeCompatibleApps()
break; break;
case '1-click remove & install':
module.exports.oneClick()
break;
case 'quit': case 'quit':
break; break;
default: default: