Comparing version 0.2.0 to 0.2.1
@@ -23,3 +23,2 @@ "use strict"; | ||
const disable_certificate_pinning_1 = __importDefault(require("./tasks/disable-certificate-pinning")); | ||
const observe_process_1 = __importDefault(require("./utils/observe-process")); | ||
const apktool_1 = __importDefault(require("./tools/apktool")); | ||
@@ -44,3 +43,3 @@ const uber_apk_signer_1 = __importDefault(require("./tools/uber-apk-signer")); | ||
title: 'Decoding APK file', | ||
task: () => observe_process_1.default(apktool_1.default.decode(apkPath, decodeDir)), | ||
task: () => apktool_1.default.decode(apkPath, decodeDir), | ||
}, | ||
@@ -64,15 +63,14 @@ { | ||
title: 'Encoding patched APK file', | ||
task: () => observe_process_1.default(apktool_1.default.encode(decodeDir, unsignedApkPath)), | ||
task: () => apktool_1.default.encode(decodeDir, unsignedApkPath), | ||
}, | ||
{ | ||
title: 'Signing patched APK file', | ||
task: () => { | ||
return new rxjs_1.Observable(subscriber => { | ||
(async () => { | ||
await observe_process_1.default(uber_apk_signer_1.default.sign(unsignedApkPath)).forEach(line => subscriber.next(line)); | ||
await fs.copyFile(path.join(tmpDir, 'unsigned-aligned-debugSigned.apk'), finishedApkPath); | ||
subscriber.complete(); | ||
})(); | ||
}); | ||
}, | ||
task: () => new rxjs_1.Observable(subscriber => { | ||
(async () => { | ||
await uber_apk_signer_1.default.sign(unsignedApkPath) | ||
.forEach(line => subscriber.next(line)); | ||
await fs.copyFile(path.join(tmpDir, 'unsigned-aligned-debugSigned.apk'), finishedApkPath); | ||
subscriber.complete(); | ||
})(); | ||
}), | ||
}, | ||
@@ -79,0 +77,0 @@ ]).run().catch(error => { |
@@ -14,13 +14,14 @@ "use strict"; | ||
const path = __importStar(require("path")); | ||
const operators_1 = require("rxjs/operators"); | ||
const execute_jar_1 = __importDefault(require("../utils/execute-jar")); | ||
const observe_process_1 = __importDefault(require("../utils/observe-process")); | ||
const jar = path.join(__dirname, '../../jar/apktool.jar'); | ||
const apktool = { | ||
decode(inputPath, outputPath) { | ||
return execute_jar_1.default(jar, ['decode', inputPath, '--output', outputPath]); | ||
}, | ||
encode(inputPath, outputPath) { | ||
return execute_jar_1.default(jar, ['build', inputPath, '--output', outputPath, '--use-aapt2']); | ||
}, | ||
decode: (inputPath, outputPath) => observeApktool(execute_jar_1.default(jar, ['decode', inputPath, '--output', outputPath])), | ||
encode: (inputPath, outputPath) => observeApktool(execute_jar_1.default(jar, ['build', inputPath, '--output', outputPath, '--use-aapt2'])), | ||
version: 'v2.4.1 SNAPSHOT@197d46', | ||
}; | ||
function observeApktool(process) { | ||
return operators_1.map((line) => line.replace(/I: /g, ''))(observe_process_1.default(process)); | ||
} | ||
exports.default = apktool; |
@@ -15,9 +15,8 @@ "use strict"; | ||
const execute_jar_1 = __importDefault(require("../utils/execute-jar")); | ||
const observe_process_1 = __importDefault(require("../utils/observe-process")); | ||
const jar = path.join(__dirname, '../../jar/uber-apk-signer.jar'); | ||
const uberApkSigner = { | ||
sign(inputPath) { | ||
return execute_jar_1.default(jar, ['--apks', inputPath]); | ||
}, | ||
sign: (inputPath) => observe_process_1.default(execute_jar_1.default(jar, ['--apks', inputPath])), | ||
version: 'v1.1.0', | ||
}; | ||
exports.default = uberApkSigner; |
@@ -13,3 +13,3 @@ { | ||
], | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"license": "MIT", | ||
@@ -16,0 +16,0 @@ "scripts": { |
18427085
327