Skip to content

Commit

Permalink
add --json flag to --list command
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiChou committed Aug 17, 2023
1 parent 652f523 commit 724a5b2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions bin/bagbak.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ async function main() {
program
.name('bagbak')
.option('-l, --list', 'list apps')
.option('-j, --json', 'output as json (only works with --list)')

.option('-U, --usb', 'connect to USB device (default)')
.option('-R, --remote', 'connect to remote frida-server')
Expand Down Expand Up @@ -73,6 +74,11 @@ async function main() {
if (program.list) {
const apps = await enumerateApps(device);

if (program.json) {
console.log(JSON.stringify(apps, null, 2));
return;
}

const verWidth = Math.max(...apps.map(app => app.parameters?.version?.length || 0));
const idWidth = Math.max(...apps.map(app => app.identifier.length));

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bagbak",
"version": "3.0.22",
"version": "3.0.23",
"description": "Dump iOS app from a jailbroken device, based on frida.re",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 724a5b2

Please sign in to comment.