{"id":316,"date":"2016-11-07T14:54:13","date_gmt":"2016-11-07T13:54:13","guid":{"rendered":"http:\/\/www.sarbyn.com\/tech\/?p=316"},"modified":"2024-10-19T19:55:45","modified_gmt":"2024-10-19T18:55:45","slug":"unpack-modify-and-rebuild-an-apk","status":"publish","type":"post","link":"https:\/\/www.sarbyn.com\/blog\/2016\/11\/07\/unpack-modify-and-rebuild-an-apk\/","title":{"rendered":"Unpack, modify and rebuild an APK"},"content":{"rendered":"<p>This is NOT an &#8220;Android hacker HOW-TO&#8221;. This is only a quick reference for myself.<\/p>\n<ul>\n<li>Step 1 : decompile APK using <em>apktool d -f -r app_name.apk<\/em><\/li>\n<li>Step 2 : delete the original apk<\/li>\n<li>Step 2 : Modify SMALI files<\/li>\n<li>Step 3 : Rebuild apk using <em>apktool b app_name<\/em><\/li>\n<li>Step 4 : Generate a signing key with <em>keytool -genkey -keystore test.keystore -validity 10000 -alias test<\/em><\/li>\n<li>Step 5 : Sign the new APK <em>jarsigner -keystore test.keystore -verbose app_name.apk test<\/em><\/li>\n<li>Step 7 : Install apk and enjoy!<\/li>\n<\/ul>\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\napktool d -f -r app_name.apk\ndelete app_name.apk\n--- modify smali files ---\napktool b app_name -o app_name.apk\nkeytool -genkey -keystore test.keystore -validity 10000 -alias test\nzipalign -v 4 app_name.apk app_name_aligned.apk\napksigner sign --ks test.keystore --out app_name_aligned.apk app_name_signed.apk\nadb install -r app_name_signed.apk\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is NOT an &#8220;Android hacker HOW-TO&#8221;. This is only a quick reference for myself. Step 1 : decompile APK using apktool d -f -r app_name.apk Step 2 : delete the original apk Step 2 : Modify SMALI files Step 3 : Rebuild apk using apktool b app_name Step 4 : Generate a signing key <a class=\"read-more\" href=\"https:\/\/www.sarbyn.com\/blog\/2016\/11\/07\/unpack-modify-and-rebuild-an-apk\/\">&hellip;&nbsp;<span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Unpack, modify and rebuild an APK","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[5],"tags":[86,83,51,85,84],"class_list":["post-316","post","type-post","status-publish","format-standard","hentry","category-android","tag-adb","tag-apk","tag-apktool","tag-decompile","tag-smali"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3JApm-56","jetpack_likes_enabled":true,"jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/posts\/316"}],"collection":[{"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/comments?post=316"}],"version-history":[{"count":6,"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/posts\/316\/revisions"}],"predecessor-version":[{"id":493,"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/posts\/316\/revisions\/493"}],"wp:attachment":[{"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/media?parent=316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/categories?post=316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sarbyn.com\/blog\/wp-json\/wp\/v2\/tags?post=316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}