Android-application transfer method | The material for those who want to translate applications



Rep: (319)
The article will be interesting to beginners just like me, who want to parse an already compiled * .apk file to make some changes (in most cases it will be the Russification / Ukrainization of applications, since you can change the picture with any archiver), and then back it up compile for use on the device. The option of how to do this, of course, is not one, but in this article we will focus on the programAPKTool and OS Windows . First we need programs, namely:

1) From the very beginning, we need a Java virtual machine. Download the option we needfrom the developers site . We select the system for which we need a virtual machine, click "Download", simply close the window with authorization, after which the file download will start, or you can download it manually at the bottom.

2) Now we still need to download APKTool. You can do it againfrom the developer's site : Be sure to download the first file (it is universal, regardless of the platform) and either the second, or third, or fourth file, depending on the system.

3) After we have downloaded everything, we need to install everything. There should be no problems with the virtual machine, everything is as usual programs. In order to "install" APKTool, we need to unzip the contents of both archives to the root of the Windows folder (by default this isC: \ Windows \ ). As a result, we have in the folder Windows there should be such files (starting from the version APKTool 1.3.1 mgwx.dll file not needed This dll is only relevant for older versions of the program):
Attached Image

After we have installed all the programs we need, we can proceed directly to the case. Just want to say that there is a lot done through the command line, so you need to be able to use it. For example, take the programNexus One Gallery3D . The following are our actions:

4) Open the command line (you can go through the "Start" menu, you can click "Run"), in the end you should get the following window:
Attached Image

5) Next, we need to decompile an existing * .apk file, for this we use the following template:apktool d<The path to the file><PathCatalog> where<The path to the file>- this is the path to the file that we need to decompile (I have it, for example, D: \ Android \ building \), and<PathCatalog>- this is the path to the directory where the result of the decompilation will be placed (I’ll say right away that the paths can be set both relatively and absolutely - in the first case the file and directory will be searched in the folder to which we are now on the command line, in the other case - exactly where we prescribed). In the end, we get this:
Attached Image

6) Now we go to the directory that we specified in the previous step, we see files and folders there - this is what the developer works with. To change something with the language files, we need to edit the xml files in.. \ res \ values-<Country code> where<Country code>- the letter of the country (for Ukraine - uk, for Russia - ru, ....). Files can be edited both manually and with the help of different programs (hereinafter, the program uses aiLocalizer , others can be viewed at the end of this post), which is preferable. After we run the program, we will see the following window:
Attached Image

7) Use the "Browse ..." button to select the directory where we have disassembled the * .apk file, in the left spoiler we select the localization we need, if it doesn’t exist, create the "+" button (in this case I will create the Ukrainian localization). In the right spoiler, select the file we need, in my case it is strings.xml. Three columns will appear in the lower part:Name - the internal name of the program field (we do not touch it), Original Value - translation in English (we do not touch it either) and Local value - version of the translation in the language that we chose (here we need to translate or edit everything). Here is what we get:
Attached Image

8) Each line in the fieldLocal value translate into your language - either manually or by clicking the "Auto Translate ..." button (now automatic translation does not work , see google has changed something in the algorithm ....). When all the lines have been translated, be sure to press the save button "Save changes" (circled in red), otherwise all saves will be lost. We do the same with all the files from the right spoiler, for which there are lines for translation at the bottom of the program. After translation, the window will look like this (I translated everything using auto-translation for quick action, the translation may not always be correct):
Attached Image

9) After transferring all the files from the directory of our language, you need to delete files for which there were no translation lines (in my case these are 2 files) and all files with the * .bak extension (these are backup copies of the original files). To do this, press the key "Open folder ..." (circled in red) and delete those files about which I wrote above. As a result, we should have only those files that we translated:
Attached Image
Attached Image

10) After the translation is complete, we need to again collect (compile) the file in its original state. To do this, use the following command line:apktool b<PathCatalog> where<PathCatalog>- folder with our parsed program. In the end, we get this:
Attached Image

11) In the directory where we had the program parsed, 2 more folders appeared:build and dist . We need a second folder, because It is there that the collected * .apk file is named "out.apk" (we can rename it at our discretion):
Attached Image

12) For complete happiness, we now need to sign the created program. If you have not created a test key before, you need to create it. It is createdonly once after which it can be used to sign other reassembled programs. In order to create a key, you need to go to the directory where the virtual machine is installed via the command line, go to the "bin" subfolder and run the file using the template: keytool -genkey -alias<YourAliasName>-keyalg RSA -validity<NumberDays>-keystore<YourKeystoreFilename> where<YourAliasName>- the name of your certificate<NumberDays>- the number of days the certificate is valid,<YourKeystoreFilename>- the name of the certificate store (the last two parameters: "-validity" and "-keystore" are optional, the first is needed to specify the certificate expiration days (by default, 180 days), and the second to specify the specific store where it will be stored certificate. For the parameter "-validity" we say thank you Skat01 ). As a result, the window should look like this:
Attached Image

13) Now the system will ask you line by line questions that need to be answered:
* Enter keystore password: - you need to specify a password for the repository;
* Re-enter new password: - you need to repeat the entered password for the repository;
* What is your first and last name? - you must specify your first name and surname (or something else invented);
* What is your organizational unit? - you need to specify the name of the organization unit (fantasize ....);
* What is the name of your organization? - you must specify the name of the organization;
* What is your city or locality? - you need to specify the city in which your organization is located :);
* What is your state or province? - you must specify the area of ​​the city;
* What is the two-letter country code for this unit? - you need to specify the two-letter country code (UA - Ukraine, RU - Russia, ....);
* Is .... correct? - the system offers to check whether everything is correctly filled, if everything is correct - you need to write "yes";
* Enter key password for<YourAliasName>(RETURN if same as keystore password): - you need to specify a password for your certificate, if you want to leave it the same as for the repository - do not enter anything, just press Enter;
* Re-enter new password: - if you entered a different password than for the repository, then you need to re-enter the password for your certificate.
After completing all the steps, you should have this picture on the command line:
Attached Image

14) After you have created your certificate, you can sign the program for them. To do this, from the same directory from which we created our certificate, execute the following template: jarsigner<The path to the file><YourAliasName>where<The path to the file>- the file we have compiled with changes (which is in the directorydist ), <YourAliasName>- the name of your certificate. In the process you will need to specify a password for your certificate. As a result, we will have this window:
Attached Image

15) As can be seen from the warning, the certificate is valid for only six months (perhaps smart people will tell you how to get around this restriction). Sign of successful operation of the program signature -folder META-INF in the program file . If there is a folder - everything, congratulations, our program is ready and signed, we write it on the phone, install and rejoice at the work done :)

Here is the print screen of the result of the work we did (circled by a red rectangle: the first drawing is before our changes, the second is after our manipulations with the program):
Attached ImageAttached Image

If there are suggestions or suggestions, as well as if errors are found - write in this thread, we will improve this material.

Additionally:
Program to facilitate translationbyzerabot
Another utility for translating Android applicationsbysalaoshi

There is no curator in the subject. If there is a user in the subject who wants to become a Curator and the correspondingRequirements for candidates, he can apply in the topicI want to be curator(after having studied the topic header and all materials for curators).
Prior to the appointment of the curator, on filling caps, please contactmoderatorssection through a buttonPictureunder the messages to which you want to add links.


Post has been editedvaalf - 13.05.18, 19:01
Reason for editing: added program



Rep: (6)
Excellent article thank you very much .... dreamed that someone would write more about the manipulations with APKTULLS and here on you :-)

I ask moderators to stick an article!

Post has been editedJeksan - 16.05.10, 16:03



Rep: (249)
MScorpionZ - it's just MEGA-RESPECT !!! These are no words - this is an order and three medals!
Now I will do my favorite software !!!! : heppy_dancing:



Rep: (268)
Excellent long waited for such news! : thank_you:



Rep: (249)
MScorpionZ , I carefully read several times. There was such a question.
Programs are updated very often, some a couple of times a month. Most likely the localization will fly.
Is it possible to have any templates to make the next version of the program faster or each time?
I understand that you can make a "feint with the ears" and send your locale to the developer and he will stick it in his product by 50%, or maybe not ...
Thank.



Rep: (318)
I, as a developer, will be glad to provide my own application resources for localization.
Of course, most interested in English! ))
But any other translations will definitely add.
If someone is interested, to participate so to speak in game-building) write in a personal!



Rep: (319)
Culibin
After installing the new version of the program, all changes with localization will disappear (
I didn’t think of anything better than to back up the translated files on my computer after translating the program, then, when a new version of the program appears, again check the language files for changes, if something has changed, transfer the necessary lines, if not, copy to the program immediately
Although, as to me, the best option is to email the developer, it’s also beneficial for him to have new localizations



Rep: (268)
Something does not want me to sign the application gives
jarsigner error: java.lang.RuntimeException: keystore load: C: \ Documents and Set
tings \ Admin \ .keystore (═х єfrhЄe ershchЄsh єєрчрээ√щр щрщы)


Post has been editedSkat01 - 17.05.10, 17:56



Rep: (268)
All figured out yet found here {-validity valDays} - the expiration date of your certificate. The default is 180 days, you can specify more or less - at your discretion. example -validity 365



Rep: (179)
Exception in thread "main" java.lang.RuntimeException: You must set ANDROID_SDK_
HOME variable

gives it when trying to decompile apk, what can it be?



Rep: (351)
My point 14 does not work: sveta:
Attached Image

where did I write wrong? : blush:

Post has been edited12enie - 17.05.10, 21:50



Rep: (268)
12enie,
Put normal on 80 MB preferably last



Rep: (319)
kavabunga6 @ 17.5.10, 20:54*
gives it when trying to decompile apk, what can it be?
Is it possible to print a command line screen?

12enie @ 17.5.10, 21:46*
where did I write wrong?
You have exactlyJava SE Development Kit installed? Because the print screen shows that the system cannot find a file in that folder jarsigner.exe most likely it's just not there ....

Post has been editedMScorpionZ - 17.05.10, 22:18



Rep: (179)
here:
Attached Image


sdk is on disk C: root =)

Post has been editedkavabunga6 - 17.05.10, 22:46



Rep: (351)
MScorpionZ,
no, I have something else worth it, andjarsigner.exe Otsutsvuet. Just up to this step, everything went smoothly, so I thought that I was done well. And 80 meters I have two days to swing, do not overwrite. Can anyone sign my attempt? : yes2:
out.apk

Post has been edited12enie - 17.05.10, 22:56



Rep: (179)
12enie,
what about it? apktool then it finds ok
Well, in any case did not help)))

Post has been editedkavabunga6 - 17.05.10, 22:51



Rep: (18)
by request12enie
Attached fileout.apk(1.06 MB)



Rep: (319)
kavabunga6 @ 17.5.10, 22:45*
sdk is on disk C: root =)
Obviously something messed up with a virtual machine
And if you try to enter the command line in the folder "bin", where Java is installed, and from there start with these parameters:
java -jar% WINDIR% \ apktool.jar d C: \ Android \ Rosie.apk C: \ Android2 \
Or try to reinstall? And then everything worked for me without sdk ....

12enie @ 17.5.10, 22:48*
can anyone sign my attempt?
I see already signed)

Post has been editedMScorpionZ - 17.05.10, 23:08
Reason for editing: Added



Rep: (179)
MScorpionZ @ 18.5.10, 0:06*
Obviously something messed up with a virtual machine
And if you try to enter the command line in the folder "bin", where Java is installed, and from there start with these parameters:
java -jar% WINDIR% \ apktool.jar d C: \ Android \ Rosie.apk C: \ Android2 \


Nope, still the same cant, reinstallation did not help either))) damn wonders

Post has been editedkavabunga6 - 17.05.10, 23:14



Rep: (351)
MScorpionZ,
MScorpionZ @ 18.5.10, 0:06*
I see already signed)

Nah, I asked to post my unsigned version, I just didn’t give it, I gave it to him, and he laid it out. Please sign, there’s a good launcher, I have to get better, I played with the graphics ...



Rep: (319)
kavabunga6 @ 17.5.10, 23:10*
Nope, still the same cant, reinstallation did not help either))) damn wonders
Well then, I don’t know, I’m not so familiar with Java, maybe those who are more knowledgeable will help

12enie @ 17.5.10, 23:13*
Nah, I asked to post my unsigned version, I just didn’t give it, I gave it to him, and he laid it out. Please sign, there’s a good launcher, I have to get better, I played with the graphics ...
Signed, attached to the message ("license" for 1 year)

Attached files

Attached fileout.apk(1.07 MB)


Full version    

Help     rules

Time is now: 19/07/20, 22:28