-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.sh
42 lines (29 loc) · 1.22 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
temp_dir="/data/local/tmp"
so_name="libsearch.so"
pwd=`pwd`
#package="com.example.crash_test"
package="com.supercell.clashofclans.uc"
fun_push_file()
{
adb push $1 ${temp_dir}/$2
echo "adb push $1 ${temp_dir}/$2"
adb shell chmod 777 ${temp_dir}/$2
echo "adb shell chmod 777 ${temp_dir}/$2"
}
fun_push_file "inject_dex/build/intermediates/cmake/release/obj/armeabi-v7a/libinject-dex.so" "libinject-dex.so"
fun_push_file "inject_dex_target/build/outputs/apk/inject_dex_target-release.apk" "inject.apk"
# copy so
unzip -o "inject_dex_target/build/outputs/apk/inject_dex_target-release.apk" lib/armeabi-v7a/${so_name} -d .
adb shell mount -o remount,rw /system
adb push lib/armeabi-v7a/${so_name} /system/lib/${so_name}
echo adb push lib/armeabi-v7a/${so_name} /system/lib/${so_name}
adb shell mount -o remount,ro /system
# execute injector
exe_bin="injector"
cd inject_zygote/.externalNativeBuild/cmake/release/armeabi-v7a
/Users/mama/Library/Android/SDK/cmake/3.6.3155560/bin/ninja
echo `pwd`
adb push ${exe_bin} ${temp_dir}/${exe_bin}
adb shell ${temp_dir}/${exe_bin} "${package}" "/data/local/tmp/libinject-dex.so"
echo adb shell ${temp_dir}/${exe_bin} "${package}" "/data/local/tmp/libinject-dex.so"
#cd ${pwd}