Comparing version 1.0.1 to 1.0.2
@@ -11,4 +11,5 @@ import Apktool from './tools/apktool'; | ||
wait: boolean; | ||
isAppBundle: boolean; | ||
debuggable: boolean; | ||
}; | ||
export declare function showArmWarning(): void; |
@@ -12,2 +12,3 @@ "use strict"; | ||
const uber_apk_signer_1 = require("./tools/uber-apk-signer"); | ||
const user_error_1 = require("./utils/user-error"); | ||
const { version } = require('../package.json'); | ||
@@ -33,2 +34,3 @@ async function main() { | ||
const outputPath = path.resolve(path.dirname(inputPath), outputName); | ||
let isAppBundle = false; | ||
let taskFunction; | ||
@@ -40,2 +42,3 @@ switch (fileExtension) { | ||
case '.xapk': | ||
isAppBundle = true; | ||
taskFunction = patch_app_bundle_1.patchXapkBundle; | ||
@@ -45,2 +48,3 @@ break; | ||
case '.zip': | ||
isAppBundle = true; | ||
taskFunction = patch_app_bundle_1.patchApksBundle; | ||
@@ -68,2 +72,3 @@ break; | ||
skipPatches: args.skipPatches, | ||
isAppBundle, | ||
debuggable: args.debuggable, | ||
@@ -96,2 +101,6 @@ }) | ||
function getErrorMessage(error, { tmpDir }) { | ||
// User errors can be shown without a stack trace | ||
if (error instanceof user_error_1.default) | ||
return error.message; | ||
// Errors from commands can also be shown without a stack trace | ||
if (error.all) | ||
@@ -98,0 +107,0 @@ return formatCommandError(error.all, { tmpDir }); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const execa = require("execa"); | ||
const Listr = require("listr"); | ||
const get_java_version_1 = require("../utils/get-java-version"); | ||
const user_error_1 = require("../utils/user-error"); | ||
const download_tools_1 = require("./download-tools"); | ||
@@ -27,2 +29,9 @@ const MIN_NODE_VERSION = 14; | ||
{ | ||
title: 'Checking additional tools', | ||
task: async () => { | ||
if (options.isAppBundle && process.platform !== 'win32') | ||
await ensureZipUlitiesAvailable(); | ||
}, | ||
}, | ||
{ | ||
title: 'Downloading tools', | ||
@@ -34,3 +43,17 @@ task: () => download_tools_1.default(options), | ||
exports.default = checkPrerequisites; | ||
class VersionError extends Error { | ||
/** | ||
* Ensure that `zip` and `unzip` are installed on Linux or macOS. Both are used | ||
* (through the `cross-zip` package) when patching App Bundles. | ||
*/ | ||
async function ensureZipUlitiesAvailable() { | ||
try { | ||
await execa('unzip', ['-v']); | ||
await execa('zip', ['-v']); | ||
} | ||
catch (_a) { | ||
throw new user_error_1.default('apk-mitm requires the commands "unzip" and "zip" to be installed when patching App Bundles.' + | ||
" Make sure they're both installed and try again!"); | ||
} | ||
} | ||
class VersionError extends user_error_1.default { | ||
constructor(tool, minVersion, currentVersion) { | ||
@@ -37,0 +60,0 @@ super(`apk-mitm requires at least ${tool} ${minVersion} to work and you seem to be using ${tool} ${currentVersion}.` + |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const execa = require("execa"); | ||
const user_error_1 = require("./user-error"); | ||
/** Returns the major version of the system's default Java installation. */ | ||
@@ -12,3 +13,3 @@ async function getJavaVersion() { | ||
const message = `Could not extract Java major version from "java -version" output!\n${stderr}`; | ||
throw new Error(message); | ||
throw new user_error_1.default(message); | ||
} | ||
@@ -19,3 +20,3 @@ return parseInt(majorVersionString); | ||
if (error.code === 'ENOENT') | ||
throw new Error('No "java" executable could be found!' + | ||
throw new user_error_1.default('No "java" executable could be found!' + | ||
' Make sure that Java is installed and available in your PATH.'); | ||
@@ -22,0 +23,0 @@ throw error; |
@@ -14,3 +14,3 @@ { | ||
], | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"license": "MIT", | ||
@@ -41,3 +41,3 @@ "scripts": { | ||
"listr": "^0.14.3", | ||
"rxjs": "^6.6.7", | ||
"rxjs": "^7.1.0", | ||
"tempy": "^1.0.1", | ||
@@ -54,3 +54,6 @@ "xml-js": "^1.6.11", | ||
"typescript": "^4.2.4" | ||
}, | ||
"resolutions": { | ||
"**/rxjs": "^7.1.0" | ||
} | ||
} |
@@ -54,3 +54,3 @@ # apk-mitm | ||
You can also patch apps using [Android App Bundle](android-app-bundle) with `apk-mitm` by providing it with a `*.xapk` file (for example from [APKPure][apkpure]) or a `*.apks` file (which you can export yourself using [SAI][sai]). | ||
You can also patch apps using [Android App Bundle](android-app-bundle) with `apk-mitm` by providing it with a `*.xapk` file (for example from [APKPure][apkpure]) or a `*.apks` file (which you can export yourself using [SAI][sai]). If you're doing this on Linux, make sure that both `zip` and `unzip` are installed. | ||
@@ -57,0 +57,0 @@ ### Making manual changes |
55905
56
1224
+ Addedrxjs@7.8.1(transitive)
+ Addedtslib@2.8.1(transitive)
Updatedrxjs@^7.1.0