frida-utils/apk-injector/inject-frida.sh

15 lines
678 B
Bash
Raw Normal View History

2024-03-04 16:50:14 +01:00
#!/bin/sh
set -e
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