Skip to content

Commit

Permalink
bring back app dump
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiChou committed Jun 25, 2023
1 parent d29f5e9 commit 5f3aa4a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
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
Expand Up @@ -8,7 +8,7 @@
},
"displayName": "frida Workbench",
"description": "Unofficial frida workbench for VSCode",
"version": "0.7.2",
"version": "0.7.3",
"engines": {
"vscode": "^1.69.1"
},
Expand Down
25 changes: 15 additions & 10 deletions src/commands/dump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ADB from '../driver/adb';
import { AppItem, TargetItem } from "../providers/devices";
import { DeviceType } from '../types';
import { cmd } from '../utils';
import path = require('path');

export default async function dump(target: TargetItem) {
if (!(target instanceof AppItem)) {
Expand Down Expand Up @@ -36,24 +37,28 @@ export default async function dump(target: TargetItem) {
// save preferred path
vscode.workspace.getConfiguration('frida').update('decryptOutput', output, true);

let artifact: vscode.Uri;

try {
if (target.device.os === 'ios') {
vscode.window.showErrorMessage('Having issues with iOS now :(, please wait for a fix');
return;
// await bagbak(target, output);
artifact = vscode.Uri.joinPath(destURI, `${target.data.identifier}.ipa`);
await bagbak(target, artifact);
} else if (target.device.os === 'android') {
await pull(target, destURI);
artifact = vscode.Uri.joinPath(destURI, `${target.data.identifier}.apk`);
await pull(target, artifact);
} else {
vscode.window.showErrorMessage('This command only supports iOS or Android');
return;
}
} catch (e) {
vscode.window.showInformationMessage(`failed to dump application:\n${(e as Error).message}`);
return;
}

const option = await vscode.window.showInformationMessage(
`Successfully pulled package ${target.data.identifier}`, 'Open', 'Dismiss')
`Successfully pulled package ${target.data.identifier}`, 'Open', 'Dismiss');
if (option === 'Open') {
// open folder in finder/explorer)
vscode.commands.executeCommand('revealFileInOS', destURI);
vscode.commands.executeCommand('revealFileInOS', artifact);
}
}

Expand All @@ -68,7 +73,7 @@ async function pull(target: AppItem, output: vscode.Uri) {
}
}

async function bagbak(target: AppItem, output: string) {
async function bagbak(target: AppItem, output: vscode.Uri) {
const shellArgs: string[] = [];
switch (target.device.type) {
case DeviceType.Remote:
Expand All @@ -83,7 +88,7 @@ async function bagbak(target: AppItem, output: string) {
return;
}

shellArgs.push.apply(shellArgs, [target.data.identifier, '-o', output]);
shellArgs.push.apply(shellArgs, [target.data.identifier, '-o', output.fsPath]);

const term = vscode.window.createTerminal({
name: 'bagbak',
Expand All @@ -105,4 +110,4 @@ async function bagbak(target: AppItem, output: string) {
term.show();
});

}
}

0 comments on commit 5f3aa4a

Please sign in to comment.