-
-
Save stoyicker/c787e36d50229bf75c30d8e095d80ff6 to your computer and use it in GitHub Desktop.
Revisions
-
stoyicker revised this gist
Jul 7, 2020 . 1 changed file with 0 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,11 +32,6 @@ Next, we need to disassemble the apk using `apktool`: ``` $ apktool d -o output-dir com.mypackage.apk ``` In `output-dir`, find `AndroidManifest.xml` and open it up in the text editor of your choice. In the `application` xml node, add/update the following xml attribute: -
stoyicker revised this gist
Jul 7, 2020 . 1 changed file with 0 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,11 +37,6 @@ Then, do it again and this time specify the -r option and a different output dir ``` $ apktool d -r -o output-dir-raw com.mypackage.apk ``` In `output-dir`, find `AndroidManifest.xml` and open it up in the text editor of your choice. In the `application` xml node, add/update the following xml attribute: -
stoyicker revised this gist
Jan 7, 2020 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,7 +37,11 @@ Then, do it again and this time specify the -r option and a different output dir ``` $ apktool d -r -o output-dir-raw com.mypackage.apk ``` We will need the raw version to rebuild successfully, but we need the decoded one to be able to edit the manifest. So, copy and replace the manifest from `output-dir-raw` into `output-dir`. ``` cp output-dir/AndroidManifest.xml output-dir-raw/AndroidManifest.xml ``` In `output-dir`, find `AndroidManifest.xml` and open it up in the text editor of your choice. In the `application` xml node, add/update the following xml attribute: -
stoyicker revised this gist
Jan 7, 2020 . 1 changed file with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,11 +30,16 @@ $ adb pull /data/app/com.mypackage.apk Next, we need to disassemble the apk using `apktool`: ``` $ apktool d -o output-dir com.mypackage.apk ``` Then, do it again and this time specify the -r option and a different output dir: ``` $ apktool d -r -o output-dir-raw com.mypackage.apk ``` We will need the raw version to rebuild successfully, but we need the decoded one to be able to edit the manifest. So, copy the manifest from output-dir-raw into output-dir. In `output-dir`, find `AndroidManifest.xml` and open it up in the text editor of your choice. In the `application` xml node, add/update the following xml attribute: ``` android:debuggable="true" @@ -43,7 +48,7 @@ android:debuggable="true" Now we need to reassemble the application. We do this by running: ``` $ apktool b -o com.mypackge.apk output-dir ``` Finally, we need to resign the APK so that the device will accept it: -
stoyicker revised this gist
Jan 7, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,7 +30,7 @@ $ adb pull /data/app/com.mypackage.apk Next, we need to disassemble the apk using `apktool`: ``` $ apktool d -r -o output-dir com.mypackage.apk ``` In `output-dir`, find `AndroidManifest.xml` and open it up in the text editor of your choice. @@ -43,7 +43,7 @@ android:debuggable="true" Now we need to reassemble the application. We do this by running: ``` $ apktool b -r -o com.mypackge.apk output-dir ``` Finally, we need to resign the APK so that the device will accept it: -
nstarke revised this gist
Apr 19, 2016 . 1 changed file with 10 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,20 +17,20 @@ For this task, we'll need `apktool` ( http://ibotpeaches.github.io/Apktool/ ). you'll need to find the path to the APK to pull it off the device. Run: ``` $ adb shell pm list packages -f -3 ``` Find the package in the list (it should look something like `/data/app/com.mypackage.apk=com.mypackage`), and pull it off the device: ``` $ adb pull /data/app/com.mypackage.apk ``` Next, we need to disassemble the apk using `apktool`: ``` $ apktool d -o output-dir com.mypackage.apk ``` In `output-dir`, find `AndroidManifest.xml` and open it up in the text editor of your choice. @@ -43,7 +43,13 @@ android:debuggable="true" Now we need to reassemble the application. We do this by running: ``` $ apktool b -o com.mypackge.apk output-dir ``` Finally, we need to resign the APK so that the device will accept it: ``` $ keytool -genkey -v -keystore resign.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 $ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore resign.keystore com.mypackage.apk alias_name ``` That's it! You should now be able to transfer the new com.mypackage.apk back to the device and run it. -
nstarke created this gist
Apr 19, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,50 @@ # How to make a Release Android App debuggable Let's say you want to access the application shared preferences in /data/data/com.mypackage. You could try to run `adb shell` and then `run-as com.mypackage` ( or `adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs`), but on a production release app downloaded from an app store you're most likely to see: ``` run-as: Package 'com.mypackage' is not debuggable ``` While ADB's `adb backup` command will pull many of the files from the application's data directory, the files can be inconsistent with what is actually on the device. If you want to see what is actually on the device, you need to make the application debuggable. For this task, we'll need `apktool` ( http://ibotpeaches.github.io/Apktool/ ). Once you have it setup, you'll need to find the path to the APK to pull it off the device. Run: ``` adb shell pm list packages -f -3 ``` Find the package in the list (it should look something like `/data/app/com.mypackage.apk=com.mypackage`), and pull it off the device: ``` adb pull /data/app/com.mypackage.apk ``` Next, we need to disassemble the apk using `apktool`: ``` apktool d -o output-dir com.mypackage.apk ``` In `output-dir`, find `AndroidManifest.xml` and open it up in the text editor of your choice. In the `application` xml node, add the following xml attribute: ``` android:debuggable="true" ``` Now we need to reassemble the application. We do this by running: ``` apktool b -o com.mypackge.apk output-dir ``` That's it! You should now be able to transfer the new com.mypackage.apk back to the device and run it. Now you should be able to run `adb shell run-as ls /data/data/com.mypackage/` without getting the debuggable error.