working install/uninstall
This commit is contained in:
parent
3bb1959855
commit
d1b5adb8aa
@ -27,7 +27,7 @@ module.exports = {
|
|||||||
|
|
||||||
const questions = [ {
|
const questions = [ {
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
name: 'Remove Apps List',
|
name: 'removeAppsList',
|
||||||
message: 'What apps do you want to remove?',
|
message: 'What apps do you want to remove?',
|
||||||
choices: packages.apps
|
choices: packages.apps
|
||||||
}]
|
}]
|
||||||
|
@ -4,12 +4,24 @@ const inquirer = require('../lib/inquirer');
|
|||||||
const shellExec = require('shell-exec')
|
const shellExec = require('shell-exec')
|
||||||
const files = require('../lib/files')
|
const files = require('../lib/files')
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
removeApps: async () => {
|
removeApps: async () => {
|
||||||
common.header('Remove Apps')
|
common.header('Remove Apps')
|
||||||
const value = await inquirer.removeAppsList();
|
const value = await inquirer.removeAppsList();
|
||||||
console.log(value)
|
value.removeAppsList.forEach(element => {
|
||||||
|
shellExec('adb shell pm uninstall -k --user 0 ' + element).then(async function (result) {
|
||||||
|
console.log('Removing ' + element + ' - ' + result.stdout)
|
||||||
|
}).catch()
|
||||||
|
});
|
||||||
|
},
|
||||||
|
restoreApps: async () => {
|
||||||
|
common.header('Restore Apps')
|
||||||
|
const value = await inquirer.removeAppsList();
|
||||||
|
value.removeAppsList.forEach(element => {
|
||||||
|
shellExec('adb shell cmd package install-existing ' + element).then(async function (result) {
|
||||||
|
console.log('Installing ' + element + ' - ' + result.stdout)
|
||||||
|
}).catch()
|
||||||
|
});
|
||||||
},
|
},
|
||||||
connectWifi: async () => {
|
connectWifi: async () => {
|
||||||
common.header('Connect Wifi')
|
common.header('Connect Wifi')
|
||||||
@ -46,6 +58,9 @@ module.exports = {
|
|||||||
case 'remove install xiaomi apps':
|
case 'remove install xiaomi apps':
|
||||||
module.exports.removeApps()
|
module.exports.removeApps()
|
||||||
break;
|
break;
|
||||||
|
case 'restore uninstalled apps':
|
||||||
|
module.exports.restoreApps()
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// code block
|
// code block
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user