Comparing version 0.9.3 to 0.9.4
@@ -33,3 +33,3 @@ "use strict"; | ||
const modify_manifest_1 = __importDefault(require("./tasks/modify-manifest")); | ||
const modify_netsec_config_1 = __importDefault(require("./tasks/modify-netsec-config")); | ||
const create_netsec_config_1 = __importDefault(require("./tasks/create-netsec-config")); | ||
const disable_certificate_pinning_1 = __importDefault(require("./tasks/disable-certificate-pinning")); | ||
@@ -41,3 +41,2 @@ function patchApk(taskOptions) { | ||
let fallBackToAapt = false; | ||
let nscName; | ||
return new listr_1.default([ | ||
@@ -56,3 +55,2 @@ { | ||
const result = await modify_manifest_1.default(path.join(decodeDir, 'AndroidManifest.xml')); | ||
nscName = result.nscName; | ||
context.usesAppBundle = result.usesAppBundle; | ||
@@ -62,4 +60,4 @@ }, | ||
{ | ||
title: 'Modifying network security config', | ||
task: () => modify_netsec_config_1.default(path.join(decodeDir, `res/xml/${nscName}.xml`)), | ||
title: 'Replacing network security config', | ||
task: () => create_netsec_config_1.default(path.join(decodeDir, `res/xml/nsc_mitm.xml`)), | ||
}, | ||
@@ -66,0 +64,0 @@ { |
@@ -32,15 +32,8 @@ "use strict"; | ||
application._attributes['android:debuggable'] = 'true'; | ||
let nscName = 'network_security_config'; | ||
const nscReference = application._attributes['android:networkSecurityConfig']; | ||
if (nscReference && nscReference.startsWith('@xml/')) { | ||
nscName = nscReference.slice(5); | ||
} | ||
else { | ||
application._attributes['android:networkSecurityConfig'] = `@xml/${nscName}`; | ||
} | ||
application._attributes['android:networkSecurityConfig'] = '@xml/nsc_mitm'; | ||
const usesAppBundle = application['meta-data'] && application['meta-data'] | ||
.some((meta) => meta._attributes['android:name'] === 'com.android.vending.splits'); | ||
await fs.writeFile(path, xml_js_1.default.js2xml(fileXml, { compact: true, spaces: 4 })); | ||
return { nscName, usesAppBundle }; | ||
return { usesAppBundle }; | ||
} | ||
exports.default = modifyManifest; |
@@ -13,3 +13,3 @@ { | ||
], | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"license": "MIT", | ||
@@ -25,3 +25,3 @@ "scripts": { | ||
"dist", | ||
"jar" | ||
"res" | ||
], | ||
@@ -28,0 +28,0 @@ "engines": { |
@@ -13,3 +13,3 @@ # apk-mitm | ||
- modify the app's `AndroidManifest.xml` to make it [`debuggable`][manifest-debuggable] | ||
- modify the app's [Network Security Configuration][network-security-config] to allow user-added certificates | ||
- replace the app's [Network Security Configuration][network-security-config] to allow user-added certificates | ||
- [insert `return-void` opcodes][patch-certificate-pinning] to disable [certificate pinning][certificate-pinning] logic | ||
@@ -36,3 +36,3 @@ - encode the patched APK file using [Apktool][apktool] | ||
✔ Modifying app manifest | ||
✔ Modifying network security config | ||
✔ Replacing network security config | ||
✔ Disabling certificate pinning | ||
@@ -39,0 +39,0 @@ ✔ Encoding patched APK file |
50844
23
1002