deodexing stock and soft linking? - Nook HD, HD+ Android Development

anybody tried deodexing and soft linking the directory structure for /system/app && /system/framework to /data/su/... to open up the stock rom to theme/mods? wonder if it would work. may have to give it a shot as there are some mods I'd like to make.

andmer said:
anybody tried deodexing and soft linking the directory structure for /system/app && /system/framework to /data/su/... to open up the stock rom to theme/mods? wonder if it would work. may have to give it a shot as there are some mods I'd like to make.
Click to expand...
Click to collapse
I have thought about this too but have not had the chance to do a sys dump yet. What are you planning on theming? Because the white text on a soft white background is driving me nuts sometimes!

i was planning on modding nook button to do back by default, and long press home. as a first mod.
tried this method on /system/framework/ it didnt work...unfortunately.
I got the nook button to do back with keylayout change, but the long press home would require a hack to android.policy.jar

andmer said:
i was planning on modding nook button to do back by default, and long press home. as a first mod.
tried this method on /system/framework/ it didnt work...unfortunately.
I got the nook button to do back with keylayout change, but the long press home would require a hack to android.policy.jar
Click to expand...
Click to collapse
So the deodex worked without resetting itself after boot for you?

looked good, but got stuck @99%. I figured maybe it just building up the dalvik-cache at first, So I left it for about 15 minutes just to see what would happen. It never got past 99% loading. It must not like something about soft links to framework. For me, adb logcat only works after boot has finished. So unfortunately I can't get a boot up adb logcat to see what exactly is going on.

andmer said:
looked good, but got stuck @99%. I figured maybe it just building up the dalvik-cache at first, So I left it for about 15 minutes just to see what would happen. It never got past 99% loading. It must not like something about soft links to framework. For me, adb logcat only works after boot has finished. So unfortunately I can't get a boot up adb logcat to see what exactly is going on.
Click to expand...
Click to collapse
I may have a tool later that could work that I have to try out but I'm busy at the moment. I would try deodexing \system\app\ (.apk + .odex files) and \system\framework\ (.jar + .odex files) and then zipalign them and see if it boots without any modifications first. I would look at the soft linking after.

9v9 said:
I may have a tool later that could work that I have to try out but I'm busy at the moment. I would try deodexing \system\app\ (.apk + .odex files) and \system\framework\ (.jar + .odex files) and then zipalign them and see if it boots without any modifications first. I would look at the soft linking after.
Click to expand...
Click to collapse
If you change any /system file without symlinking them, your system will reset. See my HD/HD+ Tips thread linked in my signature, item 15.
Sent from my Nook HD+ running CM10 on Hybrid SD

Related

Skinning question

In framework-res.apk, what controls the color of the text for the status bar, such as notifications and the digitial clock? Are these controlled independently by seperate apks?
I'm considering diving in and attempting to skin my android but I want to know what I'm getting into.
I've tried replacing framework.apk that I built from source on a real device and emulator. Only bad things came of it. Had to reflash. Let me know if you have better luck.
I'm pretty sure it failed because a lot of the stuff in framework.apk is stubbed closed source stuff.
Koush,
Have you looked at this post by Living_Sword?
I suggest you enter the following commands using adb, because its faster and reliable than telnet or any other method. If you do not have adb setup, read here, if you do, then just enter adb shell in the console while the phone is connected.
In simple words, you have to re-sign the framework-res.apk with your own key. You should know that you will loose all your data while doing this mod. Here are the steps,
1. Re-sign and re-upload all the .apk files in /system/app with your own key or the test-keys. The command used for signing is included in the readme file alongwith the signing jar here.
2. Take a backup of /system/framework/framework-res.apk. Now, you would want to edit some stuff in framework-res.apk, for that the easiest method is to rename the apk file to .jar/.zip, put in your own files(with same name as original png) and rename it back to .apk. You have to re-sign this apk with the same key like you did in the first step.
3 . Upload the apk file to /system/framework. The phone will hang, and in few secs it will most likely go back to the android robot screen.
4. Take out the battery, then do a data reset by going into recovery mode and pressing ALT+L to see the log text and then ALT+W to wipe out /data. Obviously, you will loose all your apps and settings and will have to re-activate the phone.
5. After the wipe is complete, press HOME + BACK to reboot. The phone should reboot normally now.
I know its a pain to loose all the data and apps, but this is the easiest method until we figure out something more elegant, and its required to be done only once. Also, there is no need to keep the png file size same. And in future, you will be able to replace the framework-res.apk without any hassles.
Also, since each stock app's icon is in its own apk, once you re-sign every apk in /system/app, you can easily replace their icons with your own.
Source: http://www.modmygphone.com/forums/showthread.php?p=16871#post16871
Ok, so I have successfully replaced framework-res.apk with my own build which includes custom icons and things like that. However, I am running into two problems:
1: I keep running out of room in my system folder. Everytime I replace framework-res.apk I am losing space somehow, eventually I have to do the mod rc30 update all over again to get my memory back so I can push this file over, where is this space going? Whats eating it up? Oh, and it isn't the file size growing, this will happen if I pull a file and directly try to push it back onto the phone.
2: I still don't know how to change the default color of the text. I assume it is in one of these xml files but I'm not sure, and I haven't found it yet. Could it be in /res/color/?
If anyone could help me on these two issues I would be so appreciative.
This is what I've done so far, see the status bar and the icons?
Stericson
Stericson said:
Koush,
Have you looked at this post by Living_Sword?
I suggest you enter the following commands using adb, because its faster and reliable than telnet or any other method. If you do not have adb setup, read here, if you do, then just enter adb shell in the console while the phone is connected.
In simple words, you have to re-sign the framework-res.apk with your own key. You should know that you will loose all your data while doing this mod. Here are the steps,
1. Re-sign and re-upload all the .apk files in /system/app with your own key or the test-keys. The command used for signing is included in the readme file alongwith the signing jar here.
2. Take a backup of /system/framework/framework-res.apk. Now, you would want to edit some stuff in framework-res.apk, for that the easiest method is to rename the apk file to .jar/.zip, put in your own files(with same name as original png) and rename it back to .apk. You have to re-sign this apk with the same key like you did in the first step.
3 . Upload the apk file to /system/framework. The phone will hang, and in few secs it will most likely go back to the android robot screen.
4. Take out the battery, then do a data reset by going into recovery mode and pressing ALT+L to see the log text and then ALT+W to wipe out /data. Obviously, you will loose all your apps and settings and will have to re-activate the phone.
5. After the wipe is complete, press HOME + BACK to reboot. The phone should reboot normally now.
I know its a pain to loose all the data and apps, but this is the easiest method until we figure out something more elegant, and its required to be done only once. Also, there is no need to keep the png file size same. And in future, you will be able to replace the framework-res.apk without any hassles.
Also, since each stock app's icon is in its own apk, once you re-sign every apk in /system/app, you can easily replace their icons with your own.
Source: http://www.modmygphone.com/forums/showthread.php?p=16871#post16871
Click to expand...
Click to collapse
framework-res.apk is just the resources. framework.apk contains the actual code used by every application in the system. Attempting to replace THAT file the result of the android build process will fail.
I think we're talking about two different files.
Oh yep, definetly we are...I thought you were talking about that but I figured you would clarify if you were indeed. Thanks.
so you guys are making progress on some themes... GOOD ****..
jzajzz said:
so you guys are making progress on some themes... GOOD ****..
Click to expand...
Click to collapse
Agreed. Once this process is mastered, and some polished themes, or a tool to make your own (or something) comes out, our G1's will look even sweeter.
jzajzz said:
so you guys are making progress on some themes... GOOD ****..
Click to expand...
Click to collapse
Well, I was making progress, but now my phone is bricked. Don't know how it happened. Was doing the same thing I've done over 20 30 times, suddenly started giving me problems, reflashe JF update and voila! bricked phone. So now I'm getting a new one sent to me and hoping that it comes pre-rc30. Sucks too because I am pretty sure I found out where the text color is set. Thats why I'm trying to get this to work under the emulator, but I can't get it to work. The dang emulator won't reboot or shutdown. So I can't see the changed made.
It sounds like it's too late to help now. But how was the phone bricked? Did it go into an infinite reboot cycle? Stay on the G1 screen?
Also, I assume you hadn't loaded the dev bootloader? That could have easily saved your phone from brickage
JesusFreke said:
It sounds like it's too late to help now. But how was the phone bricked? Did it go into an infinite reboot cycle? Stay on the G1 screen?
Also, I assume you hadn't loaded the dev bootloader? That could have easily saved your phone from brickage
Click to expand...
Click to collapse
My phone does have the dev bootloader on it. However, now it just stays on the boot splash screen and I can't do the update because it says the /dev file is gone! Can I reflash all of that and save my phone?
Btw, I actually think the entire folder /system is gone, because I can't abd with root, and when I did it in the update screen my system folder wasn't showing. So, I have no idea how this happened.
Is it possible to push that entire folder back on there and then recover or something?
Yes, you can reflash the recovery partition using the fastboot protocol, which the dev bootloader supports. There isn't a windows binary for it yet, but if you have a linux or mac handy, turn on the phone into bootloader mode, then plug in the USB cable. "Serial0" should change to "FASTBOOT". now you can use the fastboot binary on your computer to flash anything on the phone. You might try re-flashing the recovery image that's in my modified update. If that doesn't work, maybe try flashing the radio too.
If you have the dev bootloader, I'm almost positive your phone can be saved. Give me at IM if you want to talk about it.
I *think* the fastboot binary is in the sdk for linux/mac. I could be wrong though. There are copies of both floating around though, just ask if you need one.
I managed to repack framework-res.apk and resign all other packages without wiping. The problem is with the signatures in /data/system/packages.xml - they no longer match after resigning. The solution is to simply delete all <sigs> sections (and the <certs> within), and the PackageManager will automatically regenerate them as they are launched. I just now successfully booted, so can't say this is thoroughly tested, but I'll report back here if any problems crop up.
donniesmit said:
I managed to repack framework-res.apk and resign all other packages without wiping. The problem is with the signatures in /data/system/packages.xml - they no longer match after resigning. The solution is to simply delete all <sigs> sections (and the <certs> within), and the PackageManager will automatically regenerate them as they are launched. I just now successfully booted, so can't say this is thoroughly tested, but I'll report back here if any problems crop up.
Click to expand...
Click to collapse
A good check after doing something like this is to take a look at the call log, and actually receieve a call (call yourself from your home phone, or whatever). Both of these like to error out when messing around with resigning.

modding .xml in framework-res.apk with apktool?

i know there are hunderds of threads about this, but none of them helped me and niether of them describes my situation.
i had to change some values in bools.xml in framework-res.apk of a deodexed cm7.2 rom. so, i decompiled and recompiled using apktool and tried the folowing things (in all cases i remembered to chmod to 664):
- pushed the compiled file without signing. Boot loops.
- wiped dalvik cache. still boot loops.
- signed the compiled file. IT BOOTED! but all system apps fc. And i see a blank status bar. clearing dalvik cache doesnt help.
- copied the compiled resources.asec to original apk with winrar. NO FCs this time. still a blank status bar. Rotating the phone freezes the system instantly. but even if you dont rotate, system soon freezes, within 30 secs. logcat shows repeating messages of "cpu may be pegged. trying again". (no i havent overclocked).
how do u guys mod the frameworkres successfully?
Well, I don't know exactly what the problem you're having is since it may depend on the type of mod you're doing but..
I decompile framework-res.apk with apktool, make my changes and recompile. Then I use 7zip to copy the res folder from the new apk to the old one (just open both and drag across). Next, I extract resources.arsc from the new apk and add it to the old one, making sure to use 'store' compression. If resources.arsc is compressed at all, it causes problems.
So the original framework-res.apk now has a new res folder and resources.arsc at the right compression ratios. If you sign the new apk file, you have to make sure all the other system apps are signed the same way and it's just more trouble than it's worth.
Then I reboot into recovery, mount the system and push straight to the framework folder. I used to do this while the phone was running normally but I'd get all kinds of odd bugs if I made any change to anything other than a drawable. I'd get strange FC's, I'd lose wifi connection, all kinds of things.
And that's about it. As long as the changes I'm making don't stop the phone from working properly anyway, the above works perfectly every time.
Sent from my U20i using xda premium
arnab321 said:
(in all cases i remembered to chmod to 664):
Click to expand...
Click to collapse
Did you made a typo, or did you really have set the permissions to 664?
Its 644.
brainmaster said:
Did you made a typo, or did you really have set the permissions to 664?
Its 644.
Click to expand...
Click to collapse
that was actually a typo, and once i also accidentally made a typo on adb, but it still boots fine. i dont think giving extra permissions will screw things up.
the problem "cpu may be pegged" is rom/kernel related, because it is still there after a fresh install... sometimes it happens, sometimes not.
but i dunno anything about the blank status bar... i was trying to set "has_soft_keys" to true, to use tablet tweaks on my phone, does that cause a blank statusbar? anyone else got the same problem?
Wait, why are you using framework-res.apk for that? I think you need to change local.prop in /data to do this.
Have you actually got the line "has_soft_keys" already in the bools.xml?
Ticklefish said:
Wait, why are you using framework-res.apk for that? I think you need to change local.prop in /data to do this.
Have you actually got the line "has_soft_keys" already in the bools.xml?
Click to expand...
Click to collapse
yes it had that line, and setting it to true does bring the softkeys stuff in tablet tweaks menu. But the status bar always stays empty, nothing on it.
what needs to be changed in local.prop? There's nothing related to softkeys there on my phone.
umm, my ROM had the center clock mod on status bar, is that an issue?
Sent from my LG-P500
edit:
yes it was due to the center clock. tried anoher rom and i got the softkeys just by modding the bools.xml
First of all never sign system apps.
try using apk manager(I know it uses apk tool to do these operations) so try to set compression level to zero and heap size to 512.
I think above solutions should solve your problem but revert if u face any problem.
Sent from my Micromax_A70 using Tapatalk

[Q] Modded Camera.apk hardkeys

Got the modded Camera.apk from Here. I changed my hardkey Search button to function like a Menu key (my menu hardkey won't work properly). I liked the search key as a snapshot key for the camera but now with me changing 217 "SEARCH" to MENU" it doesn't work.
I downloaded APKTool and decompiled modded .apk. Now the only problem is I can't find where to change the key to take a snapshot with "MENU" pressed. I have been looking through the .smali files and not having any luck. Menu key as far as I have seen has no function in the camera app anyways so this shouldn't be a problem.
Last question I would have (which I could probably search) would be how to take the decompiled .apk and compile it back to .apk.
Is the code for the menu button 217 or is that independent of the button?
Sent from my SCH-I510 using xda premium
Within /system/usr/keylayout/qwerty.kl "key 217 SEARCH" I changed to "key 217 MENU" also I changed /system/usr/keylayout/s3c-keypad.kl "key 217 SEARCH" to "key 217 MENU".
That is how I got Search button to open Menu.
I'll take a look for you. It probably won't take too long.
Yeah it should just be changing the key event code from the search key to the menu key in a few places.
dwitherell said:
Yeah it should just be changing the key event code from the search key to the menu key in a few places.
Click to expand...
Click to collapse
The problem for me is I can't find those few places. lol Searching through all these .smali files I think I'm gonna need my search button back lol.
Edit: I opened all of the files in NotePad++ and did a search for "search" and found several items but I don't know what to change or leave.
I think what I need to change is in AbstractCameraActivity.smali
Enlightened_Rogue said:
The problem for me is I can't find those few places. lol Searching through all these .smali files I think I'm gonna need my search button back lol.
Click to expand...
Click to collapse
I'm sure substanceD will get it for ya, but camera.smali and camcorder.smali are 2 at least. It'll be in the onkeyup and onkeydown event methods (just looked at this, but memory is a bit sketchy...)
dwitherell said:
I'm sure substanceD will get it for ya
Click to expand...
Click to collapse
As you see I don't mind doing the leg work, I'm not one of these beggers out there that just want someone to build a app just for me. Thanks for giving me some pointers. I'm just trying to learn as I go. New to modding phones (trying to get better).
Enlightened_Rogue said:
As you see I don't mind doing the leg work, I'm not one of these beggers out there that just want someone to build a app just for me. Thanks for giving me some pointers. I'm just trying to learn as I go. New to modding phones (trying to get better).
Click to expand...
Click to collapse
All right, let's see if I can be helpful without doing the work for you. The Android key codes are published here: http://developer.android.com/reference/android/view/KeyEvent.html. The smali files have the hex values for these key events without the extraneous zeros. For example, you'll notice that KEYCODE_POWER is sprinkled throughout the code as 0x1a. Try to find a block of code that refers to the common keys (power, search, menu, etc.) and see how it delegates them.
OK I replaced 0x54(Search) with 0x52(Menu) [14 instances] and then Compiled with APKTool. Moved Camera.apk to /system/app/ and now phone doesn't recognize Camera.apk. I restarted, tryed setting permissions to rw-r--r-- then restarting as well and still not being recognized.
Edit: Noticed when I moved your modded the permissions where rwxrwxrw- and it still showed up without restarting.
Enlightened_Rogue said:
OK I replaced 0x54(Search) with 0x52(Menu) [14 instances] and then Compiled with APKTool. Moved Camera.apk to /system/app/ and now phone doesn't recognize Camera.apk. I restarted, tryed setting permissions to rw-r--r-- then restarting as well and still not being recognized.
Edit: Noticed when I moved your modded the permissions where rwxrwxrw- and it still showed up without restarting.
Click to expand...
Click to collapse
Did you sign it (don't)? Also, there are some sound files in /res/raw that need to stay UNcompressed for things to work properly.
All I did to compile was from Here.
Code:
apktool b <directory of decoded apk>
Never compiled any apk before. How do you not sign it and not compress some of the resource files?
Edit: Just seen this at the bottem, but I'm using APKTool 1.4.3
idroid84 said:
Issues;
I noticed that while the new version 1.2 works great on the framework-res.apk file, it seems to have issues with other System/app files like Settings.apk,Phone.apk, etc. For these files use version 1.1.1.
Click to expand...
Click to collapse
Enlightened_Rogue said:
All I did to compile was from Here.
Code:
apktool b <directory of decoded apk>
Never compiled any apk before. How do you not sign it and not compress some of the resource files?
Edit: Just seen this at the bottem, but I'm using APKTool 1.4.3
Click to expand...
Click to collapse
Well the first part shouldn't be an issue I don't think. For the second - an apk is similar to a zip file. I would use something like jzip or winrar to extract out those sound files, delete them from the apk, then drop them back in using store or storage (i.e. no) compression. Though I am doubtful not doing this would cause the phone to not recognize the apk to be honest.
I opened the Original Modded .apk with 7zip moved the res files over just playing around waiting for a response and still no luck. Also I noticed while doing that the Modded on had a META-INF folder which I moved over to my Mod and after all that moved to phone /system/app and restarted phone still no Camera in App Drawer.
Original Mod I decompile: Camera 5-14-12
My Decomipled and editied:Camera - Menu Button
I was messing around with my phone and decided to install PBJ Kernel 0524. After installing that now Root Manager won't allow Mount R/W so now I can't change system files. I guess I'm stuck with what I got for now.
Edit: Complete noob moment... Went into CWM -> Mounted System -> Installed SU again. Now works. Back to working on Camera
Enlightened_Rogue said:
I was messing around with my phone and decided to install PBJ Kernel 0524. After installing that now Root Manager won't allow Mount R/W so now I can't change system files. I guess I'm stuck with what I got for now.
Edit: Complete noob moment... Went into CWM -> Mounted System -> Installed SU again. Now works. Back to working on Camera
Click to expand...
Click to collapse
Yeah the lost root is just a permissions thing - a number of ways to fix it, and installing su is definitely one of them. Glad you got that figured out.
I looked into this more - you changed too many 0x54s... not all of those were relevant to what you wanted (only 6 were). On top of that, only two of them were changing 0x54 to 0x52 (CamcorderRecordingMenu.smali) - the other 4 (2 in Camcorder.smali and 2 in Camera.smali) were simply changing the :sswitch_ value associated w/ 0x52 to that associated w/ 0x54.
Anyhoo - end result should now be power, menu, and search take pics/start video. Here's the apk - just rename to Camera.apk and push. If it doesnt show up right away and a reboot doesnt fix it, you could try to push in recovery, or dump it in a cwm-flashable zip and flash it. Hope it works for ya!
Thank you. I figured I probably changed too many. I just opened notepad++ and find/replaced in files. I was looking through but was having a difficult time tracing what was needed and was not. How did you compile just like I posted earlier? And how did you get META-INF and not compressing resources?
Enlightened_Rogue said:
Thank you. I figured I probably changed too many. I just opened notepad++ and find/replaced in files. I was looking through but was having a difficult time tracing what was needed and was not. How did you compile just like I posted earlier? And how did you get META-INF and not compressing resources?
Click to expand...
Click to collapse
I was lazy and used one of the gui-ized apktool approaches (apkmultitool). It took care of keeping things in order. After recompiling, I opened the apk in jzip, pulled out the oggs in /res/raw, deleted them from the apk, then put them back in and set compression to store. It should be noted that you could go about things without dealing with any of this - just pull out the classes.dex from the apk, use baksmali to decompile and smali to recompile, and place new classes.dex into the apk.
I take it the apk worked for you then?
Yes it worked perfectly! Thank you. Instead of just getting what I want then not saying anything I was decompiling yours and seeing what needed to be changed. Hopefully soon I will be able to to much much more. Just a little time devotion patients and people like you to help. Thank you so much!

[HowTo] Odex FRAMEWORK, all Android versions may apply.

Here in this tutorial, I will show some facts about Deodex and Odex, then explain how to odex the framework of a ROM(which is pretty annoying, you'll find out). Credits goes to myself
This method should work on all Android devices.
------------------------------------------------------------------------------------------------------------
First of all, what is odex? Something you should know about classes.dex.
Odex stands for Optimized dex. I'm not gonna explain a lot because I'm not sure if I'm right. First of all, in typical apk files, when you open it with WinRAR or something like that, you can find a file called "classes.dex"(this type of apk is deodexed). This file is the key. It contains the core codes of the apk. However the other type of apk comes with an *.odex file and doesn't have classes.dex inside the apk file. This is odexed apk. There are 2 types of ROMs here, odexed and deodexed. Odexed ROMs' classes.dex are already out of the apk files, while deodexed ROMs' classes.dex are still in the apks. When Android executes an apk, it has to extract the classes.dex out and execute it. So when you flash an deodexed ROM, the first boot takes a long long time since the Android system needs to extract all the classes.dex into dalvik-cache(it shows "Optimizing apks" on the screen for 4.0 ROMs, shows boot animation on screen for 2.3 or below ROMs). However for the odexed ROMs, because the classes.dex are already out there, the system just grabs them and use them, without wasting time and storage space extracting classes.dex out.
Why odex framework?
It can boost your device a little by odexing your framework. Your phone can run more efficiently. Although it's a complicated process, but trust me, it's worth it.
What is so special about odexing framework files? What's the difference?
Odexing an app is very easy, and I believe everyone knows how to do it. But odexing framework is really annoying. Why? Because apps and more like stand-alone things, they are not a part of system. You delete it, nothing bad happens, your phone still boots, you just get endless FC if you delete the wrong one, or missing status bar, that's all. But framework files you cannot mess around. They are parts of the system. They have to match the system's codes precisely, without any error, even the order of files(keep this in mind, very important). So for every ROM, the framework initialize codes are different(same RUU or other ROM based ROMs count as its base ROM), and you must modify the odexing binary to make it odex for you properly, or you can sit and watch the beautiful bootloop.
What's the relationship between odexing apps and odexing framework?
Simple, but important. If you odexed apps, you cannot touch the framework. Framework always goes in the first place. If you wanna odex both, you must odex framework first. Or... "The Tragedy of App and Framework"...
So what do we have to keep in mind before we start?
Keep your mind clear, prepare a bag of ice in case you feel dizzy with the codes, and MAKE ENOUGH SPACE FOR FRAMEWORK ODEXING. I would prefer you remove a few useless apks in /system/app first to make more room in system partition. Failing odexing may brick your device forever! Nah just kidding it will only cause you to bootloop. No big deal. Also, it won't odex your framework-res.apk and always will not, so don't feel bad and do it again and again till your phone burn . Make sure your device is ROOTED and enable USB debug. You need Java Runtime Environment.
What tools do you need?
Notepad++ and a magical rar that contains all you need to success.
Let's get started.
------------------------------------------------------------------------------------------------------------
1. Use your file manager to find init.rc at the very root directory of your phone and copy it to SDCard for later code editing, or you simply adb pull it out and skip the coping step. (If you know how to compile boot.img it is even easier, just unpack boot in Android Kitchen, look for line "export BOOTClassPATH". I'm not gonna introduce that method since most people can't. Silly me, didn't I just intoduced that? XD)
2. Connect USB, set mode as disk drive so you can access your SDCard. Copy init.rc into your computer. Open it with notepad, and find where it says "export BOOTClassPATH", create a new file and copy line "export BOOTClassPATH" into the new file. For example:
Code:
export BOOTCLASSPATH/system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar:/system/framework/HTCExtension.jar:/system/framework/com.htc.framework.jar:/system/framework/com.htc.android.pimlib.jar:/system/framework/com.htc.android.easopen.jar:/system/framework/com.scalado.util.ScaladoUtil.jar:/system/framework/com.orange.authentication.simcard.jar:/system/framework/android.supl.jar:/system/framework/com.ecrio.sip.jar
3. Open dexopter in the rar you downloaded with Notepad++. Find the lines that show the similar contents to the things after "export BOOTClassPATH". It is Line 21 to Line 35 on my laptop. Edit them according to the things you just copied out of init.rc. For example, if the first file is "X.jar", then you will have to edit the line into "dexopt-wrapper/system/framework/X.jar /system/framework/X.odex". Then repeat until you finish with all the files that are listed in the long list you copied out of init.rc. File order DOES MATTER. Use the bag of ice I told you to prepare eariler to make you sober if you feel dizzy with the codes. The lines may be more or less after you edited them, doesn't matter.
4. Copy "dexopter" and "dexopt-wrapper" into /system/bin and set the correct permissions. Make sure they have enough permission to change your system files. Restart your phone.
5. Go to CMD and lead it to where adb.exe is(included in the rar). Type these in order:
Code:
adb shell
su
cd system/framework
dexopter fr
Then the codes will run crazy in your cmd window... The odex process has begun!
6. If the odex process completed without error, you are half way there! Well it doesn't mean you have to stare at your screen during the process. It's about time we figure it out! The phone will automatically reboot once it's finished. If it doesn't and you are sure all are done, reboot manually.
7. If you can't boot properly, go back and check everything carefully. If you can, then open your file manager and copy the entire framework directory into your SDCard. You can still adb pull and skip the next coping step.
8. Mount SDCard. Go into framework directory on your computer. Open every file that has an odex file with it, delete the classes.dex inside. WinRAR is okay. The files may seem ridiculously small after you delete the classes.dex, but don't worry since classes.dex are already pulled out and turned into odex files.
9. Copy the whole framework folder into the folder where adb is at. Use adb to push all the files back into /system/framework.
Code:
adb root
adb remount
adb push framework /system/framework
adb shell
su
chmod /system/framework xxx (xxx is a permission code, depends on your ROM. They should be the same as the old deodexed framework files. Use Google to find out how to use the permission codes.)
10. After all the files are pushed in, reboot your phone.
11. If it still boots into the system, congratulations! You've successfully odexed your framework! If it doesn't, then go back and read everything carefully. The most common error occurs when you are editing the dexopter code. You will have to redo everything again.
Done! Everything is ready to go!
You can directly grab the files you've odexed and put it in your custom ROM(must be the same base), just don't forget the odex files.
------------------------------------------------------------------------------------------------------------
Okay, hmm, what to say now? Still, I would be glad if you donated me, but if you don't it's okay, just reply and hit thanks .
Oh almost forgot, the magical rar: http://d-h.st/tYi
------------------------------------------------------------------------------------------------------------
Big thanks to Scott, see him in #3. He explained why some files aren't odexed and provided a easier method(but they all get you dizzy )
Big thanks to JSLEnterprises, see him in #4. He provided a newer busybox for Scott's method.
If you can, send me a PM on how to odex apps.
Sent from my HTC One X using Tapatalk 2
BreatheHT said:
Here in this tutorial, I will show some facts about Deodex and Odex, then explain how to odex the framework of a ROM(which is pretty annoying, you'll find out). Credits goes to myself
Also, it won't odex your framework-res.apk and always will not, so don't feel bad and do it again and again till your phone burn . Make sure your device is ROOTED and enable USB debug. You need Java Runtime Environment.
Click to expand...
Click to collapse
Good write up. Other files that wont "re-odex" are com.htc.resources.apk, com.htc.videowidget.res.apk, com.htc.weather.res.apk and framework-htc-res.apk.
The reason? The files dont have .dex files because there is no code in them. These files just carrier resources like images (for those that didint know).
The .dex files are the actual smali code that devs mod to make the ROM do crazy things
Also, an easier method can be found here: http://themikmik.com/showthread.php?12988-Tool-App-Dexo-the-Universal-Odex-Utility
It does it all and pulls the bootclass for you. And it also does /system/app/ in one simple shot.
Also, one last thing... You can just as easily pull the files back to the PC using the ADB Pull command...
Code:
adb pull /system/app ./app
adb pull /system/framework/ ./framework
EDIT: And another simple method to get your bootclass is do another ADB Pull
Code:
add pull init.rc
I find the adb pull method quicker and more simple...
theking_13 said:
If you can, send me a PM on how to odex apps.
Sent from my HTC One X using Tapatalk 2
Click to expand...
Click to collapse
You can use the method I just explained or if you want to try the framework manually then do apps seperately then you can use this: http://forum.xda-developers.com/showthread.php?t=1514576
I use that app to re-odex updated files in the ROM. For example... If Gmail updates (which it just did) I would remove the old gmail files from system/app/ and put the new one in and run that program then pull the files.
-Scott
If anyone finds this to be too much work... dont worry... it only unpacks the classes.dex once. It will only need to unpack a dex if original file has changed (changed entries need to propogate). That's why all the consecutive boots are back to a 'normal' span of time.
re-odexing your roms IS recommended if either A) you're anal-retentive/have OCD or B) propogation ("Android is Upgrading...") happens every time you reboot your device (it happens sometimes)
If you're going to use the tool scrosler linked to, replace the busybox binary with the one inside the attatched zip (this is busybox 1.20.1). The one that come with the tool is pretty dated.
:good:
Update: Busybox 1.20.2 has been released (though not compiled for android use yet)
Great stuff guys.
scrosler said:
Good write up. Other files that wont "re-odex" are com.htc.resources.apk, com.htc.videowidget.res.apk, com.htc.weather.res.apk and framework-htc-res.apk.
The reason? The files dont have .dex files because there is no code in them. These files just carrier resources like images (for those that didint know).
The .dex files are the actual smali code that devs mod to make the ROM do crazy things
Also, an easier method can be found here: http://themikmik.com/showthread.php?12988-Tool-App-Dexo-the-Universal-Odex-Utility
It does it all and pulls the bootclass for you. And it also does /system/app/ in one simple shot.
Also, one last thing... You can just as easily pull the files back to the PC using the ADB Pull command...
Code:
adb pull /system/app ./app
adb pull /system/framework/ ./framework
EDIT: And another simple method to get your bootclass is do another ADB Pull
Code:
add pull init.rc
I find the adb pull method quicker and more simple...
You can use the method I just explained or if you want to try the framework manually then do apps seperately then you can use this: http://forum.xda-developers.com/showthread.php?t=1514576
I use that app to re-odex updated files in the ROM. For example... If Gmail updates (which it just did) I would remove the old gmail files from system/app/ and put the new one in and run that program then pull the files.
-Scott
Click to expand...
Click to collapse
hehe yep I know the adb pull command, I thought about it and I didn't put it in...
theking_13 said:
If you can, send me a PM on how to odex apps.
Sent from my HTC One X using Tapatalk 2
Click to expand...
Click to collapse
You confused bro?
Thanks. Even though I won't ever be doing this, it's good to know what's going on.
This is awesome. Thanks so much for this. I wanted to know how to odex and deodex roms.
Sent from my HTC One XL using xda app-developers app
scrosler said:
Good write up. Other files that wont "re-odex" are com.htc.resources.apk, com.htc.videowidget.res.apk, com.htc.weather.res.apk and framework-htc-res.apk.
The reason? The files dont have .dex files because there is no code in them. These files just carrier resources like images (for those that didint know).
The .dex files are the actual smali code that devs mod to make the ROM do crazy things
Also, an easier method can be found here: http://themikmik.com/showthread.php?12988-Tool-App-Dexo-the-Universal-Odex-Utility
It does it all and pulls the bootclass for you. And it also does /system/app/ in one simple shot.
Also, one last thing... You can just as easily pull the files back to the PC using the ADB Pull command...
Code:
adb pull /system/app ./app
adb pull /system/framework/ ./framework
EDIT: And another simple method to get your bootclass is do another ADB Pull
Code:
add pull init.rc
I find the adb pull method quicker and more simple...
You can use the method I just explained or if you want to try the framework manually then do apps seperately then you can use this: http://forum.xda-developers.com/showthread.php?t=1514576
I use that app to re-odex updated files in the ROM. For example... If Gmail updates (which it just did) I would remove the old gmail files from system/app/ and put the new one in and run that program then pull the files.
-Scott
Click to expand...
Click to collapse
Is there also a tool to deodex roms?
Sent from my HTC One XL using xda app-developers app
SkizzMcNizz said:
Is there also a tool to deodex roms?
Sent from my HTC One XL using xda app-developers app
Click to expand...
Click to collapse
Like Scott posted?
Basically that is the steps right there..you are doing the apk in the system/app and framework.
That link provides a tool which when done properly will run on the de-odexed stock Rom and odex it...
Good luck with that...it's a nightmare...haha..
SkizzMcNizz said:
Is there also a tool to deodex roms?
Sent from my HTC One XL using xda app-developers app
Click to expand...
Click to collapse
Yep Android Kitchen can do it.
Hopefully this will help to see more odex ROMs
This is the first phone I've had where developers strive to odex their roms
Something to get used to
Sent from my HTC One X using Tapatalk 2
superchilpil said:
This is the first phone I've had where developers strive to odex their roms
Something to get used to
Sent from my HTC One X using Tapatalk 2
Click to expand...
Click to collapse
Most official ROMs are odexed.
BreatheHT said:
Most official ROMs are odexed.
Click to expand...
Click to collapse
Quite the opposite where I come from
Although I came from a different carrier so this side of the forums is different
Sent from my HTC One X using Tapatalk 2
superchilpil said:
Quite the opposite where I come from
Although I came from a different carrier so this side of the forums is different
Sent from my HTC One X using Tapatalk 2
Click to expand...
Click to collapse
Nah carrier doesn't matter.
SkizzMcNizz said:
Is there also a tool to deodex roms?
Sent from my HTC One XL using xda app-developers app
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=1208320
(you'll have to update the versions included in the zip as this thread is dated - 2011)
Note: the API level for 4.0.3/4.0.4 (what our HOX's run) is '15'.
you can also use DSIXDA's kitchen which can be used to batch deodex apk's after you set the api level
(it's defaulted to '10'... which was Gingerbread -> 2.3.3-2.3.7)
Full list of API levels for their specific Android versions
BreatheHT said:
hehe yep I know the adb pull command, I thought about it and I didn't put it in...
Click to expand...
Click to collapse
Yeah, I like to do it better that way. Dont have to move my hands from the keyboard and mouse. Makes you more efficient :good:
BreatheHT said:
Most official ROMs are odexed.
Click to expand...
Click to collapse
I think all?
superchilpil said:
Quite the opposite where I come from
Although I came from a different carrier so this side of the forums is different
Sent from my HTC One X using Tapatalk 2
Click to expand...
Click to collapse
Carrier is irrelevant. Most people dont know how to work with ODEX files so they go with de-odex. Its mroe challanging but provides a better experience.
techlogik said:
Like Scott posted?
Basically that is the steps right there..you are doing the apk in the system/app and framework.
That link provides a tool which when done properly will run on the de-odexed stock Rom and odex it...
Good luck with that...it's a nightmare...haha..
Click to expand...
Click to collapse
No he is asking to go the other way from odex to de-odex.
BreatheHT said:
Yep Android Kitchen can do it.
Click to expand...
Click to collapse
JSLEnterprises said:
http://forum.xda-developers.com/showthread.php?t=1208320
(you'll have to update the versions included in the zip as this thread is dated - 2011)
Note: the API level for 4.0.3/4.0.4 (what our HOX's run) is '15'.
you can also use DSIXDA's kitchen which can be used to batch deodex apk's after you set the api level
(it's defaulted to '10'... which was Gingerbread -> 2.3.3-2.3.7)
Full list of API levels for their specific Android versions
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Yep, I love that script. I was the one that sent him the mnt point file for the HOX :highfive:
I am going to talk to him about bringing in "official" support for the Asus TF300T. I got the boot.img fiugred out this morning! Woot. **** is about to get real with the Asus!
superchilpil said:
This is the first phone I've had where developers strive to odex their roms
Something to get used to
Sent from my HTC One X using Tapatalk 2
Click to expand...
Click to collapse
its a good final touch when cook done with smali tweaks.
another benefit is sorta kang-protection

How can I disable 180 rotation in portrait mode and disable bootmenu options?

I recently installed the ICS Leak #2 and installed scv7, but there were several new features that annoyed me. I like to lie in bed to use my phone, so when I turn sideways, the screen turns from landscape mode to portrait mode, but the portrait mode is with the earpiece and camera at the bottom, and the buttons at the top. I have never had a problem with this with gingerbread/scv5. If anybody could tell me any way to disable it, that would be great, and I think the default launcher installed with scv7 is Holo Launcher, if I'm not mistaken.
One more thing, I had to install the Bootmenu manager when I was installing scv7, and everytime I hold the power button, then tap "Power off", I'm greeted with a list of options such as "Normal shutdown, reboot, and many other ones that I don't need, is there any way to disable this, and possibly add reboot back to the main list, like scv5?
Thanks.
CM9onmyMoPho said:
I recently installed the ICS Leak #2 and installed scv7, but there were several new features that annoyed me. I like to lie in bed to use my phone, so when I turn sideways, the screen turns from landscape mode to portrait mode, but the portrait mode is with the earpiece and camera at the bottom, and the buttons at the top. I have never had a problem with this with gingerbread/scv5. If anybody could tell me any way to disable it, that would be great, and I think the default launcher installed with scv7 is Holo Launcher, if I'm not mistaken.
One more thing, I had to install the Bootmenu manager when I was installing scv7, and everytime I hold the power button, then tap "Power off", I'm greeted with a list of options such as "Normal shutdown, reboot, and many other ones that I don't need, is there any way to disable this, and possibly add reboot back to the main list, like scv5?
Thanks.
Click to expand...
Click to collapse
Please don't re-post your issues, regardless of whether you feel you originally posted in an incorrect sub-forum. Ask one of the moderators to look at your post, and request it to be moved if necessary. You now have two posts with this issue (First one being HERE), and it clutters up the forum when people do this sort of thing.
As for the power menu found in the BootMenu app, that's just part of the application. You might find it very useful later on down the line. If you're just wanting to reboot, it only adds one additional click, so I wouldn't concern yourself too much over it. And, like I said, it may come in handy (and save your arse) at some point...
I think I may have just soft bricked my phone again. Stuck on the boot screen now, with the flashy scv7 thing. I edited framework-res.apk but must have improperly put it back.
CM9onmyMoPho said:
I think I may have just soft bricked my phone again. Stuck on the boot screen now, with the flashy scv7 thing. I edited framework-res.apk but must have improperly put it back.
Click to expand...
Click to collapse
you probably didnt set the permissions?
souljaboy said:
you probably didnt set the permissions?
Click to expand...
Click to collapse
yeah, i think. any way to fix this besides resetting the phone?
i can use project lense recovery right when the boot up occurs though.
did you try the fix permissions option in boot menu?
RoadToNever said:
did you try the fix permissions option in boot menu?
Click to expand...
Click to collapse
just tried it, still stuck on the scv7 screen
CM9onmyMoPho said:
just tried it, still stuck on the scv7 screen
Click to expand...
Click to collapse
It may be the edits, or how it was compiled.. Sometimes it's best to just do your edit, compile, then copy the edited files back to the original apk. In this case with the /values folder edits, they end up in the resources.arsc - move your newly compiled one back to the original apk with 7-zip/winrar. And actually with the framework-res.apk, you usually need to have no compression on the resources.arsc... copy that new resources.arsc somewhere next to the original apk, then add it to the archive in "store" mode - no compression with 7-zip.
alteredlikeness said:
It may be the edits, or how it was compiled.. Sometimes it's best to just do your edit, compile, then copy the edited files back to the original apk. In this case with the /values folder edits, they end up in the resources.arsc - move your newly compiled one back to the original apk with 7-zip/winrar. And actually with the framework-res.apk, you usually need to have no compression on the resources.arsc... copy that new resources.arsc somewhere next to the original apk, then add it to the archive in "store" mode - no compression with 7-zip.
Click to expand...
Click to collapse
How do I move it with winrar? I can't access anything besides the project lense recovery menu.
CM9onmyMoPho said:
How do I move it with winrar? I can't access anything besides the project lense recovery menu.
Click to expand...
Click to collapse
I meant on your computer.... how did you make the edits? framework-res.apk/res/values/bools.xml?
Well, you are probably going to have to restore a backup first. Unless you can make a flashable zip with a working version of the apk you edited, take out your sdcard and use a reader to access it on your comp - then flash that instead of an entire system restore.
alteredlikeness said:
I meant on your computer.... how did you make the edits? framework-res.apk/res/values/bools.xml?
Well, you are probably going to have to restore a backup first. Unless you can make a flashable zip with a working version of the apk you edited, take out your sdcard and use a reader to access it on your comp - then flash that instead of an entire system restore.
Click to expand...
Click to collapse
I made the edits with apktools on my computer, I sent the file on my phone to my computer, then the finished product from my computer back to my phone.
CM9onmyMoPho said:
I made the edits with apktools on my computer, I sent the file on my phone to my computer, then the finished product from my computer back to my phone.
Click to expand...
Click to collapse
Right. So you probably need to redo it. Is the original META-INF folder in your finished apk?
I would just decompile a fresh one..
Edit the bools only..
Compile..
Then move the new resources.arsc to the old apk in store mode..
Then use root explorer or a zip or adb.. but set proper permissions.
Sent from my phone's mind
So does that mean i have to do a reset on my phone again? Because I can't access root explorer right now.
CM9onmyMoPho said:
So does that mean i have to do a reset on my phone again? Because I can't access root explorer right now.
Click to expand...
Click to collapse
Are you still bootlooping? You need to go into recovery and restore, or flash a ROM again first..
Sent from my phone's mind
Not sure how well this would work, but worth a shot: https://play.google.com/store/apps/details?id=nl.fameit.rotate
Sent from my rooted Mayan Calendar

Categories

Resources