ADVERTISEMENT

I have been sent an e-mail about how to deodex the Galaxy S4 Mini's stock rom in order to be able to modify the system apk files such as theming, tweaking, etc. Seeing as there is no such guide, here it is.


So you've probably already tried the simple option in Titanium Backup which is for unlinking dalvik sys cache but it doesn't work. So this method may seem a bit complicated but really it's not that much.

WARNING:
Deodexing your rom slows down boot process by just a little bit. Not following the procedure carefully could lead to damaging your rom by either ending up with a bootloop or with multiple apps and services "has stopped working" messages. ALWAYS MAKE A BACKUP!

Prerequisites:

  • Android SDK - Click here.
  • Java - Click here.
  • Universal Deodexer v4 tool - Click here.
  • Enable USB Debugging on your phone - Settings -> More -> Developer Options -> USB Debugging
  • Create 2 folders in your internal storage - one called app and the other framework

We are going to be using the Universal Deodexer developed by abcdjdj and Alokbina from xda-developers forums. The tool has recently been updated to v4 with a GUI so it should make things even easier.

Instructions:

 

Part 1 - Setting up Java and Android SDK

1. Head into the Java download link above and download Java according to your Windows version and architecture (x86 or x64) and then follow the instructions on the installer program.

2. Download the Android SDK from the website above. The file should be a zip file, so use a program such as WinRAR or 7zip to extract it. Now you only need to extract the SDK from the zip file so only select the sdk folder and then click on Extract as shown in this screenshot:

3. Now it is recommended that you move this sdk folder to your system hard drive (C:\) to not get any errors if your Windows username folder happens to use unknown characters. So move the folder to your system drive and open it, go to the folder sdk -> platform tools and now hold the Shift button and right-click on an empty spot on the folder, you should see an extra option in the context menu called "Open command prompt window here":
4. Click it and you should get a command prompt window to appear:
You have now succesfully set up the Android SDK to pull and later on push the deodexed system files to your phone.


Part 2 - Pulling the files


1. Connect your Galaxy S4 Mini to your computer with your USB cable and remember to have USB Debugging option enabled.

2. Be sure to have some free space in your internal memory as we are going to copy the /system/app files and /system/framework files temporary there. Now begin to type in the following commands in the command prompt window by order, starting from the first to the last:
adb shell (you should get a popup window on your phone as you type this in asking you to allow it)
su
stop
mount -o rw,remount /system/ /system/
cp /system/app/* /mnt/sdcard/app/ (be patient while it copies)
cp /system/framework/* /mnt/sdcard/framework/ (be patient while it copies)
reboot

Example screenshot of commands being used.
3. Now at this point, your phone should reboot after typing in the last command in your internal storage, you should find the .apk and .odex files in the appropriate folders.

That's it, you are done pulling the files!

Part 3 - Deodexing


1. Now that you have collected all of the needed files, it's time you copy the two folders app and framework to your computer and open the Universal Deodexer folder. You should see some folders and files, especially the folders "apks" and "framework"

2. Move the apk and odex files from your app folder into the apks folder and the apk and odex files from your framework folder into the framework folder there.

3. Once you are done moving the files in the appropriate directories, it's time to run the program. So simply select the .jar file which you see there and open it. If it asks you with what program to open it, choose Java(TM) Platform SE binary.

4. Now select the options as shown in the screenshot below:

5. Now click on "Deodex All APKs" and at this point you really need to be patient as that is a lot of files and deodexing takes some time, especially for larger files and you will be getting cmd windows closing and popping back up for each file. After it is done, it should say "Deodexed <number> apk file(s)!"

6. The deodexed apk files should end up in the folder "deodexed". Now move all those deodexed apk files into a seperate folder name it for example deodexed_apps and move all the apk files in there. Now copy the files from the framework folder into apks folder.

7. Now click on "Deodex ALL JARs" and once again be patient. Once it is done, you should again get a popup saying it has deodexed jar files and those files will also end up in the "deodexed" folder. Now it is advisable that you also seperate these JAR files into a different folder such as deodexed_framework.

Part 4 - Pushing

1. Now that you have the apks and framework files seperated into these two folders, transfer them to your phone's internal memory.

2. Once the files have been transferred, open up the sdk command prompt window as shown in Part 1, Step 3 and 4.

3. Begin to type in the following commands by order, starting from the first to last. Once again, be patient when you will type in the cp command as that is when it will be copying.
adb shell
su
stop
mount -o rw,remount /system/ /system/
cp /mnt/sdcard/deodexed_apps/* /system/app/
rm /system/app/*.odex
cp /mnt/sdcard/deodexed_framework/* /system/framework/
rm /system/framework/*.odex
reboot

Example screenshot of commands being used.

Part 5 - The test

1. If you followed the instructions right, your phone should manage to reboot, you should see a popup "Android is upgrading..." for the first boot and your phone should start up just fine.

2. Now to see what's going on in the system directory - open up a root browsing app and head into /system/app/ and see if there are any odex files, do the same for /system/framework and see if there are only jar files or both jar and odex.

3. If you don't see any odex files anywhere and your system is functioning fine, congratulations, you have deodex your rom!

0 comments:

Post a Comment

 
Top