DIY premise: On the domestic forums, I searched and found various technical contents of unpacking and packaging, as well as various Chinese posts without advertisements, but this is not the purpose of this article. I have seen the packaging party not only modify the advertising of other people's apk for profit, but also modify the packaging name of other people's apk, so some people realized it long ago, but failed to find relevant technical articles. The knowledge involved in this paper is still relatively simple, without in-depth study of the deep-seated reasons, and also refers to several online posts.
PS: In domestic forums, it is difficult to find an original post, which is basically reproduced. There is no original link, which introduces many mistakes. It's really tragic that the original is hard to find. There are still a few enthusiastic people in the domestic forum, and many questions are dead and no one answers. The author tried to post a few posts on CSDN, Itje and EOE, but few people could solve the problem, so he had to turn to foreign forums, which was also a tragedy.
This problem has been solved, and it is also very simple. At least mine is simpler. I want to install more QQ browsers (some IT diaosi installed 10 WeChat, which made me feel very sweaty). The basic process is as follows:
1. Unzip the apk into a folder.
2. modify the corresponding package name in AndroidManifest.xml
3. Modify the packages in the smali directory.
4. package the folder into apk.
Step 5 re-sign apk
6. Verify the signature of apk.
7. optimize apk
8. Install apk and test it.
Basic prerequisites:
1, java environment
2. Eclipse and android development environment (this is mainly used for debugging)
3. Text editor, I use UEdit, and I can also use something similar, mainly using its search and replacement functions.
This article is mainly used to decompile apk to get the source code, but google countered it and only got some unreadable source code. Here, the source code, pictures, XML configuration, language resources and other files of the decompiled apk generation program are mainly used.
The apktool-1.0.tar.bz2 and apktool-install-Windows-2.1_ r01-1.zip mentioned in the resources can be downloaded from code.google.com/p/android-apktool/. and added to the computer's path path for easy operation. For example, if apktool can be detected, you can enter apktool at the command line. If it can be recognized, it means OK.
After referring to the domestic technical articles, some people posted with the above ideas, but there were no technical articles, so the author had to go to foreign forums to browse. In Stack Overflow, I found a related post. A foreigner left a message "You can't do this", which really violated the technical ethics, but I only made a study reference or exchange here. I found a stackoverflow. com/questions/92 1864 1/rename-the-package-name-inside-an-apk。 The answer to this post gives more detailed steps (as above). His situation is a little more complicated than this. After simplification, it is the result I want. I just follow this basic step.
Let's follow the above steps step by step: I have used apk of QQ browser version 4.0 to operate it.
1. My apktool is installed in the apktool directory under disk E, so the operation is also carried out in this directory E:\apkTool.
Copy the apk to the E:\apkTool directory and rename it qq4.0.apk (this is unnecessary, whatever).
Unpack apk from cd to E:\apkTool this directory apktool dqq4.o. apkqqq4 Unpack apk to qqq4 (this is optional).
E: \ apktool \ qqq4 The contents in this directory are as follows:
2. modify the package name in AndroidManifest.xml,
Change the package name to the new package name you want, and I changed it to com.tianxiao.tencentweb
Modify the package name related to the original package name in the related activity statement of com.tencent.qbx to the new package name of com.tianyao.tencentweb.
As for the action name in the intent-filter containing the original package name, it can remain unchanged. If it changes, the code will change accordingly.
In addition, if there is a provider, you must change the permissions of the provider. This must be unique on the same phone, otherwise the installation will fail.
3. In the e: \ apktool \ qqQ4 \ smali directory, there are many subdirectories, and most of the files in the subdirectories end in smali. The syntax of these files is somewhat similar to assembly language, so I won't go into details.
Change the declaration form of the original package name com/tencent/qbx in all files in smali directory to the new package name com/ Xiao Tian /tencentweb.
Specifically, it is to replace the file with UEdit, and point the target directory to E:\apkTool\qq4\smali, which is about 1000.
If you changed the package name in action before, you also need to change the package name com.tencent.qbx in string form to com.tianxiao.tencentweb
If there is a provider, you should also change the original permission value to the newly changed permission value in AndroidManifest.xml
4. repackage e: \ apktool \ qqq4 as apk.
apktool b qq4 newqq.apk
5. Re-sign a new newqq.apk
There are many ways to sign. One is to generate a signature manually and sign it on the command line.
I used a ready-made one, downloaded an automatic signature folder and signed it. This is relatively simple, and there are many online posts, so I won't go into details.
The newly signed apk is named newqq4signed.apk