[How to]Apk Studio, decompilation - recompilation - Galaxy Ace S5830 General

Apk Studio, decompilation - recompilation, How to
I tried several times to work with Apk Studio, but I could not find a guide to understand exactly how it works.
Finally, one day I understood.
That's why I thought that would be a useful guide to understand others, how simple it is.
-------------------------------------------------------------------------------------------
You need:
Java Runtime Environment
Apk Studio, which you can download here
-------------------------------------------------------------------------------------------
Let's start:
Unzip Apk Studio archive
Reserve the archive, do not delete.
Note: Where you unzip the archive on PC, there you will work. If you wont to change the address on your PC for work, then unzip again the archive to new address.
-------------------------------------------------------------------------------------------
- Create a new folder on Desktop named -> Project 1
- Copy in the new folder Project 1 the file framework-res.apk of the ROM you want to mod.
View attachment 3180767
- Open Apk Studio;
- choose File -> Settings in Apk Studio;
- to Binaries you have the path to binaries, do not touch there;
- click the Add button
View attachment 3180773
- to Tag write -> framework
- to Path click and search the path to Project 1\framework-res.apk, then Open and then Install,
- cick Save
View attachment 3180780
View attachment 3180785
Now framework-res.apk it is installed.
You can install more framework from other ROM, but do not forget to change the name Tag, for that you can recognize it.
-------------------------------------------------------------------------------------------
- add file DeskClock.apk in Project 1, the file is attached below;
View attachment 3180787
View attachment DeskClock.zip
- In folder Project 1 create another folder DeskClock JB or whatever name you want to call (not strictly necessary);
View attachment 3180795
- in Apk Studio open File -> Apk;
- to Project name -> add a name "1" (for example or how do you want), it will be create a folder with this name;
Note: spaces between words are not allowed to this name;
- to Apk Path choose the path to the file DeskClock.apk;
View attachment 3180800
- to Project Location choose the path to the folder DeskClock JB - just select the folder, and click Select Folder, do not open the folder DeskClock JB;
- to Framework - selects the framework installed;
View attachment 3180801
- click Create and waits;
- in Statusbar, Apk Studio will tell you when finished.
- it was made decompilation
-------------------------------------------------------------------------------------------
1. You can work on Apk Studio or you can put in bar and open files with Notepad++
2. You can close Apk Studio and reopen leter.
-------------------------------------------------------------------------------------------
1.
- the folder "1" has been created, as we called the project;
- plus a new folder was created with the name "original", that contains files that will serve to recompile;
View attachment 3180804
View attachment 3180808
- In Apk Studio looking to change the value to the path 1/res/layout/desk_clock_time_date.xml
View attachment 3180812
- find TextView android: textSize = "106.0sp" that should be changed to 100.0sp
View attachment 3180813
- I changed the value;
View attachment 3180814
Why I changed DeskClock.apk, you can see here
- choose File -> Save, and close the file;
- under View - click Build, the Statusbar tells you what makes Apk Studio and when it is finished;
- in the folder Project 1\DeskClock JB\1 was createed a new folder named "built"
View attachment 3180816
- the folder "built" contains the file rebuilt.apk
View attachment 3180818
- rename file rebuilt.apk to DeskClock.apk
That's all.
Done!
-------------------------------------------------------------------------------------------
2.
If you have close Apk Studio to use another program for changes, like Notepad ++ when open again Apk Studio you will see that the source is not there.
- we do a test
- close Apk Studio
- delete the new folder "built", only the folder "built" with content;
- open Apk Studio
- choose File -> Open Directory
- Look for path Project 1\DeskClock JB\1\apktool.yml
- select the file apktool.yml and choose Open;
- source reappears in APK Studio;
- select 1, name folder that contains the source;
View attachment 3180819
- click Built, under View;
- Recompiled folder "built" that you deleted, is recreated and contains rebuilt.apk
- rename the .apk file
That's all.
Done!
-------------------------------------------------------------------------------------------------------------------------------
Thanks to:
vaibhavpandeyvpz for Apk Studio
-------------------------------------------------------------------------------------------------------------------------------
Think Different
"Because the people who are crazy enough to think they can change the world, are the ones who do."
Steve Jobs

Hi!
Can you upload APK Studio 10.0.0.2? For a long time only the new version is available which is unusable.

Related

How to: Create Clockwork Recovery flash files

I have a shutdown sequence and some sounds I would like to turn in to a flashable .zip file. I checked out the CW forums, but that was more painful than informative. I have taken a look at some of the zip files I have found so far, but am not 100% sure about what I'm doing. Can anyone point me to a how-to or even in the general direction of some information to get me started?
Thanks guys!
Edit: Those interested can find all the information needed in the3dman's post and here:
http://www.londatiga.net/it/how-to-create-android-update-zip-package/
http://www.londatiga.net/general/how-to-sign-apk-zip-files/
I'd copy this guy
http://forum.xda-developers.com/showthread.php?t=795459
Thanks for the link. I had actually started there, and it's a great template if I just want to throw in my own files, but I was really looking for a how to so that I had more options for customizing, rather than being stuck with only the shutdown / startup sequence.
Sent from my SGH-T959 using XDA App
First you have to have your folder structure like this in the zip:
Main .zip
{
META-INF { com -> google -> android -> update-script } ( <- these are folders inside the META-INF except update-script this is a script file)
app (if the file you want to flash is an app it goes in this folder)
framework (if the file you want to flash is a framework file it goes in this folder)
system (if the file you want to flash is a system file (start up animations) it goes in this folder also make sure you put the correct subfolder inside this folder ie: if your file goes in system -> media make sure you put the file you wish to flash in a correctly named subfolder other wise it will flash into just the system folder and not into the correct folder within the system folder on your phone.)
}
After your folder structure is set up you must tell clockwork which folder or folders in the zip to flash. To do this open the update-script from the zip with a text editor and modify or add these lines with the correct folders.
copy_dir PACKAGE:framework SYSTEM:framework (use this for the framework folder)
copy_dir PACKAGE:app SYSTEM:app (use this for the app folder)
copy_dir PACKAGE:system SYSTEM:system (use this for the system folder)
Then sign your zip and flash.
Below is a picture of an example folder structure so show what I mean. Also I attached a zip with an example update-script in it.
the3dman said:
First you have to have your folder structure like this in the zip:
Main .zip
{
META-INF { com -> google -> android -> update-script } ( <- these are folders inside the META-INF except update-script this is a script file)
app (if the file you want to flash is an app it goes in this folder)
framework (if the file you want to flash is a framework file it goes in this folder)
system (if the file you want to flash is a system file (start up animations) it goes in this folder also make sure you put the correct subfolder inside this folder ie: if your file goes in system -> media make sure you put the file you wish to flash in a correctly named subfolder other wise it will flash into just the system folder and not into the correct folder within the system folder on your phone.)
}
After your folder structure is set up you must tell clockwork which folder or folders in the zip to flash. To do this open the update-script from the zip with a text editor and modify or add these lines with the correct folders.
copy_dir PACKAGE:framework SYSTEM:framework (use this for the framework folder)
copy_dir PACKAGE:app SYSTEM:app (use this for the app folder)
copy_dir PACKAGE:system SYSTEM:system (use this for the system folder)
Then sign your zip and flash.
Below is a picture of an example folder structure so show what I mean. Also I attached a zip with an example update-script in it.
Click to expand...
Click to collapse
Thank you very much! This was PERFECT for getting me started! This lead me to the following sites for more information on how-to's and even all the available syntax. For anyone looking to get into this (it's not difficult), check out these pages:
http://www.londatiga.net/general/how-to-sign-apk-zip-files/
http://www.londatiga.net/it/how-to-create-android-update-zip-package/

[TUT] Advance Framework Edit

things you'll need
APK MANAGER
7zip
DESCRIPTION :
Q : Basic
A : The icons are stored in the Drawable-mdpi folder in the framework.
these icons are linked to XML's in Drawable folder
if you just add the icons and don't change the xml, you'll get nothing.
Q : Why Cant we just Edit the XML files?
A : The XML files are encrypted. if you try to edit it you will get weird characters.
Q : No XML No Edits, Are we Done?
A : Yes, No XML No Edits. But we've a walkaround. The APK MANAGER
it decompiles the apk and unencrypts the xml file.
BASIC :
Extract the contents of APK MANAGER to any folder
you'll have few folders
place your apk in the place-apk-here-for-modding folder
open Script.bat
and chose option to decompile and minimize
it will create a folder namely PROJECTS
now you can edit the xml files
after your done, maximize the apkmanager window and choose comiple apk
HOW TO ADD MORE PNGS :
if you want to add pngs like the battery percentage you'll need to link the png to the xml file
this can be done by two ways
1. assigning resource_id
&
2. directly putting in the names
the 1st method is easy but complex so forget it
the second method is simpler.
just find the xml file corresponding to the png and than simply add the name.
for eg.
stat_sys_battery.xml is the battery status xml.
<item android:drawable="@drawable/stat_sys_battery_0" android:maxLevel="0" />
Click to expand...
Click to collapse
here the
android:drawable is the android code
and
@drawable/stat_sys_battery_* is the file location
check the attachment for better understanding
Click to expand...
Click to collapse
THE PROBLEM & THE SOLUTION :
if you try to edit any modded framework file you'll get error while compiling.
and your phone will hang if you use that file.
SOLUTION
instead of using modded file. use the STOCK framework. Edit your files and compile your apk
now when you compile it, it will give you few options
1. is it a system file [y/n]
choose yes
2. (...blah blah.. do you wish to keep files)
choose yes
now it will extract the stock (unedited) framework in a KEEP folder
minimize the window
open the folder and delete all the files you modified.
if you had modified xml file you'll also need to delete resources.asrc
now maximize the apkmanager window and press any key.
your modded apk will be compiled in the place-apk-here-for-modding folder
PS : IT WOULD BE UNSIGNED
LAST STEP :
open the compiled unsigned apk and extract all the files you edited (including resources.asrc)
simply replace these files in the framework-res.apk you wanted to mod
only part to take care is the resources.asrc file you don't have to replace it directly
do this steps for replacing resources.asrc
1. right click the resources.asrc
2. select add to archive
3. archive format zip
4. compression method Store
5. select the path of your framework-res.apk
I know this all seems way to complex but if you read carefully and do it step by step, its all easy as a PIE

[TUTORIAL] How to change apk icons

Use X-Plore file manager
(Root access is required)
First backup your original apk file.
Instructions:
1- Open an app as zip file
2- go to res\drawable-hdpi\ folder or other folders
3- find icon.png in this folder
4- then Go to the second section in the browser (on the screenshot)
5- find the png file which is your new icon.
6- Rename it "icon.png" and mark.
7- Then copy it and write over old one.
8- Done
Note:The new apk file is not signed so you can't install it like a normal installation.
So you can push it to the system\app folder (Root access is required)

How to Get a Custom Home Button

So here is the way, how You can create Custom Home Button.
* Softwares you need to do this : (all download links provided below) :
1) 7-Zip File Manager
2) Windows Image Resizer
* Stepwise Guide :
STEP 1 : Get you launcher’s (.apk) file
STEP 2 : Extract it with 7-Zip File Manager
STEP 3 : Open the folder where you have extracted the apk file
STEP 4 : You will find a folder named ‘res’ ; open it and go to ‘res\drawable-hdpi"; open all folders inside 'res' folder and make sure that you have replaced all the stock isons by desired icons.
STEP 5 : You will find your Launcher Icon. Right Click on it, go to Properties and then to Details ; there you will find dimensions of the image. Note them somewhere.
STEP 6 : Now select the desired Icon and resize it using Windows Image Resizer by right clicking and then clicking on ‘Resize Image’.
STEP 7 : Replace the Icon in extracted folder with the same name.
STEP 8 : Repeat the above steps in ‘ res\drawable-sw800dp-hdpi ‘ and ‘ res\drawable-xhdpi ‘ and ‘ res\drawable-xxhdpi ‘ folders.
STEP 9 : After replacing all the icons, come back to the folder and select all files, right click on them and using 7-Zip add them to an archive, when adding into an archive make sure that you (.zip) by (.apk).
STEP 10: Install the launcher or place it in an Custom Rom. ( I would suggest place this launcher in an Custom Rom )
* All Screenshots, Download links and Custom launcher provided below
IF ANY PROBLEM JUST TELL ME
Thread Closed: 12. Using the work of others. Please see Forum Rules....

How to hack Unity game or .lib based game??

Hey developer/tech enthusiasts i need Your help!
I am a small developer from Bangladesh and i want to learn many things!
I have very small knowledge about .dex file, i can work with it very Limited.
Main point is, i want to hack .so (Shared library file) of Android so that i will do better in future!
Patching dex is impossible for me now, but i know patching .so is easy than it!
So, how to work with it???
I have a windows pc running Core i5 1.9 Ghz Ram 4GB Hard drive 1TB windows version 10.
Please share your though/tutorial of how to hack .so/unity dll file!
Of course, provide me link of tools that i will need to patch them!
I will be greatly thankful to you.
Just help me out!
Regards
Nurujjaman Pollob
:*:Tools Required :*:
(*) Il2cpp Dumper GUI
https://www.andnixsh.com/2018/07/il2cppdumper-gui-104-with-apk-extension.html?m=1
Note :: There Is An Non-GUI Version Available On Github. I Prefer GUI Its Easy To Use.
(*) Dns Spy
https://github.com/0xd4d/dnSpy/releases
(*) Hxd Hex Editor
https://mh-nexus.de/en/hxd
** You Can Use Any Hex Editor You Want To.
(*) 7zip Or Winrar
https://www.7-zip.org/
(*) Notepad ++
https://notepad-plus-plus.org/downloads
(*) Apk Easy Tool
https://forum.xda-developers.com/an...tool-apk-easy-tool-v1-02-windows-gui-t3333960
### Lets Start Modding ###
Step 1: First Download Any Game Apk.
( Im Using Subway Surfers Which Is The Easiest Game To Mod )
These Are Some Sites To Download Apk
apkpure.com
apkmonk.com
apkmirror.com
Step 2: ( We Need Three Files ) Open The Apk File With 7zip/winrar Goto And Extract
1. /lib/armeabi-v7a/libil2cpp.so
2. /assets/bin/Data/Managed/Metadata/global-metadata.dat
3. /assets/bin/Data/Resources/unity_builtin_extra
Create a new folder copy these three files.( Make a additional copy of libil2cpp.so )
Step 3: Open Il2cpp Dumper
-> In The Executable File Select the libil2cpp.so and In global-metadata.dat Select global-metadata.dat
-> Open the unity_builtin_extra file with Notepad++
You Will See Something like this in first line 2018.2.21f1 that's the unity version. Just Enter 2018.2 ( it's version no ) In The "Input unity version" Leave Everything As It Is.
+++ And Start Dumping.
( It Will Create a Dummy dll folder ( Which contains C# code in dll Files ) , Dump.cs [ You Can Open And Search For Functions Using Notepad ++ But Dns Spy is Recommended ]
Script.py for IDA. )
Note :: The Assembly-CSharp.dll Does not contain the Actual C# source code It Has only the function name and offset.
Step 4: We Need One dll File named Assembly-CSharp.dll
-> Open That File With Dns Spy.
-> Search For Functions Like get_coins, get_keys ( Every Game Has Different function so take time to search for it )
and double click on it.
-> You Will See Something Similar [ offset = "0*10C70B8" ] Just copy the offset ( 10C70B8 ) It Has 7bytes.
-> Open The libil2cpp.so file in HXD Hex editor
-> Then Press ctrl+g And Paste The Offset You Have Copied.
Note :: Dont Add Extra Or Remove Anything 1char = 1byte
Note :: For Modifying If it has 8 bytes replace with 8bytes.If not then it will start at different end or start positions and causes the library to break.
MVN R0, #0xB0000000
BX LR - Arm Assembly Code
Note :: You Can Use - armconvertor.com -
to convert from arm opcodes to hex code
( if you have some knowledge in assembly language ).
-> It will give the Hex code - 0B 02 E0 E3 1E FF 2F E1
{** MVN - Move Not
bx - branch and exchange instruction set
lr - holds the return address
#0*B00000000 -> This is the value for
(coins,money,gems,keys)
if we convert it to decimal the value is 2952790016 this is the amount of coins for our game. ** }
-> Then Paste The Hex Code From Where Your Pointer Is.
If it has 16bytes replace with 16bytes.
-> Then Save It.
Step 5: Copy the modified - libil2cpp.so - to the original apk using winrar/7zip
-> Sign The Apk Using Apk Easy Tool.
( Signing is not required for Devices patched by lucky patcher ).
Note :: If there is arm8 or x86 folder inside lib/ folder in apk, delete these folders it is not required.
That's It Done...
Hope This Helps.
Have fun Modding. ??
app does not have libil2cpp
it has
libadcolony.so
libjs.so
libmain.so
libmono.so
libunity.so
which file to dump here
hlp
Arnold_9981 said:
app does not have libil2cpp
it has
libadcolony.so
libjs.so
libmain.so
libmono.so
libunity.so
which file to dump here
hlp
Click to expand...
Click to collapse
then, go for libunity.so
Many thanks for your tutorial Jsonkat
I'm trying to follow your steps but the offsets have 6 bits and not 7.
Following your step is possible to change anything into the game, right?
Could you please be so nice to explain better how to edit "libil2cpp.so"?

Categories

Resources