remove any app
This commit is contained in:
parent
f89d883564
commit
63cd59c6a1
11
lang/en.json
11
lang/en.json
@ -5,9 +5,10 @@
|
|||||||
"main-menu-item-3": "Restore Xiaomi Apps",
|
"main-menu-item-3": "Restore Xiaomi Apps",
|
||||||
"main-menu-item-4": "Install Compatible Apps",
|
"main-menu-item-4": "Install Compatible Apps",
|
||||||
"main-menu-item-5": "Restore ANY app",
|
"main-menu-item-5": "Restore ANY app",
|
||||||
"main-menu-item-6": "Batch Install Apps",
|
"main-menu-item-6": "Remove ANY app",
|
||||||
"main-menu-item-7": "Batch Remove Installed Apps",
|
"main-menu-item-7": "Batch Install Apps",
|
||||||
"main-menu-item-8": "Quit",
|
"main-menu-item-8": "Batch Remove Installed Apps",
|
||||||
|
"main-menu-item-9": "Quit",
|
||||||
"connection-type-message": "How do you want to connect?",
|
"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?",
|
"restore-app-message": "What apps do you want to restore?",
|
||||||
@ -49,5 +50,7 @@
|
|||||||
"try-again": "Try Again",
|
"try-again": "Try Again",
|
||||||
"connect-wifi-complete": "Connect Wifi Complete",
|
"connect-wifi-complete": "Connect Wifi Complete",
|
||||||
"not-authenticated": "Not Authenticated",
|
"not-authenticated": "Not Authenticated",
|
||||||
"error": "Error"
|
"error": "Error",
|
||||||
|
"remove-any-app-message": "What App do you want to remove?",
|
||||||
|
"removing-apps-complete": "Removing Apps Complete"
|
||||||
}
|
}
|
11
lang/es.json
11
lang/es.json
@ -5,9 +5,10 @@
|
|||||||
"main-menu-item-3": "Restaurar aplicaciones Xiaomi",
|
"main-menu-item-3": "Restaurar aplicaciones Xiaomi",
|
||||||
"main-menu-item-4": "Instalar aplicaciones compatibles",
|
"main-menu-item-4": "Instalar aplicaciones compatibles",
|
||||||
"main-menu-item-5": "Restaura CUALQUIER aplicación",
|
"main-menu-item-5": "Restaura CUALQUIER aplicación",
|
||||||
"main-menu-item-6": "Aplicaciones de instalación por lotes",
|
"main-menu-item-6": "Eliminar CUALQUIER aplicación",
|
||||||
"main-menu-item-7": "Eliminar por lotes las aplicaciones instaladas",
|
"main-menu-item-7": "Aplicaciones de instalación por lotes",
|
||||||
"main-menu-item-8": "Salir",
|
"main-menu-item-8": "Eliminar por lotes las aplicaciones instaladas",
|
||||||
|
"main-menu-item-9": "Salir",
|
||||||
"connection-type-message": "¿Cómo desea conectarse?",
|
"connection-type-message": "¿Cómo desea conectarse?",
|
||||||
"connect-wifi-message":"¿Cuál es su MiWatch IpAdress?",
|
"connect-wifi-message":"¿Cuál es su MiWatch IpAdress?",
|
||||||
"restore-app-message": "¿Qué aplicaciones quieres restaurar?",
|
"restore-app-message": "¿Qué aplicaciones quieres restaurar?",
|
||||||
@ -48,5 +49,7 @@
|
|||||||
"try-again": "Inténtalo de nuevo",
|
"try-again": "Inténtalo de nuevo",
|
||||||
"connect-wifi-complete": "Conectar Wifi Completo",
|
"connect-wifi-complete": "Conectar Wifi Completo",
|
||||||
"not-authenticated": "No autenticado",
|
"not-authenticated": "No autenticado",
|
||||||
"error": "Error"
|
"error": "Error",
|
||||||
|
"remove-any-app-message": "¿Qué aplicación quieres eliminar?",
|
||||||
|
"removing-apps-complete": "Eliminación de aplicaciones completa"
|
||||||
}
|
}
|
12
lib/adb.js
12
lib/adb.js
@ -84,6 +84,18 @@ module.exports = {
|
|||||||
common.dualLog(await Language.get('restoring') + ' ' + package + ' - ' + result.stdout)
|
common.dualLog(await Language.get('restoring') + ' ' + package + ' - ' + result.stdout)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
removeAnyApk: async (package) => {
|
||||||
|
Language.setActiveLang(globalVariables.language)
|
||||||
|
result = await shellExec(adbRun + ' shell pm uninstall -k --user 0 ' + package.removeAnyApp)
|
||||||
|
if (result.stderr != '') {
|
||||||
|
common.dualLog('device-not-authorised' + ' ' + result.stderr, 'red')
|
||||||
|
} else if (result.stdout.includes('doesn\'t exist')) {
|
||||||
|
logger.info(result.stdout);
|
||||||
|
console.log(chalk.redBright(result.stdout));
|
||||||
|
} else {
|
||||||
|
common.dualLog(await Language.get('removing') + ' ' + package + ' - ' + result.stdout)
|
||||||
|
}
|
||||||
|
},
|
||||||
getInstalledPacakges: async () => {
|
getInstalledPacakges: async () => {
|
||||||
Language.setActiveLang(globalVariables.language)
|
Language.setActiveLang(globalVariables.language)
|
||||||
result = await shellExec(adbRun + ' shell pm list packages -3')
|
result = await shellExec(adbRun + ' shell pm list packages -3')
|
||||||
|
@ -112,4 +112,13 @@ module.exports = {
|
|||||||
},];
|
},];
|
||||||
return inquirer.prompt(questions);
|
return inquirer.prompt(questions);
|
||||||
},
|
},
|
||||||
|
restoreAnyApp: async () => {
|
||||||
|
Language.setActiveLang(globalVariables.language)
|
||||||
|
const questions = [{
|
||||||
|
type: "input",
|
||||||
|
name: "removeAnyApp",
|
||||||
|
message: await Language.get('remove-any-app-message'),
|
||||||
|
},];
|
||||||
|
return inquirer.prompt(questions);
|
||||||
|
},
|
||||||
};
|
};
|
@ -126,9 +126,19 @@ module.exports = {
|
|||||||
module.exports.mainMenu()
|
module.exports.mainMenu()
|
||||||
},
|
},
|
||||||
|
|
||||||
batchInstallApps: async () => {
|
removeAnyApp: async () => {
|
||||||
common.header('main-menu-item-6')
|
common.header('main-menu-item-6')
|
||||||
common.log('main-menu-item-6')
|
common.log('main-menu-item-6')
|
||||||
|
const value = await inquirer.restoreAnyApp();
|
||||||
|
await adb.restoreAnyApk(value)
|
||||||
|
common.dualLog('removing-apps-complete', 'green')
|
||||||
|
await common.pause(2000)
|
||||||
|
module.exports.mainMenu()
|
||||||
|
},
|
||||||
|
|
||||||
|
batchInstallApps: async () => {
|
||||||
|
common.header('main-menu-item-7')
|
||||||
|
common.log('main-menu-item-7')
|
||||||
|
|
||||||
let apkList = await files.getListOfAPk('./my-apk/')
|
let apkList = await files.getListOfAPk('./my-apk/')
|
||||||
await files.renameLocalApk(apkList)
|
await files.renameLocalApk(apkList)
|
||||||
@ -145,8 +155,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
batchRemoveInstalledApps: async () => {
|
batchRemoveInstalledApps: async () => {
|
||||||
common.header('main-menu-item-7')
|
common.header('main-menu-item-8')
|
||||||
common.log('main-menu-item-7')
|
common.log('main-menu-item-8')
|
||||||
|
|
||||||
value = await adb.getInstalledPacakges()
|
value = await adb.getInstalledPacakges()
|
||||||
|
|
||||||
@ -176,14 +186,7 @@ module.exports = {
|
|||||||
selectLanguage: async () => {
|
selectLanguage: async () => {
|
||||||
common.header('Select Language')
|
common.header('Select Language')
|
||||||
common.log('Select Language')
|
common.log('Select Language')
|
||||||
// const value = await inquirer.connectionType()
|
|
||||||
const v = await inquirer.LanguageSelect()
|
const v = await inquirer.LanguageSelect()
|
||||||
// connected = await adb.watchConnection(value)
|
|
||||||
// if (connected != true) {
|
|
||||||
// module.exports.connectWatch()
|
|
||||||
// } else {
|
|
||||||
// module.exports.mainMenu()
|
|
||||||
// }
|
|
||||||
return v
|
return v
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -199,6 +202,7 @@ module.exports = {
|
|||||||
menu_7 = await Language.get('main-menu-item-7')
|
menu_7 = await Language.get('main-menu-item-7')
|
||||||
menu_8 = await Language.get('main-menu-item-8')
|
menu_8 = await Language.get('main-menu-item-8')
|
||||||
menu_9 = await Language.get('main-menu-item-9')
|
menu_9 = await Language.get('main-menu-item-9')
|
||||||
|
menu_10 = await Language.get('main-menu-item-10')
|
||||||
|
|
||||||
switch (mainMenuSelection.mainMenu) {
|
switch (mainMenuSelection.mainMenu) {
|
||||||
case menu_1.toLowerCase():
|
case menu_1.toLowerCase():
|
||||||
@ -217,15 +221,18 @@ module.exports = {
|
|||||||
module.exports.restoreAnyApp()
|
module.exports.restoreAnyApp()
|
||||||
break;
|
break;
|
||||||
case menu_6.toLowerCase():
|
case menu_6.toLowerCase():
|
||||||
module.exports.batchInstallApps()
|
module.exports.removeAnyApp()
|
||||||
break;
|
break;
|
||||||
case menu_7.toLowerCase():
|
case menu_7.toLowerCase():
|
||||||
module.exports.batchRemoveInstalledApps()
|
module.exports.batchInstallApps()
|
||||||
break;
|
break;
|
||||||
case menu_8.toLowerCase():
|
case menu_8.toLowerCase():
|
||||||
module.exports.connectWatch()
|
module.exports.batchRemoveInstalledApps()
|
||||||
break;
|
break;
|
||||||
case menu_9.toLowerCase():
|
case menu_9.toLowerCase():
|
||||||
|
module.exports.connectWatch()
|
||||||
|
break;
|
||||||
|
case menu_10.toLowerCase():
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// code block
|
// code block
|
||||||
|
Loading…
x
Reference in New Issue
Block a user