APK decompilation goes beyond advertising secrets, and apk decompilation secrets
Decompile APK to Advertisement
Procedure:
1. Download apktool
: Https://code.google.com/p/android-apktool/downloads/list
2. decompile the apk using apktool. Enter the following command in the command line: apktool. bat d-f aaa.apk (apk path) decompile the APK File
3. start modifying the XML layout File
First, we enter the decompiled folder.
Go to the C: \ apk \ com. youmi. android. sample \ res \ layout directory.
Open activity_ad.xml in Notepad (Note: Different program advertisements are in different files. You can check that other files are in xml files under the res \ layout directory .)
The following code is displayed:
<LinearLayout
Android: id = "@ + id/adLayout"
Android: layout_width = "fill_parent"
Android: layout_height = "wrap_content"
Android: layout_alignParentBottom = "true"
Android: gravity = "center_horizontal"
Android: orientation = "horizontal"
>
This code is used to display advertisements. We can change it
<LinearLayout
Android: id = "@ + id/adLayout"
Android: layout_width = "fill_parent"
Android: layout_height = "wrap_content"
Android: layout_alignParentBottom = "true"
Android: gravity = "center_horizontal"
Android: orientation = "horizontal"
Android: visibility = "gone"
>
In this way, the advertisement is hidden.
4. Use apktool to compile the modified Code into APK and enter apktool. bat B aaa (the folder you compiled)
5. Remember to sign the new APK.
Sign apk file: jarsigner-keystore test. keystore-storepass password-verbose TestApp-unsigned.apk name_alias
Appendix
Jarsigner command details
[-Keystore <url>] keystore location
[-Storepass <password>] password used for keystore integrity
[-Storetype <type>] keystore type
[-Keypass <password>] private key password (if different)
[-Sigfile <File>]. SF/. DSA file name
[-Signedjar <File>] Name of the signed JAR File
[-Digestalg <algorithm>] Name of the digest algorithm
[-Sigalg <algorithm>] signature algorithm name
[-Verify] verify the signed JAR File
[-Verbose] Output details during signature/Verification
[-Certs] outputs details and displays the certificate during verification
[-Tsa <url>] Location of the timestamp Mechanism
[-Tsacert <alias>] Public Key Certificate of the time stamp organization
[-Altsigner <class>] Class Name of the alternative signature mechanism
[-Altsignerpath <path list>] Location of the alternative signature mechanism
[-Internalsf] contains the. SF file in the signature block.
[-Sectionsonly] does not calculate the hash of the entire list
[-Protected] keystore protected authentication path
[-ProviderName <Name>] provider name
[-ProviderClass <class> name of the encryption service provider
[-ProviderArg <parameter>]... main class file and constructor Parameters