[GUIDE/TOOL] Make a new odex file (1by1_ReOdexer batch file) - Android

WHAT IS THIS, AND WHAT IS IT FOR?
This is a guide for creating a new odex file from a deodexed file, one at a time – manually, or with the tool provided. There are tools/methods for doing the entire system at once, but I have not had any luck with those. Plus, typically, one does not need the entire system re-odexed. This is more for those who want to personally mod their stock odexed systems, or create an odexed ROM maybe.
For starters, you can get away with modding a lot on an odexed system, without needing to deodex. You really only need to deodex in order to edit the smali files within the classes.dex (which is required to achieve the cooler mods). See cogeary’s great guide for deodexing tips.
-------------------------
MANUAL METHOD:
I will use the services.jar in this example. Just change the file name and path to existing .odex accordingly for other files. (thanks! to jhotmann for helping me to nail down this method)
Requirements:
odexed system
root
adb
busybox installed
dexopt-wrapper
Put this dexopt-wrapper file in /system/bin with 775 permissions:
X X X
X....X
X....X
Put the deodexed services.jar (or other jar/apk file you want to make a new odex of) on the root your /sdcard (on some phones that means internal storage).
Make sure USB Debugging is enabled.
Put your USB connection to MTP or PTP mode.
The bootclasspath is located in the /init.rc file at the root of your phone. Just make sure that all jars listed in init.rc are actually in your /system/framework folder and only include those in your bootclasspath in the command below. The one from Moto A2/Razr/other ICS is used below (minus the extra jar paths). To replace it with that of a different device, change the word bootclasspath with yours, using the path style as shown in the example below: dexopt-wrapper services.jar new.odex bootclasspath...
Connect with adb (do a adb devices check to make sure you're all good).
To create the new odex, enter the following one line at a time:
Code:
adb shell
su
cd /sdcard/
dexopt-wrapper services.jar new.odex /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework-ext.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar:/system/framework/com.motorola.android.frameworks.jar:/system/framework/com.motorola.android.widget.jar:/system/framework/com.motorola.frameworks.core.addon.jar
To copy the signature from the existing odex (change path to /system/app/.. if necessary):
Code:
busybox dd if=/system/framework/services.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
Done! Rename new.odex (created on your /sdcard) to services.odex since that is your new signed odex file... and move to your phone using the method of your choice.
---------------------
SCRIPT METHOD (using the 1by1_ReOdexer):
I made this script to speed up the process a little bit (thanks! to jimbridgman and cogeary for their input). Note: This will not hurt your phone if you are on an odexed system and just want to play around with it…
Requirements:
Windows OS (for now – Linux coming soon)
odexed system
root
busybox installed
DOWNLOAD the 1by1_ReOdexer_v1.0.zip for Windows
Unzip it on your desktop or other convenient place (with no spaces in the file path)
Place the DEODEXED file you wish to make an odex out of on your /sdcard
Make sure you have busybox installed (in /system/bin or /xbin)
MAJOR NOTE: The script is currently set up based on the SystemUI.apk/.odex and Motorola’s ICS bootclasspath.
To change the file name/path and/or the bootclasspath, right-click on the .bat file and open with a text editor (preferably something like Notepad++) and edit accordingly for the proper path to the apk/jar and odex. The bootclasspath was taken from /init.rc minus the jars that are not in /system/framework.
Connect to PC in MTP or PTP usb mode
Make sure usb debugging is enabled
Double-click 1by1_ReOdexer.bat to begin.
Here’s a successful screenshot (look for the bytes transferred to confirm it worked):
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
When finished you should have a new.odex file on your /sdcard.
CHANGE LOG:
8/25/12 (v1.0)
-initial release
Thanks to the following for testing!:
-DX2Trip on the A2 ICS
-RETIEF on the RAZR Maxx ICS
-iwabashu on the RAZR ICS
(I tested it on GB - but I am not high-fiving myself )
-----------------
Some vague notes on what to do next:
Depending on what you are after by re-odexing, there are different routes. For example, if you only edited or copied smali files, then you only need the new.odex file. Meaning that all of the smali code was inside of that classes.dex of the deodexed file on your sdcard, and you just made that into a new odex file (and copied the signatures from the existing .odex in /system).
If you have a deodexed apk with more edits than just smali (you could really just copy those edits over to your existing odexed apk with 7-zip or similar), but – if you want to, you will need to remove the classes.dex from the deodexed apk, and make sure that the signatures (/META-INF folder) and AndroidManifest.xml are the same as your existing apk (check, and or copy with 7-zip or similar).
.
.
.

It worked! I have new.odex on the /sdcard! But it is significantly smaller than the original Mms.odex. 1.08mb compared to 1.21mb. Will there be a problem? Do I now change new.odex to Mms.odex and push it to system/app with the same permissions as the original one??

daveyannihilation said:
It worked! I have new.odex on the /sdcard! But it is significantly smaller than the original Mms.odex. 1.08mb compared to 1.21mb. Will there be a problem? Do I now change new.odex to Mms.odex and push it to system/app with the same permissions as the original one??
Click to expand...
Click to collapse
Thanks for trying! - I see another method also worked for you.. what was the size of the resulting odex created by that method? But, it should be no problem with the smaller size - all of my new odex files were smaller also and worked fine. I believe the process just compresses the new odex more.
And, yes, you would rename it and replace your existing with the same permissions. Good luck!
Sent from my phone's mind

links broken
Dude I want to do it...but your links are broken.

i need help
i'm trying to re-odex services.jar and i'm getting process failed error
what seems to be the problem ?

Thanksfor info
Thanks for this info but links do not seem to be working

The best tutorial for editing/creating .odex files. Thanks a lot for this!

Help me please
Hi, I have Huawei Phone, to be specific, here are the short spec:
Honor 4C
Android 5.1.1
ROOTED
My concern now is, I really don’t like the Stock Music Player ( V7.1.12 ) its because it does not support online music streaming and downloading, but I have an old version of it ( V6.10 ) which is it support online streaming and downloading. I really want to replace my system music app to my old version, just like before. By the way, before I update my phone to lollipop, my OS is Kitkat ( obviously ) and was able / successfully replace my stock music player to my old version, but now I can't even do it in lollipop. I tried several times to replace and update it, but it result boot problem, my phone needs to reflash OS and root again and again, Im tired of that ( honestly ). Im afraid my phone will go to trash if do it again.
I search on the google and found out about .odex file ( something like that ) I also check my stock player directory and found HwMediaCenter.odex under system/app/arm64.. so. I am wondering if someone can help me create .odex file out of my old version of music player, so that I can replace both APK and ODEX file in my system and use old version again
THANK YOU SO MUCH!
[email protected]

Related

[HOWTO] Make a skin for your tattoo.

Hi,
This is a tutorial to explain how to make a theme with some APKs modified.
Note : This HOWTO is for people who have a minimum knowledge in informatic, i will not answer to questions like "what's a CMD?" etc.
FACULTATIVE STEP
The first thing we have to do, it's set up a working folder, this will help you to make your theme easily
Create a folder "Skin blabla", like you want.
After, create 3 folders like this screen :
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
We will make a backup of ALL APKs of your tattoo (if you do a wrong modification & you brick), make a copy of this backup into "Modded APKs" (there will be the modified APKs), and "Decompressed" will be the folder which has all PNGs.
SOME EXPLICATIONS
The only risk is Android, all APKs which are using on android have to be signed, if one of your APKs isn't signed, you will semi-brick your Tattoo and have to go on recovery and push the original APK.
Note : You have to have (woh) a custom recovery, if you don't and you semi-brick your tattoo, the only way to restart it is the GOLDCARD.
So, the only way to keep your APK signed is to use the drag&drop.
FIRST STEP : Backup
Connect your device. (with USB debug)
Open a CMD.
(We say your skin's folder is on c:\Skin to make it simple, if you choose an other destination, change what i have writed after)
adb shell pull /system/app/*.apk "c:\Skin\Original APK"
adb shell pull /system/framework/*.apk "c:\Skin\Original APK"
copy "c:\Skin\Original APK\*.apk" "c:\Skin\Modded APK"
You can delete the APKs you will never modify on Modded.
It's finished, we can start
SECOND STEP : Drag & Drop
I'm using WinRAR.
Like i said before, we have to keep our APKs signed.
Select which APKs you want to modify of "Modded" folder, right click, and select "extract...".
Select "Decompressed" folder, and extract all APKs.
You will have many folders with the name of which APK. (Rosie, framework-res, etc etc)
Modify all PNGs you want to modify on which folder. (Note : All images are on res/drawable*)
Then, return on modded folder, open which APKs you modified on the other folder, and open framework-res.apk for example, let the APK open with WinRAR. Open "Decompressed"s folder, select some folders/PNGs you have modified (we will select "drawable" for example), drag&drop it in WinRAR. (of course, you have to be on /res folder in winRAR, the folder have to match...)
Copy the modified APK with : adb push blabla.apk /system/originaldirectoryoftheapk
Some advices
- All notifications icons are on framework-res.apk & com.htc.resources.apk.
- The only APKs which are on /system/framework/ are the both APKs one line before. All others are on /system/app/.
- Rosie.apk is HTC Sense.
- Some notifications icons are on Calendar.apk (1), HtcContacts.apk (1), HtcLocationService.apk (1), HtcMusic.apk (2+), HtcTwitter.apk (1), Mail.apk (1), Mms.apk (1+), Talk.apk (1).
- If you modify Rosie.apk, or some others APKs, Sense will be strange, wait or reboot the device.
- ...
Hi JoOoSs
I have modified Browser.apk, but when I try
Code:
adb push Browser.apk /system/app/Browser.apk
I receive the next message:
Code:
failed to copy 'Browser.apk' to '/system/app/Browser.apk': Out of memory
Also, before this I was receiving this message:
Code:
failed to copy 'Browser.apk' to '/system/app/Browser.apk': Directory not empty
Any ideas about what could be the problem?
Thanks!
It's a problem with your ROM.
Modaco ? Fyodor ? Stock ?
I have the MoDaCo ROM, the weird thing is that yesterday I installed your Black skin, and today I tried to do it again and have the above errors.
At each reboot you have to do:
adb shell
insmod /system/lib/modules/tattoo-hack.ko
mount -o rw,remount /dev/block/mtdblock3 /system
JoOoSs said:
At each reboot you have to do:
adb shell
insmod /system/lib/modules/tattoo-hack.ko
mount -o rw,remount /dev/block/mtdblock3 /system
Click to expand...
Click to collapse
Actually, I did it.
I've noticed something really weird. I flashed a fresh ROM (MoDaCo), then I pushed your files (from Black Skin) and some mine, everything worked perfect. But, later, when I try to push another file (yours or mine), I get this error:
Code:
adb push WorldClock.apk /system/app/WorldClock.apk
failed to copy 'WorldClock.apk' to '/system/app/WorldClock.apk': Directory not empty
I don't know what is happening
I think you lose the RW when you exit your CMD, did you retry to mount /system ?
If it's yes, i don't know it works in my Modaco Oo
Thanks JoOoSs
I don't know why this was happening, but I installed the stock ROM and everything works perfect know! Regards!
It would be nice to have default android skin on our tattoo. Do you think is it possible?
Yep, you have to flash 2.1 ROM which is on Dev forum, backup all PNG from his ROM & re-insert them on an other ROM.
JoOoSs said:
Yep, you have to flash 2.1 ROM which is on Dev forum, backup all PNG from his ROM & re-insert them on an other ROM.
Click to expand...
Click to collapse
Actually, you don't need to flash the 2.1 rom, remember that is a .zip, so just extract the apps from /system/app directory and then extract the pngs...
In the zip there are only the *.img ?
We have to uncompress boot.img etc it's more long!
So...what we could do to have a default 2.1 lock screen and skin and nothing else?
Please help us poor noobs
JoOoSs said:
In the zip there are only the *.img ?
We have to uncompress boot.img etc it's more long!
Click to expand...
Click to collapse
Not really, I downloaded the update.zip file from the 2.1, and it doesn't have .img files... I've changed all my apps icons using the 2.1 version.
Is there anyone that can answer to my ask?
HTCDevil said:
Is there anyone that can answer to my ask?
Click to expand...
Click to collapse
Hi, actually, change all the skin and the lock screen is going to be almost impossible, I changed all the main apps icons, but the skin itself is more complex, we have to go through all system APKs and find the png files related with the skin, but even doing that the change is complex.
This is how my icons looks like:
Can you upload icons & the wallpaper ?
yes, wallpaper please
Thank you arturo
I'd like also the only white bar rather than black
APKs with eclair icons and wallpaper
Hello all,
Here are the modified apk files with the eclair icons and also a nice wallpaper.
I highly recommend to do a nandroid backup before replace the apk files (we never know ).
APKs: http://www.megaupload.com/?d=GG7LPC9C
Enjoy it!

[TUTORIAL] How to unpack Android ROMs on Windows

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
As all of you well know, Android is an open source operating system and as such the development and modding are the bread and butter for devices with this OS.
In this thread I'll explain how to extract the firmware partition containing the operating system and programs with a Windows PC.
The purpose of this thread is to share knowledge, so feel free to help me to dump device such as Acer, Samsung and Sony Ericsson, expecially I need someone that help me with Acer's .bin
1. Unpack the system partition from an HTC ROM
What you need:
UniExtract: http://legroom.net/software/uniextract (freeware)
ZipScan: http://www.zipscan.co.uk/ (shareware)
Cygwin: http://cygwin.org/setup.exe (freeware)
Unyaffs for Windows: http://goo.gl/z6yI
Download and install all the tools (Unyaffs it's a prompt executable, so it isn't installable)
Now you need an HTC ROM, download one at your pleasure from Conflipper's site: http://www.shipped-roms.com/shipped/
Once you have downloaded it, right click on the ROM executable and select Extract with UniExtract in the subfolder (v.fig1), select Isxunpack extraction and then clik on the OK button (v. fig2)
Now in the subfolder you have the various files which make up the executable, including data1.cab which is the file that we are more interested in (do not delete other files).
Open ZipScan, go to File -> Open Archive File... and browse until select the data1.cab. You should see something like this:
Extract from the cab only the ROM.zip and open this file with any archives extraction software (eg WinRAR or the same ZipScan). Inside you have various .img files which make up the ROM, but for the purposes of this guide, we need only the system.img.
Copy in a blank folder this file, unyaffs.exe and cygwin1.dll (you'll find it in C:\Cygwin\Bin).
Now open Cygwin from Start -> All Programs to ensure that its functions are integrated to the Windows Prompt and close it.
Open the Windows Prompt (Start -> All Programs -> Accessories) and position yourself in the folder containing the files using the cd command or alternatively install this .reg which allow you to open the Windows Prompt in the chosen folder by command in the context menu (Right click on the folder -> Command Prompt Here).
Now the last thing that you have to do is to give the extraction command: unyaffs system.img
Et voilà, now you have the folders containing the extracted system.
Enjoy
2. Unpack the system partition from a Motorola ROM
°°°Coming Soon°°°
°°°reserved°°°
°°°2nd reserved°°°
°°°3rd reserved°°°
Thank you! I had found a different way but this will save some steps.
mark
i will see
!!!!!!!!!!!!!!!!111
Someone once told me you can just run the .exe file, let it open, use windows to search for the rom.zip that would have been extracted into a temp folder, drag&drop to another location, then cancel the .exe again.
Haven't tried this myself though.
What else can you show us in windows?... Is it at all possible to extract ramdisc thingies from kernels so we can apply one custom kernel to other roms ourself?
... or should I bite the bullet and install/learn how to use ubuntu?
Nice initiative. Finish the guides and I'll see to it that it's stickied.
ddotpatel said:
Is it at all possible to extract ramdisc thingies from kernels so we can apply one custom kernel to other roms ourself?
... or should I bite the bullet and install/learn how to use ubuntu?
Click to expand...
Click to collapse
There are simple perl scripts kicking about to unpack/pack boot.img, so you can use them on Windows as long as you install perl first - say either via Cygwin or Active State.
I just used WinRAR to do everything that UniExtract and ZipScan can do.
...so basically you showed me that system.img can be unpacked using the linux command-line utility UnYaffs.exe, which can be run through CygWin. Thanks.
Why doesn't someone make a UnYaffs.exe for windows command line?
After I change things, how to I ReYaffs it to system.img? ...and when I re-zip it don't I have to sign it or something? If I modify an apk do I have to deODEX it first? Do I reODEX after?
I would love a quick tutorial on, say, how to change an icon for an app. Something that shows people who already know how to do this type of stuff a brief step-by-step guide to taking a [ROM], adding and deleting a few apks inside it, making a graphical change to an apk inside it (skinning), and then recooking those changes in to a new [ROM] to be shared with all.
rpmccormick said:
I just used WinRAR to do everything that UniExtract and ZipScan can do.
...so basically you showed me that system.img can be unpacked using the linux command-line utility UnYaffs.exe, which can be run through CygWin. Thanks.
Why doesn't someone make a UnYaffs.exe for windows command line?
After I change things, how to I ReYaffs it to system.img? ...and when I re-zip it don't I have to sign it or something? If I modify an apk do I have to deODEX it first? Do I reODEX after?
I would love a quick tutorial on, say, how to change an icon for an app. Something that shows people who already know how to do this type of stuff a brief step-by-step guide to taking a [ROM], adding and deleting a few apks inside it, making a graphical change to an apk inside it (skinning), and then recooking those changes in to a new [ROM] to be shared with all.
Click to expand...
Click to collapse
No ****... I was wondering why he's making it all so complicated with all these extra tools when I can click the file in Winrar (extract to...) and be done. All in ONE step for me.. LOL
For me it was more than one step because using WinRAR on system.img didn't get all the files out. Using unyaffs did. But now I have a system.img from a new Android tablet and I can't get anything out of it other then the META-INF directory using WinRAR, Unyaffs, or UniExtract. Anyone have any clue how to get in to those?
...and I still want an easy tutorial on how to re-assemble a flashable system.img / update.zip once I change some stuff in there.
I really hope one of those reserved spots is for the newer Samsung phones. What really cheeses me, though, is that I had that explained to me once, and I can't find it, and didn't write it down
I've compiled both unyaffs.exe, mkyaffsimage and mkyaffs2image for cygwin, with the DLL you can use them on Windows too. Sadly, I don't know too much about C and C++, so I can't make it work, but maybe I will try to compile them for Windows, and with some bugfixing, MAYBE it will run.
Samsung did not use the usual yaffs image (for Galaxy S at least), but their own format, what can be easily extracted. I will post some more about it as soon as I get back to windows, recompile the executables and upload them.
i wana extract boot.img , but i have some error
$ gunzip -c boot.img | cpio -i
bash: cpio: command not found
gzip: boot.img: not in gzip format
Click to expand...
Click to collapse
I had some problems with unyaffs. This version posted on 1st page is bugy, if you have same problem try...
hmmm i have i more problem: To prevent spam to the forums, new users are not permitted to post outside links in their messages.
so sry guys i can't help you right now
rpmccormick said:
i just used winrar to do everything that uniextract and zipscan can do.
...so basically you showed me that system.img can be unpacked using the linux command-line utility unyaffs.exe, which can be run through cygwin. Thanks.
Why doesn't someone make a unyaffs.exe for windows command line?
After i change things, how to i reyaffs it to system.img? ...and when i re-zip it don't i have to sign it or something? If i modify an apk do i have to deodex it first? Do i reodex after?
I would love a quick tutorial on, say, how to change an icon for an app. Something that shows people who already know how to do this type of stuff a brief step-by-step guide to taking a [rom], adding and deleting a few apks inside it, making a graphical change to an apk inside it (skinning), and then recooking those changes in to a new [rom] to be shared with all.
Click to expand...
Click to collapse
+1000
.
WinImage can extract the .img.
Unfortunately, I don't think it can repack them properly.

[TUTORIAL]Guide to resizing apps to QVGA[STEP BY STEP]

Ok so a lot of you guys have been requesting a resizing tutorial so you can all help out on the new fresh roms like thenextsense and senseonfire.
Everyone gets directed to http://forum.xda-developers.com/showthread.php?p=6739512#post6739512 and get all confused because it doesn't actually explain much so I decided to post one written by me (I resize things in my rom, senseonfire)
Note: I am using linux Operating System and resizing to my HTC wildfire.
First off you are going to want to download apktool and the dependences for your operating system. It runs on windows, linux and mac OSX so it won't matter what OS you are running, you will be able to use it.
Once you have got apktool installed you are going to open terminal (or command prompt on your windows)
You are then going to navigate to the directory you installed apktool into:
Code:
cd /install...dir../apktool
Once that is done you are going to look at the rom that contains the app you are about to resize. You are going to open the rom archive and navigate to the framework
Code:
/system/framework/
and extract any files ending in .apk to the apktool dir
You are going to go back to the open terminal and type in
Code:
./apktool install-framework extracted_framework_filename.apk
or if you are on a windows computer
Code:
apktool install-framework extracted_framework_filename.apk
This will install the framework file/s so apktool can decompile stock apps correctly.
Once it installs correctly you are then going to choose the app you are going to resize. For the sake of this tutorial I am going to resize HtcMusic.apk
Navigate to the app folder in the rom archive
Code:
/system/app
and extract HtcMusic.apk to apktool dir
Then you are going to decompile the app to start resizing
In the still open terminal you are going to type
Code:
./apktool d HtcMusic.apk
This will decompile the htcmusic to a folder in the apktool dir called HtcMusic
To make resizing easier you should grab your phone and open HtcMusic and see what needs resizing. Now this is where the trial and error comes in.
Navigate to the layout folder in HtcMusic
Code:
/res/layout
or
Code:
/res/layout-mdpi
and choose the .xml file you believe you are looking at on your phone screen. For example on the HtcMusic app if you are resizing the playback screen it would be audio_player.xml that you would have to edit.
Play with things that have sizes (y.y px) especially things that say layout_width=y.y px... change the y value to something smaller.
If there is something that has a value @dimen/... it means that the value is in the dimens.xml in the /res/values folder
If there is something that has a value @com.htc:dimen/... it means that the value is in the dimens.xml in the com.htc.resources.apk
Once you finish the changes you are going to have to recompile the app
Go back to the terminal app that you still should have open (if you don't you will have to open it and cd to the apktool dir)
type in this code (make sure you delete the HtcMusic.apk out of the apktool directory prior to doing this)
Code:
./apktool b HtcMusic HtcMusic.apk
if you get an error and you are on linux try this
Code:
sudo ./apktool b HtcMusic HtcMusic.apk
sudo chown [your username] HtcMusic.apk
Once you finish this you will have to sign your apk. The easiest way to do this is to use dsixda's kitchen's signing tool.
Once this is done you can either push the app to your phone using adb (this never works for me)
Code:
./adb push HtcMusic.apk /system/app
if that doesn't work
Code:
./adb remount rw
./adb push HtcMusic.apk /system/app
But if that causes HtcMusic to disappear like it did to mine you will have to use dsixda's kitchen to open the rom, add htcmusic, sign all apps, and cook the rom again, then flash it on your phone.(I will not type out how to do this, there are lots of threads on how to use the kitchen)
Actually you can do it a lot easier than flashing the whole ROM again. I will post how to do this soon [28/6/12]
Open the app and look what has changed (if any) and then try again till you get it right. Trust me it takes a long while to get it right so don't expect for it to be right on your first go
Oh and if this helped you hit thanks!
APK Manager
There is an app called APK Manager that will make this easier i think it is just for windows but i don't know there might be a linux version
if this is helpfull remember to THANK
linux too http://forum.xda-developers.com/showthread.php?t=695701
Nice ! (ADB works never for me to )
THanks for the tutorial Vigidroid
I am new to this followed your steps perfectly but couldn't find any file with extension xml
I am on windows 7 all files are .smali extension
Can you elaborate a little ...Thanks
Edit :weird but works now
hey guys i'm a complete noob
i did follow all of d above steps and i'm stuck on d "AndroidManifest.xml" ... i'm not able 2 open d xml !!!!! it gives me a phrasing error( in mozilla) and an "encoding error"(in jedit)
could some 1 pls help me out !!!
thankya in advance
You must be trying to open up a .xml file that hasn't been decompiled yet. Try using apktool again to decompile all the contents of the app and then you should be able to open all .xml files correctly.
Opening the android manifest that has been decompiled:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Opening the android manifest that hasn't been decompiled:
hi VigiDroid,
thanks for all the work you do for our wildfires. ive tried, unsuccessfully to use apktool a few times so i can learn how to resize apps. i cant even get to open apktool.
i downloaded the apktool1.4.3.tar.bz2 and apktool-install-wind...,tar.bz2 and unpacked them onto a folder on my desktop (windows xp). in the tut you say to install apktool, i assume you mean to open the tar files to a folder?
when i open a command and try and run apktool i keep getting a syntax error message. i have the apktool ms-dos batch file and executable jar file with the aapt file in a folder on my desktop called (not very originally ) "apktool" so i typed into the command box
cd/C:\Documents and Settings\KnK\Desktop\apktool/apktool
as instructed in your tut ie cd /install...dir../apktool. install directory being C:\Documents and Settings\KnK\Desktop\apktool.
any help would be appreciated. ive attached a screen shot of the command promt
Here's a couple of guides I followed in the beginning. First one is for setting up java, adb http://forum.xda-developers.com/showthread.php?t=879701
Second is for apk multi tool, it used to be apk manager, install this after setting up java and the Android-sdk, its basically apktool but with a gui. Great tool for beginners.http://forum.xda-developers.com/showthread.php?t=1310151
There is another one I used for just setting up apktool but I can't find it so have a crack with the multi tool.
Sent from my HTC Wildfire using xda premium
Nice 1 Scratch, as always there with a helping hand for our little wildfire community. Thanx m8
Sent from my Wildfire using xda premium
... on the learning progress , my dream is to be a chef and share my work here ... thx for the tutorial it really help me a lot ..
Sent from my Wildfire using Tapatalk 2
Does anyone know why do I always get errors on compiling with apktool ? I have java installed for sure, I installed the framework , got no problems with the decompiling and then it just wouldn't build up :X
P.S. I was trying to edit one layout xml in this apk ,but no success. Would be really grateful if someone can compile it for me :S

[LEARN] modding apks the easy way!

Hi friends of XDA,
today, i present you a easy method (more like a idea) on how to learn about what is actually modified in a apk and help you to
get an idea about creating your own mod by understandig other mods.
first is first!
#include
/*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because of you following this guide.
* do some research if you have any concerns.
* YOU are choosing to make these modifications.
* you cannot point the finger at me for messing up your device.
* yes, i copied this disclaimer from FXP coz itz cool and i am lazy!
*/
okay now let´s get started,
things you need,
1. apktool
2. WinMerge (WinMerge is Open Source software under the GNU General Public License)
3. a modded apk and it's original untouched unmodded apk for your device.
4. A LOT OF PATIENCE (learning modding apks is not so easy).
step by step,
1) apktool part,
1.1) install framework-res.apk, SystemUI.apk, SemcGenericUxpRes.apk in apktool
.
NOTE: below, any apk can be used, i'm using SystemUI.apk as a example.
1.2) decompile and compile both the original SystemUI.apk pulled from your device and the SystemUI.apk from the mod
which you are going to learn what has been changed.
NOTE: step 1.2 is done to make sure that the apktool you are using is comaptible with your apks if it throws errors
while compiling and/or decompiling unmodified system apks then use a different version of apktool which works with your
device and version of android you are going to use (google it).
1.3) after succesfully installing required apks and testing the apktool, clean the apktool folder (remove decompiled apk folders and
remove unwanted apks from the folder).
1.4) copy the pulled original SystemUI.apk from device (or pull it again) to apktool folder and rename it to make you remember that it
is the original apk (i named it as SystemUI_ori.apk).
1.5) copy the modded SystemUI.apk from the mod and rename it to make you remember that it is the modded apk
(i named it as SystemUI_mod.apk).
1.6) decompile SystemUI_ori.apk and SystemUI_mod.apk.
2) winmerge part,
2.1) open winmerge
click open
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2.2) you'll get the following window (select files and folders)
2.3) in the left and right path box type in your path to the decompiled original and modded apks directory.
as shown below and click ok (ok button will be only visible if you choose two valid directories)
2.4) now the two directories you selected will be opened and their similarities in files and
directories will be displayed in the comparison result column as shown below,
2.5) the comparision result column will display what type of file it is and whether they are different or identical as shown below,
2.5) if the file or directory is only present in one directory of the two selected directories (see 2.3) then the comparision result column
will show as highlited in the below image.
2.6) from 2.4 and 2.6 you can easily determine what files have been edited and/or added by the modder to achieve the corresponding
changes in the mod.
2.7) Now when you double click the file which is present in both the left and right directories, those files will be opened and their
differences will be highlighted.
for example let us open a text file (normally all files are text type in a decompiled apk except images) whose comparison result
show that they are different,
the text file in both left and right opens side by side and the lines which contains the differences will get highlighted in yellow,
the part of the line which is actually different from one another will be highlighted in light yellow as shown below.
NOTE: since the apk is decoded by apktool, the files will be always in human readable source form so just by looking at the differences in the
text we can get a clear picture on what is changed in the file and how does it impact in the final modded apk. If you yourself have a good
knowledge of xml and java it'll be a breeze for you to understand it!
you can also copy the whole changes of one file to another or just copy the changes line by line, to learn more about this see the further
reading part below.
3) PLEASE do not ask me about apktool errors or what to edit in a apk to get this etc., type of questions
i'm still in the nascent phase of learning about modifying apks and theming, i am using this method to learn so i am recommending this
to interested friends.
4) if you have doubts and/or errors in using apktool post here.
FURTHER READING:
5) I HAVE COVERED ONLY THE VERY BASICS OF LEARNING MODDING USING WinMerge.
to learn more about the shortcuts and functionalities of winmerge read winmerge quick guide and complete guide..
CREDITS:
authors of winmerge
authors of apktool
HAPPY LEARNING MODDING!
PLEASE PRESS THANKS IF THIS THREAD IS USEFUL!
fix urls
mv_style said:
fix urls
Click to expand...
Click to collapse
DONE man!
Damn awesome tut bro!!
Was manually comparing both files inside apk to find which file has been modified..
U made it easier for me..
Cheers:fingers-crossed:
ssanjay19 said:
Damn awesome tut bro!!
Was manually comparing both files inside apk to find which file has been modified..
U made it easier for me..
Cheers:fingers-crossed:
Click to expand...
Click to collapse
thanks sanjay
Apktool doesnt open on my pc. It just shows up for a sec and then disappears!
thejkamath said:
Apktool doesnt open on my pc. It just shows up for a sec and then disappears!
Click to expand...
Click to collapse
Install java first,
In win7 open the directory where you placed the apktool.jar , hold shift and right click inside the folder, in the menu click "open command window here" and in the command window type,
java -jar apktool.jar
Click to expand...
Click to collapse
In xp
Open command prompt change directory to the apktool.jar directory and type the above quoted.
Hit thanks if I helped you.
Sent from my ST15i using xda app-developers app
Sir I can't see the pictures u have posted... fix their links please
Thanks

Is it possible to change the default TimePicker dialog in Android?

I'm currently using Android Oreo (RevolutionRemix) and I really don't like the circular TimePicker dialog that's presented to me when I create an alarm in the default clock or when I make a new event in my calendar (Nine).
Currently I get a dialog like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
But I really would like it more like this:
I found this link https://android--code.blogspot.com/2015/08/android-timepickerdialog-theme.html (where I got the above screenshots), and it seems like this is something that can be changed with a theme.
Is this a default that can be changed (or forced) system-wide? If so, how? FYI, I have root and I'd rather edit an XML file somewhere to get this done than download a whole theming app or something.
Thanks in advance!
raphidae said:
I'm currently using Android Oreo (RevolutionRemix) and I really don't like the circular TimePicker dialog that's presented to me when I create an alarm in the default clock or when I make a new event in my calendar (Nine).
Currently I get a dialog like this:
But I really would like it more like this:
I found this link https://android--code.blogspot.com/2015/08/android-timepickerdialog-theme.html (where I got the above screenshots), and it seems like this is something that can be changed with a theme.
Is this a default that can be changed (or forced) system-wide? If so, how? FYI, I have root and I'd rather edit an XML file somewhere to get this done than download a whole theming app or something.
Thanks in advance!
Click to expand...
Click to collapse
You should be able to do this easily by editing the theme in res/values/styles.xml. If you know how to decompile apps with apktool, this should be an easy ordeal. You will need to decompile framework-res.apk and edit Theme. Material.Light and Theme.Material
To avoid bootloop, do not resign the app once edited and recompiled! Open the new apk with winrar or 7zip and add in the original manifest and meta folder located in the "originals" folder when using apktool.
Sent from my LG-Q710AL using Tapatalk
RealWelder said:
You should be able to do this easily by editing the theme in res/values/styles.xml. If you know how to decompile apps with apktool, this should be an easy ordeal. You will need to decompile framework-res.apk and edit Theme. Material.Light and Theme.Material
To avoid bootloop, do not resign the app once edited and recompiled! Open the new apk with winrar or 7zip and add in the original manifest and meta folder located in the "originals" folder when using apktool.
Click to expand...
Click to collapse
I don't know how, but I'm going to learn it Where is this apk normally in the filesystem, in the same location as installed apps? And would it be in the same location on a custom ROM as RR, or would it possibly be a custom theme with a different apk? Also, I thought apk files were just renamed zip files, what needs to be decompiled exactly (if that has an easy answer, otherwise I'll google it)? Thanks!
You will need some tools. Apk files are similar to zip files, but there are some things that are hidden. You will need apktool, adb, Notepad++, and java jdk installed. Adb and apktool are simple files that I can provide for you. They run on the command line in windows. What I do is put the files associated with adb and apktool in the C:\Windows directory so that they are installed system wide, meaning you can open the command prompt from anywhere and use the tools. Java jdk you will have to download and install.
I'm pretty sure on remix it will be framework-res.apk and it will be located in /system/framework/ directory. Apktool you will use to decompile and recompile the app. Adb is just to make things faster. You can use it to push or pull files from computer to phone and vice versa, reboot the phone, etc. You will have to enable USB Debugging in the developer options. You can also use adb to open a shell. (Like terminal in linux) but for our purposes we probably won't get into that.
Here is a link to my basic modding tools. Extract the files out and copy them to C:\Windows\.
https://drive.google.com/file/d/1Ywa3SWd_420uO-nyi2-iqVWp1vu0V_D9/view?usp=drivesdk
You'll need to copy any app that might be in /system/framework. I'm not super familiar with remix but we will get through it. Most likely it will be framework-res.apk unless remix uses something like RRframework-res or something. You can check that out with a root file manager. You may also need your SystemUI.apk located in /system/priv-app/. This is just to install the frameworks into the apktool.
Once you get all of your tools in place, create a folder named workspace on your desktop or somewhere easy to get to. Copy the above mentioned apk files into that folder. Next hold shift and right click the mouse. You want to open a command window here. In the command window type
apktool if framework-res.apk (then hit enter)
This is how you install the frameworks for apktool the if means install framework. You may also have to do this with SystemUI.apk.
Now were ready to decompile our framework! Lol. In cmd type
apktool d framework-res.apk
This will decompile the app. After you make your edits, you will use
apktool b framework-res
To build the app. (If you have any errors decompiling/recompiling report here)
At this point hopefully your app is decompiled and we can make our edit. Open /res/values/styles.xml with Notepad++ (a great computer program for coding) You will want to scroll down to Theme.Material.Light and find the TimePickerDialog. Then scroll down to Theme.Holo.Light and find TimePickerDialog. Copy the attribute from Holo theme to Material theme. Save. Recompile app. The new app will be located in the "dist" folder. Open the app with 7zip and add in the AndroidManfiest.xml and meta folder from the originals folder to retain the app's stock signature. Now we need to move our new apk to the phone. Type
adb push (drag and drop apk into cmd window) /sdcard/
This should push the app to the phone.
You can also use
adb pull (path and file)
to pull files from the phone to your workspace.
Once you get your new apk file ready and pushed onto the /sdcard/, open root file explorer and rename it to framework-res1.apk. This is so we can copy it into /system/framework/ without immediately overwriting the original. Next use root file explorer to change app's permissions to 0644. Once the permissions are changed correctly you can rename it to framework-res.apk and overwrite the original. Then reboot and enjoy.
Sent from my LG-Q710AL using Tapatalk
RealWelder said:
(snip instructions)
Click to expand...
Click to collapse
Thanks for the detailed instructions, really appreciated! Seems clear enough that I won't have any problems, I'll try it tomorrow or so and report back.
Just one question remaining: how can one retain the original signature by copying manifest files back into the apk? Isn't the whole idea of a signature to prevent changes to the files in the package? Or is it a different kind of "signature"?
raphidae said:
Thanks for the detailed instructions, really appreciated! Seems clear enough that I won't have any problems, I'll try it tomorrow or so and report back.
Just one question remaining: how can one retain the original signature by copying manifest files back into the apk? Isn't the whole idea of a signature to prevent changes to the files in the package? Or is it a different kind of "signature"?
Click to expand...
Click to collapse
It prevents you from modifying the AndroidManifest.xml. If you changed anything in it you would have to resign... But then it's signature won't match the rest of the signatures in the OS, which causes bootloop. Copying the original manifest and meta folder is just a workaround to keep it's signature in tact.
Sent from my LG-Q710AL using Tapatalk
RealWelder said:
It prevents you from modifying the AndroidManifest.xml. If you changed anything in it you would have to resign... But then it's signature won't match the rest of the signatures in the OS, which causes bootloop. Copying the original manifest and meta folder is just a workaround to keep it's signature in tact.
Click to expand...
Click to collapse
OK, that makes sense, thanks! I noticed that a wrong signature can cause a boot loop, I'm guessing that other problems with this file can also cause a boot loop? If so, is there an easy way to bypass this file should that happen (safe more or something)?
Just FYI, I'm using full-disk encryption and TWRP can't decrypt the data partition, but I assume I can just put the original file back to the /system filesystem if necessary?
raphidae said:
OK, that makes sense, thanks! I noticed that a wrong signature can cause a boot loop, I'm guessing that other problems with this file can also cause a boot loop? If so, is there an easy way to bypass this file should that happen (safe more or something)?
Just FYI, I'm using full-disk encryption and TWRP can't decrypt the data partition, but I assume I can just put the original file back to the /system filesystem if necessary?
Click to expand...
Click to collapse
It could, but generally the signature issue is the main reason for bootloop. The xmls and png images are safe to edit. Be careful with images, if one has a .9.png extension it is a nine-patch file. They have a one pixel border around the image that lets android know where to stretch said image. They are black dots/lines. Make sure they stay black and not opaque at all.
Sent from my LG-Q710AL using Tapatalk
raphidae said:
OK, that makes sense, thanks! I noticed that a wrong signature can cause a boot loop, I'm guessing that other problems with this file can also cause a boot loop? If so, is there an easy way to bypass this file should that happen (safe more or something)?
Just FYI, I'm using full-disk encryption and TWRP can't decrypt the data partition, but I assume I can just put the original file back to the /system filesystem if necessary?
Click to expand...
Click to collapse
I would make a fresh backup with TWRP before doing any of this, just in case. It is pretty safe though. I've been tinkering with rooted phones for a few years doing this. My latest venture is in a way even more impressive. With the newer LG phones, they have a built in theme system. I've been able to create my own theme and apply it to the phone all without root.
Sent from my LG-Q710AL using Tapatalk

Categories

Resources