UNPKG

@u4/adbkit

Version:

A Typescript client for the Android Debug Bridge.

49 lines 2.12 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const commander_1 = require("commander"); const cli_common_1 = require("./cli-common"); const node_process_1 = require("node:process"); const promises_1 = __importDefault(require("node:readline/promises")); const BixbySet = new Set(['com.samsung.android.app.spage', 'com.samsung.android.app.routines', 'com.samsung.android.visionintelligence']); commander_1.program .command(`boatware [serials...]`) .description('remove common boatware.') .action(async (serials) => { const rl = promises_1.default.createInterface({ input: node_process_1.stdin, output: node_process_1.stdout }); const devices = await (0, cli_common_1.getClientDevice)(serials); const process = async (device) => { const pkgs = await device.listPackages(); console.log(`${pkgs.length} Packages availible`); // const samsung = pkgs.filter(a => a.name.startsWith('com.samsung')) // samsung.forEach(a => console.log(a.name)); const bixby = pkgs.filter(a => a.name.includes('bixby') || BixbySet.has(a.name)); if (bixby.length) { console.log(`${bixby.length} bixby Packages`); for (const pkg of bixby) { console.log(`- ${pkg.name}`); } const r = await rl.question(`do you want to remove them ? [y/N]`); if (r.toLowerCase() == 'y' || r.toLowerCase() == 'yes') { for (const p of bixby) { console.log(`uninstalling ${p.name}`); const r = await device.uninstall(p.name, { keep: true, user: 0 }); console.log(r ? 'Success' : 'Failed'); } } else { console.log(`response: "${r}", Skip`); } } }; for (const device of devices) { await process(device); } rl.close(); }); //# sourceMappingURL=cli-boatware.js.map