Related
hey guys.. i been looking around everywhere to try and get a good explanation of the files inside the rom.zip... like what the files are in the META-INF? and what are all the files inside the system folder? how do i know what to change and what not to change.. lol sorry but if anyone could possibly give me a more in depth explanation i would appreciate it greatly!!!
i dont have answer but i would also like to know this... since im just trying to learn how be a dev...
lol seems no one can help us... but this did help a little... http://forum.androidcentral.com/hacking/6037-general-rom-faq.html
Hi
The files in META-INF are just that, meta files they contain information about the files that are part of the rom.. specifically CERT.* and MANIFEST.MF contain the SHA1 hash of each file in the rom when you flash the rom your recovery environment hashes each file and checks it against the manifest. These files are created during the signing process.
META-INF/com/google/android/updater-script tells the recovery environment what to actually do. such as format /system then extract system to /system on the phone, set permissions for each file and the correct kernel to your boot.img then reflash it
the files in /system are the actual operating system and are in a UNIX-ish layout
executable's in bin & xbin, system apks in app, configuration files in etc, libraries in lib, ringtones and bootanim in media
rattking said:
Hi
The files in META-INF are just that, meta files they contain information about the files that are part of the rom.. specifically CERT.* and MANIFEST.MF contain the SHA1 hash of each file in the rom when you flash the rom your recovery environment hashes each file and checks it against the manifest. These files are created during the signing process.
META-INF/com/google/android/updater-script tells the recovery environment what to actually do. such as format /system then extract system to /system on the phone, set permissions for each file and the correct kernel to your boot.img then reflash it
the files in /system are the actual operating system and are in a UNIX-ish layout
executable's in bin & xbin, system apks in app, configuration files in etc, libraries in lib, ringtones and bootanim in media
Click to expand...
Click to collapse
wow rattking thank you very much!! that was the best description anyone has ever given me!!! lol that was very helpful!! is there a place where you learn this from? or did you just figure it out as you went..?
[MOD] Internal <> External storage "swap" for 4.2.2. Simply, easy, safe.
UPDATE 26.06.2013
OK, we are alive again!
Some users have reported about boot loop. Use it at your own risk (be ready to use backup or ExternalStorageRestore).
ExternalStorageFullSwap_v1 for 10.3.A.0.423 DEODEX
ExternalStorageRestore_v1 for 10.3.A.0.423 DEODEX
Install it from Recovery.
Best swap solution. No root, no init.d, no remounts, exFAT support, easy to restore, full emulated storage support (4.2.2).
System will work as usual, sdcard0 will still be internal storage, sdcard1 will still be real SD-card. But all (most) apps (and games) will use sdcard1 as global storage path (getExternalStorageDirectory).
It is for any DEODEXED ROM based on 10.3.A.0.423 (4.2.2).
Patch will replace only one file - framework.jar and will not swap sdcard0 and sdcard1 (in reality). sdcard0 will still be internal storage, sdcard1 will still be real SD-card. If anything will go wrong just restore original framework.jar.
Kyrie1965 said:
It is for any DEODEXED ROM based on 10.1.A.1.434.
Patches will replaces only one file - framework.jar and will not swap sdcard0 and sdcard1 (in reality). sdcard0 will still be internal storage, sdcard1 will still be real SD-card.
There are two versions:
ExternalStoragePartialSwap (recommended). Install it from Recovery. This patch is doing one simple and outstanding thing - change EXTERNAL_STORAGE_ANDROID_DATA_DIRECTORY, EXTERNAL_STORAGE_ANDROID_MEDIA_DIRECTORY, EXTERNAL_STORAGE_ANDROID_OBB_DIRECTORY to external storage (sdcard1).
Most of games and apps stores their data and cache at /sdcard0/Android/data, /sdcard0/Android/obb, /sdcard0/Android/media. sdcard0 - is internal storage. After patching games and apps will use /sdcard1/Android/data, /sdcard1/Android/obb, /sdcard1/Android/media. After patch applying you need to move Android folder from sdcard0 to sdcard1 (by any file manager). Most of all other apps will use internal storage as usual.
ExternalStorageFullSwap (not recommended). Install it from Recovery. This patch is doing one simple and outstanding thing - change EXTERNAL_STORAGE_DIRECTORY to external storage (sdcard1).
Most of all apps will use sdcard1 as internal storage. By default when apps asks for a storage dir (getExternalStorageDirectory), system returns "/storage/sdcard0". After patch it will be "/storage/sdcard1" by default.
If anything will go wrong just restore original framework.jar (DEODEX, 10.1.A.1.434) ExternalStorageRestore. Install it from Recovery.
Click to expand...
Click to collapse
Hey Thank u for mod... Reserved..
Kyrie1965 said:
It is for any DEODEXED ROM based on 10.1.A.1.434.
Patches will replaces only one file - framework.jar and will not swap sdcard0 and sdcard1 (in reality). sdcard0 will still be internal storage, sdcard1 will still be real SD-card.
There are two versions:
ExternalStoragePartialSwap. Install it from Recovery. This patch is doing one simple and outstanding thing - change EXTERNAL_STORAGE_ANDROID_DATA_DIRECTORY, EXTERNAL_STORAGE_ANDROID_MEDIA_DIRECTORY, EXTERNAL_STORAGE_ANDROID_OBB_DIRECTORY to external storage (sdcard1).
Most of games and apps stores their data and cache at /sdcard0/Android/data, /sdcard0/Android/obb, /sdcard0/Android/media. sdcard0 - is internal storage. After patching games and apps will use /sdcard1/Android/data, /sdcard1/Android/obb, /sdcard1/Android/media. After patch applying you need to move Android folder from sdcard0 to sdcard1 (by any file manager). Most of all other apps will use internal storage as usual.
ExternalStorageFullSwap. Install it from Recovery. This patch is doing one simple and outstanding thing - change EXTERNAL_STORAGE_DIRECTORY to external storage (sdcard1).
Most of all apps will use sdcard1 as internal storage. By default when apps asks for a storage dir (getExternalStorageDirectory), system returns "/storage/sdcard0". After patch it will be "/storage/sdcard1" by default.
NO need root, init.d, etc. exFAT support (if you have exFAT mod). Absolutly safe (system will work as usual).
If anything will go wrong just restore original framework.jar (DEODEX, 10.1.A.1.434) ExternalStorageRestore. Install it from Recovery.
Click to expand...
Click to collapse
Awesome! Could you please tell me which files and lines you edited, so I can edit it myself for any ROM I use? (In case this mod breaks some tweaks and mods implemented in the jar file of the ROM)
Ape187 said:
Could you please tell me which files and lines you edited...
Click to expand...
Click to collapse
framework.jar > android > os > Environment.smali (constructor <clinit> method)
Just use any comparing tool and compare original and patched files.
Kyrie1965 said:
framework.jar > android > os > Environment.smali (constructor <clinit> method)
Just use any comparing tool and compare original and patched files.
Click to expand...
Click to collapse
Okay, thanks. I use notepad++ for editing.
Is it possible to have another version for stock rom?
Explain More
Kyrie1965 said:
framework.jar > android > os > Environment.smali (constructor <clinit> method)
Just use any comparing tool and compare original and patched files.
Click to expand...
Click to collapse
Could you please Elaborate More- I didn't understand Because ExternalStoragePartialSwap_434.zip file contains Only one file framework,jar file.
After extracting the This jar file , I have found 3 files inside-- classes.dex, MANIFEST.MF, and preloaded-classes.
I didn't Understand for "framework.jar > android > os > Environment.smali (constructor <clinit> method)", Where Can I find this and How !
Plz explain.
Thanks-- Anil
anielkumar said:
Could you please Elaborate More- I didn't understand Because ExternalStoragePartialSwap_434.zip file contains Only one file framework,jar file.
After extracting the This jar file , I have found 3 files inside-- classes.dex, MANIFEST.MF, and preloaded-classes.
I didn't Understand for "framework.jar > android > os > Environment.smali (constructor <clinit> method)", Where Can I find this and How !
Plz explain.
Thanks-- Anil
Click to expand...
Click to collapse
My message about Environment.smali was not for ordinary users. Only for users who know what is decompile, java, dalvik, etc.
After Flash Getting FC for user Installed App and Game not Starting
Hi,
I have flashed the ExternalStoragePartialSwap_434.zip thru TWRP in my C6602/sony Z.
I have doomloard v6 kernel and Glass Xperia V2. But after flashed i was getting FC for Linked Application using Link2SD.
Even if I unlinked the App , Still I am unable to Run. Game is also not launching.
So I have Re flashed ur ExternalStorageRestore file to Back original state.
I think this Patch need more testing.
I am also Semi Developer and tester. I have worked on Visual Studio.
Little bit I know Java.
It will help for me if you guide about What Compiler / decompiler use for Patching for framework.jar.
I have work on Eclipse.
Thanks--
anielkumar said:
Hi,
I have flashed the ExternalStoragePartialSwap_434.zip thru TWRP in my C6602/sony Z.
I have doomloard v6 kernel and Glass Xperia V2. But after flashed i was getting FC for Linked Application using Link2SD.
Even if I unlinked the App , Still I am unable to Run. Game is also not launching.
So I have Re flashed ur ExternalStorageRestore file to Back original state.
I think this Patch need more testing.
I am also Semi Developer and tester. I have worked on Visual Studio.
Little bit I know Java.
It will help for me if you guide about What Compiler / decompiler use for Patching for framework.jar.
I have work on Eclipse.
Thanks--
Click to expand...
Click to collapse
I use gui apk tool for decompiling/compiling (available here) and for editing the .smali files I use notepad++.
BTW, I use Windows 7 64bit for it.
GL2SD (temp Solution)
Ape187 said:
I use gui apk tool for decompiling/compiling (available here) and for editing the .smali files I use notepad++.
BTW, I use Windows 7 64bit for it.
Click to expand...
Click to collapse
Hi
Thanks. I am on it.
Mean while I am using GL2SD program for "data and obb" files for running the Games or Apps from SD1 card (ExternelSD).
External_storage_dumb ?
Kyrie1965 said:
framework.jar > android > os > Environment.smali (constructor <clinit> method)
Just use any comparing tool and compare original and patched files.
Click to expand...
Click to collapse
Hi,
I have decompile the framework.jar files (Both modified one and Original one).
Modifed (Your framework.jar) contains Following Line:
const-string v2, "EXTERNAL_STORAGE_DUMB"
const-string v3, "/storage/sdcard1"
Original ( from deodexed rom) contains Following Line:
const-string v2, "EXTERNAL_STORAGE"
const-string v3, "/storage/sdcard0"
So, Why have u modified ---
EXTERNAL_STORAGE To EXTERNAL_STORAGE_DUMB ???????????????
for Sdcard0 to Sdcard1 is OK.
Plz Check ?
Currently I am on progress......
anielkumar said:
So, Why have u modified ---
EXTERNAL_STORAGE To EXTERNAL_STORAGE_DUMB ???????????????
Click to expand...
Click to collapse
EXTERNAL_STORAGE is environment variable. If it exists system will use it value (path) and not your. It is not good and you must prevent it. EXTERNAL_STORAGE_DUMB is not exist at any case.
Please do not post such questions here. This topic is not for that.
Can we use this mod with rooted stock .434 version? Is anyone tried?
Sent from my C6603 using xda app-developers app
HoboTR said:
Can we use this mod with rooted stock .434 version? Is anyone tried?
Click to expand...
Click to collapse
No, you cann't. You need deodexed ROM.
Yep tried it on a stock rom and as he mentioned, it's not working in a stock rooted rom.
If he can manage to pull this off for stock roms it'd be really great, nice work though man. keep it up.
Can you share the smali script about swapping internal storage from framework.jar ?
danisariandi said:
Can you share the smali script about swapping internal storage from framework.jar ?
Click to expand...
Click to collapse
Here you go. The file is attached. Just unzip it. This is the full swap one.
Ape187 said:
Here you go. The file is attached. Just unzip it. This is the full swap one.
Click to expand...
Click to collapse
Could you give me a tutorial ?
Sent by brand new mindmap
danisariandi said:
Could you give me a tutorial ?
Sent by brand new mindmap
Click to expand...
Click to collapse
Of course.
First things first, you must have Java installed on your Windows computer and set the path variables. To do this go to Control Panel>System and Security>System>Advanced, till it looks someting like this. I have downloaded the 32bit version of java. It might look different to you. Just copy the path of your java bin folder and add it to the path field. Be sure to add a semicolon after the last entry before you add it.
After that install the program from here. It requires .NET Framework, but the necessary files you will find there.
Next thing, open the GUI apktool, select your framework.jar file you extracted from the .434 firmware and decopile shown here. Be sure to keep the original, you will need it later. I unticked the "Sign recently compiled apk?" box for safety. Check always the log after decompiling/compiling before doing anything!
After that, go to the decompiled path located in your personal folder. You can simply go there by clicking "Open decompiled output directory". Don't close the program. Go to framework.jar>smali>android>os and replace the Environment.smali I posted.
Then go to the program again and compile it. Name the compiled file "framework.jar" (without the quotes) for simplicity's sake. After it successfully compiled, go to the path by clicking on "Open compiled output directory" and open it with 7zip (very useful tool). Open your original framework.jar as well. Drag and drop the classes.dex file from your recently compiled file to your original and overwrite it. Don't flash the freshly compiled file, or the ROM will not boot.
All you need to do now, is to put it into a flashable zip and flash it via recovery. For safety, make a flashable zip with your untouched framework.jar in case something went wrong.
I hope, I covered everything. If I made some errors, then anyone can correct me.
i want to save some custom apps that i have moved to system when i install CM updates. so i want to add them to a script in addon.d
these app folders seem to have the apk and an empty lib folder. adding the apk seems easy, but how exactly do i tell the script to also backup the 'lib' folder and restore it?
thanks.
Wanting to know the same thing as well. Sad that this question is ignored :/ hoping this comment would bump this up
Or have you YOLOd and tried with the folder names in the addon.d script?
I deleted the system app Radio3 in the firmware for D5803 23.5.A.1.291.
When I tried to put it back by recreating /system/app/Radio3 and I put in it:
Radio3.apk
and also created
/system/app/Radio3/oat/arm/
with a symlink to
/system/odex.app/arm/Radio3.odex
All files owned and group of "root" and with permissions 644, yet when I try to open Radio3 I get:
Code:
11-21 18:39:25.233 1384 1384 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.sonyericsson.fmradio.ui.FmRadioActivity" on path: DexPathList[[zip file "/system/app/Radio3/Radio3.apk"],nativeLibraryDirectories=[/system/app/Radio3/lib/arm, /vendor/lib, /system/lib]]
11-21 18:39:25.233 1384 1384 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
This makes me think that I'm supposed to also have /system/app/Radio3/lib/arm, but in my download of 23.5.A.1.291, I can't seem to find any lib directory in /system/app/Radio3. Can anyone here running 23.5.A.1.291 confirm that there is supposed to be some libs in /system/app/Radio3/lib/arm, and what those files are and where I might find them?
Cheers!
------------
EDIT: over 100 people have viewed this thread and no replies. Comeon folks. This is an easy one. Surely one of the 100 people is running 23.5.A.1.291. All you have to do is open up your file explorer app and look in /system/app/Radio3/ and tell me if there's a lib/ directory in there. Pretty please!
apexofservice said:
I deleted the system app Radio3 in the firmware for D5803 23.5.A.1.291.
When I tried to put it back by recreating /system/app/Radio3 and I put in it:
Radio3.apk
and also created
/system/app/Radio3/oat/arm/
with a symlink to
/system/odex.app/arm/Radio3.odex
All files owned and group of "root" and with permissions 644, yet when I try to open Radio3 I get:
Code:
11-21 18:39:25.233 1384 1384 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.sonyericsson.fmradio.ui.FmRadioActivity" on path: DexPathList[[zip file "/system/app/Radio3/Radio3.apk"],nativeLibraryDirectories=[/system/app/Radio3/lib/arm, /vendor/lib, /system/lib]]
11-21 18:39:25.233 1384 1384 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
This makes me think that I'm supposed to also have /system/app/Radio3/lib/arm, but in my download of 23.5.A.1.291, I can't seem to find any lib directory in /system/app/Radio3. Can anyone here running 23.5.A.1.291 confirm that there is supposed to be some libs in /system/app/Radio3/lib/arm, and what those files are and where I might find them?
Cheers!
------------
EDIT: over 100 people have viewed this thread and no replies. Comeon folks. This is an easy one. Surely one of the 100 people is running 23.5.A.1.291. All you have to do is open up your file explorer app and look in /system/app/Radio3/ and tell me if there's a lib/ directory in there. Pretty please!
Click to expand...
Click to collapse
So this is what happened,since your system is odexed it will have its lib folder with the odex file inside it,probably the reason it isn't working is because you have only copied the apk and not the lib folder,causing the app not to launch since its odex file is missing.
The way you can make it work is:
1. Reflash the firmware of your device
2. The complicated route,extract the system files of a firmware file from 23.5.A.1.291,find folder Radio3 and copy it to your device.
Hope that will clear some things up!
Dinkec27 said:
So this is what happened,since your system is odexed it will have its lib folder with the odex file inside it,probably the reason it isn't working is because you have only copied the apk and not the lib folder,causing the app not to launch since its odex file is missing.
The way you can make it work is:
1. Reflash the firmware of your device
2. The complicated route,extract the system files of a firmware file from 23.5.A.1.291,find folder Radio3 and copy it to your device.
Hope that will clear some things up!
Click to expand...
Click to collapse
Thanks for the reply, but what you're saying doesn't match with what I'm observing.
1st, I don't find any odex files inside the lib folders, what I *do* see is symlinks inside oat/arm/ (for each system app) which point to ../../../odex.app/APPNAME.odex.
2nd, I have already done what you're calling the "complicated route", I extracted the system.ext4 from 23.A.1.5.291 and I mounted it and looked inside app/Radio3, but I don't see any lib/ directory there.
So, if you look at the error message I posted, you'll see that something is providing paths for libraries /vendor/lib, /system/lib, and /system/app/Radio3/lib. Well, I do see libradio...so in /system/lib, but I suppose this is a shared object for the cellular radio for the phone, not the FM Radio. Since /system/app/Radio3/lib doesn't exist, I wonder if it *should* exist. Like I said, I don't see any such folder in the firmware system partition that I extracted, but I supposed that it was also possible that something else was part of the install process that I'm missing. I'm basically looking for a sanity check here. Can someone who's running this firmware please tell me what you see inside /system/lib/Radio3. Pretty please?
In terms of your solution 1, it's not feasible for me since I spent a lot of time removing bloatware from my system partition (a lot of google apps, a lot of sony apps and other stuff that I don't want and don't use), so I don't want to reflash the whole partition and have to go back through and remove all that stuff again.
Surely someone on this forum is running 23.5.A.1.291 and can just tell me what you see in /system/app/Radio3. Puh-leez.
------------
EDIT: maybe when you say "it will have it's lib folder with its odex file inside it" you mean that instead of Radio3/oat/arm/Radio3.odex that I should have Radio3/lib/oat/arm/Radio3.odex? If so, that would be curious since it's not the same structure I see in the other apps in the /system dir and it's not what I see in the system partition I extracted, but I can try it. However, what would be really helpful is if someone running this firmware can confirm the file structure on their device.
apexofservice said:
Thanks for the reply, but what you're saying doesn't match with what I'm observing.
1st, I don't find any odex files inside the lib folders, what I *do* see is symlinks inside oat/arm/ (for each system app) which point to ../../../odex.app/APPNAME.odex.
2nd, I have already done what you're calling the "complicated route", I extracted the system.ext4 from 23.A.1.5.291 and I mounted it and looked inside app/Radio3, but I don't see any lib/ directory there.
So, if you look at the error message I posted, you'll see that something is providing paths for libraries /vendor/lib, /system/lib, and /system/app/Radio3/lib. Well, I do see libradio...so in /system/lib, but I suppose this is a shared object for the cellular radio for the phone, not the FM Radio. Since /system/app/Radio3/lib doesn't exist, I wonder if it *should* exist. Like I said, I don't see any such folder in the firmware system partition that I extracted, but I supposed that it was also possible that something else was part of the install process that I'm missing. I'm basically looking for a sanity check here. Can someone who's running this firmware please tell me what you see inside /system/lib/Radio3. Pretty please?
In terms of your solution 1, it's not feasible for me since I spent a lot of time removing bloatware from my system partition (a lot of google apps, a lot of sony apps and other stuff that I don't want and don't use), so I don't want to reflash the whole partition and have to go back through and remove all that stuff again.
Surely someone on this forum is running 23.5.A.1.291 and can just tell me what you see in /system/app/Radio3. Puh-leez.
------------
EDIT: maybe when you say "it will have it's lib folder with its odex file inside it" you mean that instead of Radio3/oat/arm/Radio3.odex that I should have Radio3/lib/oat/arm/Radio3.odex? If so, that would be curious since it's not the same structure I see in the other apps in the /system dir and it's not what I see in the system partition I extracted, but I can try it. However, what would be really helpful is if someone running this firmware can confirm the file structure on their device.
Click to expand...
Click to collapse
I don't have the lib folder there,only the apk,but not sure if there is a difference between SLiMM ROM and the stock firmware.
If you want I can send you my Radio3.apk and you can try that
Dinkec27 said:
I don't have the lib folder there,only the apk,but not sure if there is a difference between SLiMM ROM and the stock firmware.
If you want I can send you my Radio3.apk and you can try that
Click to expand...
Click to collapse
Thanks so much for checking. To me, this suggests that perhaps I have the permissions wrong (or something along those lines). I'm wondering if that's supposed to be a regular link to the odex file instead of a symlink. I'd be happy to check out your Radio3.apk to see if its any different than the one I've got. I'll just diff it first.
apexofservice said:
Thanks so much for checking. To me, this suggests that perhaps I have the permissions wrong (or something along those lines). I'm wondering if that's supposed to be a regular link to the odex file instead of a symlink. I'd be happy to check out your Radio3.apk to see if its any different than the one I've got. I'll just diff it first.
Click to expand...
Click to collapse
And it's solved! I double-checked the permissions on the oat/arm dirs I had made and they were at 744 instead of 755, changed that and now I'm working.
Cheers
Hi!
i don't know how to make a module so i want replace file in system/etc (file i want replace fonts.xml)
so can anyone help?!?
All the instructions you need are right here:
https://topjohnwu.github.io/Magisk/guides.html
Hi Sorry i try to read it (and look half internet) to understand how to simply replace a file with magisk. Maybe it has changed with version 24? Please link some source where it's easly explained how this task could be achieved.
Isn't this what you are looking for? https://topjohnwu.github.io/Magisk/guides.html#the-system-folder
The system folder
All files you want to replace/inject should be placed in this folder. This folder will be recursively merged into the real /system; that is: existing files in the real /system will be replaced by the one in the module’s system, and new files in the module’s system will be added to the real /system.
Click to expand...
Click to collapse