bananalyzer
Version:
A simple tool for windows 10, that downloads APKs from Google playstore, analyzes them, and lists all the Google and Huawei SDKs (kits) that are integrated, along with other metadata
95 lines (94 loc) • 3.06 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.commitSuicide = exports.CMD_VERSION = exports.CMD_HELP = exports.CMD_APK_LIST = exports.CMD_LIST = exports.CMD_APK = exports.CMD_PACKAGE = void 0;
var meow_1 = __importDefault(require("meow"));
var consts_1 = require("./consts");
//@ts-ignore
var cli_meow_help_1 = __importDefault(require("cli-meow-help"));
var flags = {
path: {
type: 'string',
alias: 'p',
default: '',
desc: "Apk full path, required when using command 'apk'",
},
name: {
type: 'string',
alias: 'n',
default: '',
desc: "App package name, required when using Command 'package'",
},
debug: {
type: 'boolean',
default: false,
alias: 'd',
desc: 'Print debug logs',
},
keep: {
type: 'boolean',
alias: 'k',
default: false,
desc: 'Keep downloaded APKs (can be found in downloads/ folder)',
},
// reuse: {
// type: 'boolean',
// alias: 'r',
// default: false,
// desc: 'Re-use existing APKs that are found in download folder',
// },
batch: {
type: 'number',
alias: 'b',
default: consts_1.DEFAULT_BATCH_SIZE,
desc: "Batch size, optional when using command 'file'",
},
};
exports.CMD_PACKAGE = 'package';
exports.CMD_APK = 'apk';
exports.CMD_LIST = 'list';
exports.CMD_APK_LIST = 'apklist';
exports.CMD_HELP = 'help';
exports.CMD_VERSION = 'version';
var commands = (_a = {},
_a[exports.CMD_PACKAGE] = {
desc: 'Download and analyze an app by providing its package name',
},
_a[exports.CMD_APK] = {
desc: 'Analyze an Apk by providing its file path',
},
_a[exports.CMD_LIST] = {
desc: 'Download and analyze a list of apps by providing a file that contains their package names',
},
_a[exports.CMD_APK_LIST] = {
desc: 'Analyze a list of apps by providing a file that contains their apk file paths',
},
_a[exports.CMD_HELP] = {
desc: 'Print help information',
},
_a);
var helpText = (0, cli_meow_help_1.default)({
name: 'bananalyzer',
flags: flags,
commands: commands,
});
var options = {
inferType: true,
description: '',
hardRejection: false,
flags: flags,
};
var cliHelper = (0, meow_1.default)(helpText, options);
exports.default = cliHelper;
var commitSuicide = function (msg) {
console.log(''); // empty line
console.log(" \u2639 ".concat(cliHelper.pkg.name, " has commit suicide \u2639 "));
console.log(''); // empty line
console.log('[last words]', msg);
console.log('(if you think this is an issue with the tool, re-run the command with the flag `--debug`, then submit an issue at:', cliHelper.pkg.homepage, ' and include the logs)');
return false;
};
exports.commitSuicide = commitSuicide;