I used apktool to add arrays.xml file to ContactsProvider.apk and enable Facebook native sync option. All is explained here:
Code:
java -jar apktool.jar d ContactsProvider.apk
Then I've added arrays.xml to /res/values folder builded tha .apk again:
Code:
java -jar apktool.jar b ContactsProvider ContactsProvider.apk
However replacing the original ContactsProvider.apk file gives me a weird error message about gapp process that crashes. I'm on JB 4.1.2 stock. Is this because the old .odex file? If yes, how can I regenerate it?
Hi, I have exactly the same problem. Did you solved it?
Sorry if this is an old topic but... I also have the same problem.
Not solved yet... :crying:
Complete guide on how to Decompile/Recompile Apks with APKTOOL
This Tutorial is for Windows Only
Apktool and all .bat files outlined in this tutorial have been uploaded here for your convenience
Requirements
- 7zip / Winrar (or similar)
- Apktool - (Package link above)
Notes
- I use .bat file to make the whole process alot quicker ...
- Copying Apktool files (aapt.exe, apktool.bat, apktool.jar, baksmali.jar, zipalign.exe) into C:/windows will allow you to use the .bat files anywhere on your computer without the need for apktool in the same directory
Step 1 - First you need to install the framework files so the apktool can use them to decompile other apks in the rom that depend on the framework
- Make a text document and rename it "Install Framework.bat"
- Edit it with a txt editor and paste in this code
Code:
CMD /K apktool if framework-res.apk
- with your framework-res.apk in the folder run the Install Framework.bat file and it should output
Code:
Framework installed to: C:\Users\USER\apktool\framework\1.apk
Step 2 - Decompiling (we will be decompiling framework-res.apk in this tutorial)
- First make a copy of the apk you wish to decompile and name it backup.apk (this will be used later)
- Make a text document and rename it "Decompile.bat"
- Edit it with a txt editor and paste in this code (replace the "framework-res.apk" with the name of the apk you wish to decompile)
Code:
CMD /K apktool d framework-res.apk
- with your apk in the same folder run the Decompile.bat file and it create a folder that you can edit as you see fit
Step 3 - Recompiling (we will be Recompiling framework-res.apk in this tutorial)
- Make a text document and rename it "Compile.bat"
- Edit it with a txt editor and paste in this code (replace the "framework-res.apk" with the name of the apk you wish to recompile)
Code:
del almostdone.apk
CMD /K apktool b framework-res almostdone.apk
- Run the Compile.bat file and it create an apk called almostdone.apk (if you get errors you most likely made a change which broke the apk)
- Open both almostdone.apk and backup with 7zip or Winrar
- Drag all the contents of almostdone.apk except for AndroidManifest.xml into backup.apk and replace existing files
- Now make a text document and rename it "Zipalign.bat"
- Edit it with a txt editor and paste in this code (replace the "framework-res.apk" with the name of the apk you wish to recompile)
Code:
del framework-res.apk
zipalign.exe -v 4 backup.apk framework-res.apk
- Run the Zipalign.bat file and it create the finished apk
Nice one :good:, but i think very few takers in our forum. I was also thinking about posting on ROM Porting, but there are many guides already out there .
yeah ... seems so.... iv'e tryed porting myself ... never got it booting ...
Hello,
In this tutorial I´ll show you how to change the height of your NavBar.
This Tutorial works for any Rom!
Requirements
Text-Editor, e.g. Notepad++
WinRar/WinZip/Bandzip
Apktool (Download)
installed Java (Download)
JDK (Download)
root on your Nexus 4
a FileManager like ES File Explorer or Root Explorer
your framework-res.apk
some Cmd experience (just a little)
.. and some time/nerves
.. let´s go
Before getting started, make a Nandroid Backup (if you get Bootoop etc)!
The decompliling:
First you need to create a new folder like "C:\apktool". Download Apktool and extract the files to C:\apktool
copy your framework-res.apk to C:\apktool
open Cmd
navigate to your apktool (with "cd C:\apktool")
type in: java -jar apktool.jar if framework-res.apk [enter] (...installation of your framework)
type in: java -jar apktool.jar d framework-res.apk [enter]
finished!
Now you should have a new folder named framework-res. That´s your decompiled framework-res.apk.
The customizing of your NavBar height:
Navigate to /res/values
open dimens.xml in your Text-Editor
search the 3 lines which include navigation_bar_height, navigation_bar_height_landscape, und navigation_bar_width
type in your desired dpi number (for default it´s 48dpi)
CAUTION: At width, you should calculate the numeral proportion of the height to the width.
If you got that, save!
The (Re-)compiling:
Cmd (if you have not left it open, you must navigate again to C:\apktool
type in: java -jar apktool.jar b framework-res [enter]
The newly compiled framework-res.apk is located in C:\apktool\framework-res\dist
CAUTION: Copy the META-INF folder and the AndroidManifest.xml from your old framework-res.apk to your newly compiled one! Otherwise you´ll get Bootloop.
Now copy your framework-res.apk with a file manager to /system/framework. After that reboot immediately!
Finished! Have fun with your smaller/higher NavBar.
If there are some question, ask in this thread, I´ll help you as good as possible. Please don´t write me PM´s with support requests.
The "small-print":
Neither XDA-Developers.com, nor me are responible for any damages on your device!
I'm pretty sure this is the same for changing your Navigation Bar white or any color you want?
But instead I think its the navbar.xml that you need to edit correct?
Sent from my Nexus 4 using xda app-developers app
Right. But maybe it's in SysUI.apk, I don't know right now.
~ via Nexus
Flextrick said:
Hello,
In this tutorial I´ll show you how to change the height of your NavBar.
This Tutorial works for any Rom!
Requirements
Text-Editor, e.g. Notepad++
WinRar/WinZip/Bandzip
Apktool (Download)
installed Java (Download)
JDK (Download)
root on your Nexus 4
a FileManager like ES File Explorer or Root Explorer
your framework-res.apk
some Cmd experience (just a little)
.. and some time/nerves
.. let´s go
Before getting started, make a Nandroid Backup (if you get Bootoop etc)!
The decompliling:
First you need to create a new folder like "C:\apktool". Download Apktool and extract the files to C:\apktool
copy your framework-res.apk to C:\apktool
open Cmd
navigate to your apktool (with "cd C:\apktool")
type in: java -jar apktool.jar if framework-res.apk [enter] (...installation of your framework)
type in: java -jar apktool.jar d framework-res.apk [enter]
finished!
Now you should have a new folder named framework-res. That´s your decompiled framework-res.apk.
The customizing of your NavBar height:
Navigate to /res/values
open dimens.xml in your Text-Editor
search the 3 lines which include navigation_bar_height, navigation_bar_height_landscape, und navigation_bar_width
type in your desired dpi number (for default it´s 48dpi)
CAUTION: At width, you should calculate the numeral proportion of the height to the width.
If you got that, save!
The (Re-)compiling:
Cmd (if you have not left it open, you must navigate again to C:\apktool
type in: java -jar apktool.jar b framework-res [enter]
The newly compiled framework-res.apk is located in C:\apktool\framework-res\dist
CAUTION: Copy the META-INF folder and the AndroidManifest.xml from your old framework-res.apk to your newly compiled one! Otherwise you´ll get Bootloop.
Now copy your framework-res.apk with a file manager to /system/framework. After that reboot immediately!
Finished! Have fun with your smaller/higher NavBar.
If there are some question, ask in this thread, I´ll help you as good as possible. Please don´t write me PM´s with support requests.
The "small-print":
Neither XDA-Developers.com, nor me are responible for any damages on your device!
Click to expand...
Click to collapse
Thanks dude!
"CAUTION: At width, you should calculate the numeral proportion of the height to the width."
What's the scale? I set 36dpi both on height and landsape_hight, what's the width should I do? And I want the background of navigation to more smaller...
First of all, please delete fullquote Second: Proportion is like 48:42=36:x (x is width, just calculate). And third: Which background do you mean?
~ via Nexus
Hello,
if somebody is interested: I built a graphical Apktool for easier modding. Check it out: http://forum.xda-developers.com/showthread.php?t=2326604
~ via Nexus
I am attempting this but its not working.
I have apktool, java, and JDK installed.
When I run the commands I get this...
Code:
c:\apktool>java -jar apktool.jar if framework-res.apk
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources:
spec=0x01080294 drawable/ic_ab_back_holo_dark, config=-xhdpi
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:196)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165
)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:10
5)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:39)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:384)
at brut.androlib.Androlib.installFramework(Androlib.java:365)
at brut.apktool.Main.cmdInstallFramework(Main.java:193)
at brut.apktool.Main.main(Main.java:69)
c:\apktool>java -jar apktool.jar d framework-res.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources:
spec=0x01080294 drawable/ic_ab_back_holo_dark, config=-xhdpi
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:196)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165
)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:10
5)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibRes
ources.java:315)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.jav
a:50)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.jav
a:43)
at brut.androlib.Androlib.getResTable(Androlib.java:44)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
c:\apktool>
Any help would be great.
Or if someone wants to set my dpi to 24 that would be great as well. 24/24/24
framework-res.apk
Hello, I see. Maybe you should try this one here: http://forum.xda-developers.com/showthread.php?t=1755243
I created an AndroidApktool, which makes it easier to mod your files: http://forum.xda-developers.com/showthread.php?t=2326604
It helps you in this Tutorial much, too.
How do you move the old META-INF folder and AndroidManifest.xml into the new apk after it's already compiled?
With WinRar or 7zip etc.
I followed every step and I end up with same as paperecho, empty framework-res folder.
Do you get the same error as he?
Is it possible to set the alignment of the softkeys to the left side (especially for the Nexus 7/10)?
Thanks in advance
Sent from my Nexus 4 using xda premium
It's possible for sure, but I don't know how. Ive got no experience with tablets, sorry.
I'm also finished with empty folder framework-res..
Maybe you guys should download the newest apktool version and replace it with the one in my folder. I think this should solve your problem
Does anyone know what values they use to make the softkeys stay vertical when the phone is in landscape mode? I'm trying to do that with my tablets. Thanks
Works Great Nexus 4 and Nexus 10 Kitkat
In Android L, it didn't work in type in "java -jar apktool.jar if framework-res.apk" & "java -jar apktool.jar d framework-res.apk"...
Hello everyone.
I want to share to you all latest ApkTool in a zip
Download : here
What's inside?
- Apktool v 2.0.0b9 > Source : https://code.google.com/p/android-apktool/
- BakSmali & Smali v2.0.3 > Source : https://code.google.com/p/smali/downloads/list
- SignApk from CM Signer
REQUIREMENTS :
- BRAIN
- Running Windows
- Java V7 here
How to use?
1. Open Command Prompt in the tool
2. List of Command:
> Install framework
Code:
apktool if framework-res.apk
> Decompile apk
Code:
apktool d name_of_apk.apk
or
Code:
apktool d -f name_of_apk.apk
> Compile apk
Code:
apktool b folder_of_apk
> Sign apk
Code:
signapk name_of_apk.apk name_of_apk_signed.apk
> Baksmali
Code:
java -jar baksmali-2.0.3.jar -o classout/ classes.dex
or
Drag and Drop classes.dex from file.jar to Quick-Baksmali
> Smali
Code:
java -Xmx512M -jar smali-2.0.3.jar classout/ -o new-classes.dex
or
Drag and Drop classout to Quick-Smali
K_TECH said:
Hello everyone.
I want to share to you all latest ApkTool in a zip
Download : here
What's inside?
- Apktool v 2.0.0b9 > Source : https://code.google.com/p/android-apktool/
- BakSmali & Smali v2.0.3 > Source : https://code.google.com/p/smali/downloads/list
- SignApk from CM Signer
REQUIREMENTS :
- BRAIN
- Running Windows
- Java V7 here
How to use?
1. Open Command Prompt in the tool
2. List of Command:
> Install framework
Code:
apktool if framework-res.apk
> Decompile apk
Code:
apktool d name_of_apk.apk
or
Code:
apktool d -f name_of_apk.apk
> Compile apk
Code:
apktool b folder_of_apk
> Sign apk
Code:
signapk name_of_apk.apk name_of_apk_signed.apk
> Baksmali
Code:
java -jar baksmali-2.0.3.jar -o classout/ classes.dex
or
Drag and Drop classes.dex from file.jar to Quick-Baksmali
> Smali
Code:
java -Xmx512M -jar smali-2.0.3.jar classout/ -o new-classes.dex
or
Drag and Drop classout to Quick-Smali
Click to expand...
Click to collapse
PERTAMAX
Waiting K_TECH TOOL .....
K_TECH said:
Hello everyone.
I want to share to you all latest ApkTool in a zip
Download : here
What's inside?
- Apktool v 2.0.0b9 > Source : https://code.google.com/p/android-apktool/
- BakSmali & Smali v2.0.3 > Source : https://code.google.com/p/smali/downloads/list
- SignApk from CM Signer
REQUIREMENTS :
- BRAIN
- Running Windows
- Java V7 here
How to use?
1. Open Command Prompt in the tool
2. List of Command:
> Install framework
Code:
apktool if framework-res.apk
> Decompile apk
Code:
apktool d name_of_apk.apk
or
Code:
apktool d -f name_of_apk.apk
> Compile apk
Code:
apktool b folder_of_apk
> Sign apk
Code:
signapk name_of_apk.apk name_of_apk_signed.apk
> Baksmali
Code:
java -jar baksmali-2.0.3.jar -o classout/ classes.dex
or
Drag and Drop classes.dex from file.jar to Quick-Baksmali
> Smali
Code:
java -Xmx512M -jar smali-2.0.3.jar classout/ -o new-classes.dex
or
Drag and Drop classout to Quick-Smali
Click to expand...
Click to collapse
Is this your work bro? I'd been using this one since i started modifying .apk files Advanced ApkTool v2.0.0 for Windows. It's very easy to use
dec0der said:
Is this your work bro? I'd been using this one since i started modifying .apk files Advanced ApkTool v2.0.0 for Windows. It's very easy to use
Click to expand...
Click to collapse
Yep, this is my work
K_TECH said:
Yep, this is my work
Click to expand...
Click to collapse
Ok, well done! I'll try it sometimes :good:
can you tell how can I use this jar file because there no place where you can put your apk to decompile. or can you create the tool to decompile apk like previous apk tool.
faizan.rupani said:
can you tell how can I use this jar file because there no place where you can put your apk to decompile. or can you create the tool to decompile apk like previous apk tool.
Click to expand...
Click to collapse
Just take classes.dex inside file.jar... then drag & drop in Quick-Baksmali
Thanks Om :good: I try this one tool
nice work sir
Lewa,Miui,Colour OS,Aosp and another roms porting tutorial MT6582 to MT6582
It is very Hard
Requirements :
*Windows XP/7/8
* 7-Zip
* Notepad++
* Java Jdk
* Cygwin
* Boot.img Unpack/Repack Tools or Android
kitchen
* Stock ROM
*Port RomRom
[N.B : There are two type roms
1. Stock rom [ orginal rom from your
mobile ]
2. Port rom [ Whichever you want to port
rom ]]
*SO NOW PORTING START
+ Replace it from your stock rom to the port
rom
[ FOLDER & FILE TO REPLACING ]
*system/etc/firmware
*system/etc/permission/platform.xml
*system/etc/permission/
handheld_core_hardware.xml
*system/lib/hw
*system/lib/modules
*system/lib/ libaudio.primary.default.so
*system/lib/ libcamdrv.so
*system/lib/libcamalgo.so
*system/lib/libcameracustom.so
*system/lib/libdpframework.so
*system/lib/ libsensorservice.so
*system/lib/libvcodecdrv.so
*system/lib/libsync.so
*system/usr/keylayout
[ FIXING PROBLEM ]
Sim card problem :
*system/bin
SD Card Problem :
*system/etc/vold.fstab
*system/etc/vold.fstab.nand
Camera Focus Problem :
*system/lib/libcameraservice.so
[NB:These step not required for Walton
Primo GF,GH,GH+ & GH2]
Boot loop problem :
*system/lib/libandroid_runtime.so
*system/lib/libandroid_servers.so
*system/lib/libmedia_jni.so
Other Problem :
*system/etc/dhcpcd
*system/etc/permissions
*system/etc/security
*system/etc/audio
*system/etc/bluetooth
*system/etc/wifi
*system/lib/drm
*system/lib/egl
*system/lib/soundfx
* Now open build.prop in notpad++ and change your language.
English user :
ro.product.locale.language=en
ro.product.locale.region=US
* Replace the stock boot.img to port rom
* Unpack Boot.img (Both) then open init.rc (Both) and find these line....
on early_property:ro.build.type=user
write /proc/bootprof "INIT: user build setting"
export BOOTCLASSPATH /system/framework/
core.jar:/system/framework/core-junit.jar:/
system/framework/bouncycastle.jar:/system/
framework/ext.jar:/system/framework/
framework.jar:/system/framework/telephony-
common.jar:/system/framework/mms-
common.jar:/system/framework/
android.policy.jar:/system/framework/
services.jar:/system/framework/apache-xml.jar:/
system/framework/mediatek-common.jar:/
system/framework/mediatek-framework.jar:/
system/framework/secondary-framework.jar:/
system/framework/CustomProperties.jar:/system/
framework/mediatek-telephony-common.jar:/
system/framework/mediatek-op.jar
on early_property:ro.build.type=userdebug
write /proc/bootprof "INIT: userdebug build
setting"
export BOOTCLASSPATH /system/framework/
core.jar:/system/framework/core-junit.jar:/
system/framework/bouncycastle.jar:/system/
framework/ext.jar:/system/framework/
framework.jar:/system/framework/telephony-
common.jar:/system/framework/mms-
common.jar:/system/framework/
android.policy.jar:/system/framework/
services.jar:/system/framework/apache-xml.jar:/
system/framework/mediatek-common.jar:/
system/framework/mediatek-framework.jar:/
system/framework/secondary-framework.jar:/
system/framework/CustomProperties.jar:/system/
framework/mediatek-telephony-common.jar:/
system/framework/mediatek-op.jar
on early_property:ro.build.type=eng
write /proc/bootprof "INIT: eng build setting"
export BOOTCLASSPATH /system/framework/
core.jar:/system/framework/core-junit.jar:/
system/framework/bouncycastle.jar:/system/
framework/ext.jar:/system/framework/
framework.jar:/system/framework/telephony-
common.jar:/system/framework/mms-
common.jar:/system/framework/
android.policy.jar:/system/framework/
services.jar:/system/framework/apache-xml.jar:/
system/framework/mediatek-common.jar:/
system/framework/mediatek-framework.jar:/
system/framework/secondary-framework.jar:/
system/framework/CustomProperties.jar:/system/
framework/mediatek-telephony-common.jar:/
system/framework/mediatek-op.jar:/system/
framework/emma.jar
** Now replacing these line Form port Boot.img to Stock Boot.img
* Then Repacke boot.img and built a new boot.img
[# Camera Drive problem fixing]
* Again Extract the boot.img for android kitchen
[ Both stock & port boot.img]
* and open init.rc/# camera
* Find these missing line port to stock
boot.img and whole missing line paste it
( #Camera )
Example :
#Camera
chmod 0660 /dev/camera-sysram
chmod 0660 /dev/camera-isp
chmod 0660 /dev/camera-pipemgr
chmod 0660 /dev/kd_camera_hw
chmod 0660 /dev/kd_camera_flashlight
chmod 0660 /dev/kd_camera_hw_bus2
chmod 0660 /dev/FM50AF
chmod 0660 /dev/OV8825AF
chmod 0660 /dev/OV88252AF
chmod 0660 /dev/OV8850AF
chmod 0660 /dev/CAM_CAL_DRV
chown system camera /dev/camera-sysram
chown system camera /dev/camera-isp
chown system camera /dev/camera-pipemgr
chown system camera /dev/kd_camera_hw
chown system camera /dev/
kd_camera_flashlight
chown system camera /dev/
kd_camera_hw_bus2
chown system camera /dev/FM50AF
chown system camera /dev/OV8825AF
chown system camera /dev/OV88252AF
chown system camera /dev/OV8850AF
chown system camera /dev/CAM_CAL_DRV
* Now repack boot.img
* Open the Port rom folder go to META-
INF/google/Android / and open updater-script
in Notpad++
And change these line.......
[mmcblkOp3 ----- mmcblkOp9]
[ Example for WALTON PRIMO GH2
[mmcblkOp6]]
* Now go to back the folder of port rom and
you will see two folder and one file name
+ META-INF
+ system
+ boot.img
* Now select these 2 folder 1 file and click
right mouse button and click on 7zip ->>
add to archive
* Now a dialouge box should
appear!
* Configure the Format like This:
Archive format: ZIP
Compression Level : Normal
Compression Method: Deflate
Dictoioany Size: 32k
Word Size 32
* Now Start Zipping and Push the
ZIP to your Memory Card
* Go to Recovery >> Install ZIP &
Wipe Data
Finished!!
_______________A.S.NOMAN KHAN
Continous bootloop
sir,i tried lewa os for Symphony H100 ,from Walton Primo R3 kitkat. i tried with stock boot image then patched boot image then patched boot image + 3 files you mentioned for bootloop ,every time there is bootloop. boot animation ends and starts again .please help......................
port any best rom for lava iris 405+
Sent from my iris405+ using xda app-developers app
Nice guide bro...
Sent from my Android One using XDA Free mobile app
Good bro
thanks