[HELP] framework.jar changes on Nougat - post rom installation - Android Q&A, Help & Troubleshooting

Hello,
I'm using nougat custom rom on my device, (CM/LOS based ) - i.e it is already installed.
I wish to edit the framework.jar internal dex files - AFTER/POST installation of the rom.
I know I can & how to edit the dex & jar, I already made it.
note: I wish to make those change POST rom compiling, since i'm not a rom dev nor know how to compile a rom ( nor need/want to waste time to know how ).
i.e the changes I want to make are to bin/compiled framework.jar that is already installed on the phone.
My problem is that after I replace the orig framework.jar (/system/framework/framework.jar) with the modded one, I get bootloop with errors like:
Code:
Failed to open dex file from oat file. File: /system/framework/framework.jar:classes2.dex Error: Failure to verify dex file '/system/framework/framework.jar:classes2.dex': Bad checksum (0c7053f1, expected 282a531b)
Code:
Could not create image space with image file '/system/framework/boot.art'.
Attempting to fall back to imageless running.
Error was:
Failed to generate image '/data/dalvik-cache/arm/[email protected]@boot.art':
Failed execv(/system/bin/dex2oat --image=/data/dalvik-cache/arm/[email protected]@boot.art --dex-file=/system/framework/core-oj.jar --dex-file=/system/framework/core-libart.jar --dex-file=/system/framework/conscrypt.jar --dex-file=/system/framework/okhttp.jar --dex-file=/system/framework/core-junit.jar --dex-file=/system/framework/bouncycastle.jar --dex-file=/system/framework/ext.jar --dex-file=/system/framework/framework.jar --dex-file=/system/framework/telephony-common.jar --dex-file=/system/framework/voip-common.jar --dex-file=/system/framework/ims-common.jar --dex-file=/system/framework/apache-xml.jar --dex-file=/system/framework/org.apache.http.legacy.boot.jar --dex-file=/system/framework/telephony-ext.jar --dex-file=/system/framework/org.dirtyunicorns.utils.jar --dex-file=/system/framework/telephon
Attempted image: /system/framework/boot.art
after I upload the modded jar I made sure it got 644 permissions & I wipe dalvik&cache from recovery.
I even tried the above + wiping "/data/dalvik-cache/arm/[email protected]@boot.art" - but still got bootloop...
I know i'm really close to success... but I know i'm missing something...
I think that [email protected]@boot.art isn't "regenerate" when I wipe dalvik&cache or when I wipe it manually.
I think also it have something to do with build.prop values like "dalvik.vm.dexopt-data-only=1" or "dalvik.vm.dexopt-flags=m=v,o=y"
if I could only bypass the checksum... everything I guess would work.
I hope someone can help me ( or tell me which sub-forum in xda can help me with this Q ).\
edit:
I understand now that because I hex edit the classes.dex of framework.jar I get that "checksum error" because I should *somehow* "re-calculate" the checksum for that dex file.
I wonder how to do that, without decompiling &recompiling the dex.... anyone ?
I'll appreciate any help,
Thanks.

Related

[Q] how to add a new libstagefright.so to gingerbread

whenever i add a new '.so' file ( like libstagefright.so, libc.so,,) then the tab (GT P1000) reboots in a loop. what is the reason for this ?
the steps i followed to build '.so' files are.
i got root access in the tab by modifying the default.prop file
i have busybox ( /sbin/busybox)
then downloaded the source cm7sg from git hub. and built the gingerbread for cyanogen_galaxytab
then in recovery mode ,i used adb to push the cm7sg/out/target/product/galaxytab/system/lib/libstagefright.so to the tab
then the system reboots in a loooop................
U dont write about it: Did u give permissions (rw-r-r) for this files?
Sent using r800i with DoomKernel v11 (1.21ghz)
yes , the permission is the same ..
I'm not into lib files, so i think that only thing i can do to help u is giving this link: http://forum.xda-developers.com/showthread.php?t=1525226.
It's a beatsaudio port. Inside .zip are some .so files which are working without bootloops, so i think that they need to do sth to make it working. Maybe u can find sth there
Any integrity checking mechanism for library files (libstagefright / libc) during initialization time such as signature validation, CRC checking, size checking etc?

arg uot kitchen help

can anyone help me with uot kitchen. I am having no luck.
I am getting error in 'filename' (status 0)
i am on the stock rom (global) but rooted (fake ciid)
i have used uot on my other 2 phones with no issues even with odexed roms
i want a simple battery mod (version s, big sense) for now
i uploaded the proper files but it wont flash. so
which update binary should I use. I always used the type mtd default but I never had twrp before
suggestions
am I using the wrong update binary
should I just push them manually
do I need to delete the odex ( i didnt have to do this before)
pushing the files manually made no difference even though I checked the framework and it was fixed
renaming the framework-res.odex and framework-res.jar made the phone not boot i fixed tha tin fwrp filemanager (a great recovery by the way. I could not remount system in adb at the time)

[Q] Unpack boot.img. How to do?

Welcome.
For a long time I get tired of the boot.img file. I do not know what I'm doing wrong but I can not decompile it to the form that let would to edit. He wants to make some changes in files and default.prop init.rc but I can not because the only file which me to unpacks zImage file is empty, or if I use another tool I received an error "android magic not found" (magical first 7 letters of also I added Hexedit but still the same error).
Here you can download the file boot.img of the fight:
boot.img - 7.44 MB
I have tried programs:
- Android-Kitchen-master
- Android Image Kitchen
- bootimg_tools
- unmkbootimg
- kernel-tools-master
- linux_kernelkitchen-0.002
But unfortunately without success
If someone manages to successfully dismantle this file I would really ask for instructions on how to go about it.
Thank you in advance for your help and sorry for my poor english.

Editing FW update image file

Hello!!!
I need to replace a few files from a Firmware update image. I tried two ways ways:
1- editing straight in WinRAR
2- Unzipping, editing and compressing again
In both cases the IMG file looked right. test for problems runs fine, no issues, but when I try to update the device it won't pass on package check and the operation is aborted. I tried to save in both ZIP and IMG extensions, doesn't work in either one.
IMHO it must be related to checksum error. How can it be fixed?
The device is a Geniatech Media Center ARTV1220 running Android 4.2.2
Any clues?

Where do I get the latest ROM with security update to start with modding

Hi,
I have a T-Mobile S5 and I'd like to get a link to the stock ROM with latest security upgrades so that I can debloat and mod it.
Can anyone point me to some resources on how to debloat and create a custom ROM.
Is it possible to use the international ROM and flash it on the T-Mobile S5?
Thanks
1) Download the ROM
Download from sammobile.com (look for G900T, latest should be ~April 2017)
You'll need to make an account (free), and it's pretty slow, but there isn't really an option.
You might be able to grab the international version, but I haven't tried. I heard it's not compatible with some of the US locked versions, but the T-Mobile and AT&T versions were supposed to be exactly the same so they shouldn't have a problem. Also, it probably won't come with Wifi Calling.
2) Extract zip with `unzip` and then, extract the .tar.md5 with `tar -xf`
3) Download sgs2ext4.zip (google it:
forum.xda-developers.com/attachment.php?attachmentid=645192) and extract it
4) Run `java -jar sgs2ext4.jar system.ext4.img system.img` (and then do the same for cache).
5) Mount both images (`mount -o loop system.img system/` and same for cache).
6) Get `sec_csc.zip` from the cache folder and extract it.
7) Make a copy of the system/ mounted folder, chown it to yourself so that you can easily modify it later on.
8) Merge system/ folder from extracted sec_csc.zip with the system/ folder you created.
9) Copy boot.img and system/ into a new folder, let's call it build/
10) Get a copy of META-INF (update-binary is the important one) and also place it in build/
11) Use the updater-script from here: https://forum.xda-developers.com/tm...pment/odexed-development-starter-kit-t3386186 and delete everything between "Symlinking and Setting Permissions" to show_progress (aka get rid of all of the set_metadatas).
12) Generate appropriate permissions (as described here: https://forum.xda-developers.com/tm...pment/odexed-development-starter-kit-t3386186) and place them right after "Symlinking and Setting Permissions".
13) At this point, you should be able to zip everything up and install on your phone. This is a fresh full ROM with no mods and all the bloat.
14) Delete and don't forget to also remove set_metadatas that correspond to whatever you deleted or else the updater will complain that something might have failed. My old post (again: https://forum.xda-developers.com/tm...pment/odexed-development-starter-kit-t3386186) also describes a couple of simple mods you're likely to make.
Note that if you disable selinux, you might not have to deal with permissions, but I think you have to modify boot.img for that, and I don't know how to do that. (Aside: Almost all ROMs posted not by me on this forum have selinux disabled. EG: if you install them, on every boot, it will say something about kernel not being selinux enforcing.) If you need more advanced modding, you'll need to deodex. I don't know how to do that and have never needed to. You'll have to look somewhere else for guides for that.

Categories

Resources