2024-09-12 12:53:20 +02:00
|
|
|
#!/bin/bash
|
2024-09-12 12:52:03 +02:00
|
|
|
set -euo pipefail
|
2024-03-04 16:50:14 +01:00
|
|
|
java -jar /apktool.jar d /data/app.apk
|
|
|
|
sed 's/android:extractNativeLibs="false"/android:extractNativeLibs="true"/' -i app/AndroidManifest.xml
|
|
|
|
if ! grep -q android.permission.INTERNET app/AndroidManifest.xml; then
|
|
|
|
sed 's/<\/manifest>/<uses-permission android:name="android.permission.INTERNET"\/><\/manifest>/' -i app/AndroidManifest.xml
|
|
|
|
fi
|
|
|
|
/patch-main.py
|
|
|
|
mkdir -p app/lib/arm64-v8a
|
|
|
|
cp /libfrida-gadget.so /libfrida-gadget.config.so app/lib/arm64-v8a
|
2024-03-04 18:35:15 +01:00
|
|
|
sed "s/FRIDA_TOKEN/${FRIDA_TOKEN:-secret}/" -i app/lib/arm64-v8a/libfrida-gadget.config.so
|
2024-03-04 16:50:14 +01:00
|
|
|
java -jar /apktool.jar b -o patched.apk app
|
|
|
|
java -jar /apk-signer.jar --overwrite -a patched.apk
|
|
|
|
cp patched.apk /data
|