Skip to content

Commit 64e7f13

Browse files
committed
improve error detection
1 parent c1e30b6 commit 64e7f13

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/msf/core/payload/apk.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ def backdoor_apk(apkfile, raw_payload)
241241

242242
print_status "Rebuilding #{apkfile} with meterpreter injection as #{injected_apk}\n"
243243
run_cmd("apktool b -o #{injected_apk} #{tempdir}/original")
244+
unless File.readable?(injected_apk)
245+
raise RuntimeError, "Unable to rebuild apk with apktool"
246+
end
247+
244248
print_status "Signing #{injected_apk}\n"
245249
run_cmd("jarsigner -sigalg SHA1withRSA -digestalg SHA1 -keystore #{keystore} -storepass #{storepass} -keypass #{keypass} #{injected_apk} #{keyalias}")
246250
print_status "Aligning #{injected_apk}\n"

0 commit comments

Comments
 (0)