[Tutorial]How To Swap Internal & External Storage (Xperia 2012) - Sony Xperia T, TL, TX, V

[Tutorial]How To Swap Internal & External Storage​This Swap Mod is based on This Thread
So Thanks and Credit should be Kyrie1965
I think this mod will be compatible with all stock rom and stock based custom rom (I already tested on Stock ROM, Revelation HD, and some people already used at Warrior ROM). This mod compatible with XT, XTX and XV
....and maybe with another Xperia 2012 Phone lines​
ATTENTION:
I'm not responsible with any problems of your phone/sdcard, or any effect that could be happen.
Please make CWM Backup before do any mod.
And it's would be better if you make backup of your sdcard or internal storage first.
Wtih this mod, System will work as default, SDCard0 will still be Internal Storage, SDCard1 will still be real SD-card or Ext_Card. But after flash this mod, you can move installed apk to SDCard1 or External Storage through Titanium Backup.
You can look all your storage under /mnt folder by any File Explorer for Rooted Device from Playstore.
Here we go......
WHAT WE NEED?
Deodexed ROM
Apktool 4.2.2 : How to Decompile/Compile/Sign Apk/Jar from Rizal Lovins, see this thread
Winrar
Windows File Explorer or Total Commander
Environment.smali, download here
HOW TO
STEP 1 - PREPARATION
Follow instruction from Rizal Lovins thread, prepare any files needed (Android SDK, Apktools and Notepad++) and installed them all
Pull out your framework.jar files from /system/framework folder and copy to PC (Apktool folder)
STEP 2 - FRAMEWORK EDITING
Extract framework.jar
Goto extracted framework.jar folder and copy classes.dex file to root Apktool folder. You may renamed classes.dex
Extracting classes.dex
Open readme.txt and copy this line : java -jar baksmali-1.3.3.jar -o classout/ classes.dex
At Apktool root folder, press SHIFT + RIGHT MOUSE BUTTON and "Open Command Window Here"
Paste at Command Window and ENTER
Goto Extracted Classes.dex folder
Copy attached environment.smali to \android\os folder
Repacking classes.dex file
Open readme.txt and copy this line : java -Xmx512M -jar smali-1.3.3.jar classout/ -o new-classes.dex
Here a repacked new classes.dex file
Push new-classes.dex into framework
Open framework.jar with Winrar
Copy new-classes.dex file into framework
Delete original classes.dex file and rename new-classes.dex file to classes.dex
STEP 3 - FINISHING
Copy edited framework.jar into /system phone folder
Set permission rw-r--r--
Move to /system/framework
Restart to CWM, wipe cache and wipe dalvik
RESULT :
Thanks To :
Rizal Lovins for this thread
Kyrie1965 for this thread
Great People at http://forum.xda-developers.com/

Reserved 1

Reserved 2

I'm sorry for asking, but why should we swap INternal and sdcard? because heavy app's data files are stored in sdcard while Xperia V's internal memory is lower than its sdcard (1.97vs 3.65 Gb) so...? Can you get this straight for me?
Thanks in advance

Dis mod help phone with lower internal.... Like V has lower internal memory, swapping external memory to Internal memory gives tha internal memory more space... Yur SD Card will be seen as internal memory!!!
sent from tsubasa using XDA 4 app
---------- Post added at 12:19 AM ---------- Previous post was at 12:18 AM ----------
Thanks for dis mod buddy.... Will try ot it out on when am on PC!!!
sent from tsubasa using XDA 4 app

works like a charm buddy.....
but i notice dat all my files in SDCard1/Android re also present in SDCard0/Android
is dat how it works?

What do I do to extract the classes.dex? I get error with 7zip and winrar
Can you help me modify my files? : D

Rojikaft said:
What do I do to extract the classes.dex? I get error with 7zip and winrar
Can you help me modify my files? : D
Click to expand...
Click to collapse
using dis tool buddy.... http://forum.xda-developers.com/showthread.php?t=2195680
but if yhu like, yhu can post yur framework.jar, i ll help!

This and thank you!

Rojikaft said:
This and thank you!
Click to expand...
Click to collapse
rename & give it a shot brov... dnt forget to fix permission!
http://www20.zippyshare.com/v/98517129/file.html

whalesplaho said:
rename & give it a shot brov... dnt forget to fix permission!
http://www20.zippyshare.com/v/98517129/file.html
Click to expand...
Click to collapse
Thank you! works fine!

Rojikaft said:
Thank you! works fine!
Click to expand...
Click to collapse
enjoy mate...... my pleasure!!! :highfive:

is there any workaround for 4.3 framework.jar?

Still sort it, totaly different framework.jar on JB 4.3

Important
thunder888 said:
Still sort it, totaly different framework.jar on JB 4.3
Click to expand...
Click to collapse
Please Let Us Know When U Can Do The Swap MOD For JB 4.3 >> Cause I'm Not Going To Update To JB 4.3 Unless The Swap MOD Work With It
Thanks Bro

me too havent update...... dnt think tha script one will work too!

sirkay said:
is there any workaround for 4.3 framework.jar?
Click to expand...
Click to collapse
Did anyone find a way to do this on 4.3? Am also reluctant to upgrade until its possible.

thunder888 said:
Still sort it, totaly different framework.jar on JB 4.3
Click to expand...
Click to collapse
Is the only thing you changed in framework.jar 'sdcard0' to 'sdcard1' and 'EXTERNAL_STORAGE' to 'EXTERNAL_STORAGE_DUMB'?
The only lines in Environment.smali that could need changing are: (EDIT: changing EXTERNAL_STORAGE in environment.smali results in bootloop)
Code:
.field private static final ENV_EXTERNAL_STORAGE:Ljava/lang/String; = "EXTERNAL_STORAGE"
.............
const-string v1, "EXTERNAL_STORAGE"
and inside Environment$UserEnvironment.smali (Edit: changing these make no difference!!)
Code:
const-string v7, "EXTERNAL_STORAGE undefined; falling back to default"
invoke-static {v6, v7}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 128
const-string v3, "/storage/sdcard0"
would changing this in theory work? I haven't installed the rom yet as want to know there is a possibility to swap storage first.

I don't want to move the entire 10GB of sdcard0 into internal memory. What do I need to modify in this process to end up with about 3GB of internal storage and the rest as sdcard0?

Related

Get ics animations on any rom...!!!!

i am just copying and pasting capez's work all... credits goes to him
here's the guide...
1) First of all, you need to download and install APK MANAGER:
http://forum.xda-developers.com/showthread.php?t=695701
2) Extract with WinRAR, from the ROM you want to modify, the file framework-res.apk, that you can find in the directory \System\framework\.
3) Go to the apk manager folder and place the framework-res.apk file in the folder "place-apk-here-for-modding".
4) In the apk manager folder, double click on the file "Script". A cmd window will open.
5) Where it says "Please make your decision", write "22" and enter. Then enter "1" and enter. Then enter "9" and enter.
The script will decompile the framework-res.apk.
6) Now go to your apk manager folder, go to Projects\framework-res.apk\res\anim\.
In this folder there are the animations of your rom. They consist in some .xml files decompiled.
7) Download this:
http://www.mediafire.com/?1qjwtotg1r8umm1
8) Copy the files from the folder "anims" of the zip downloaded into the anim folder and you are asked to replace the files; choose yes. Then copy also the files from the folder "other_files" to the anim folder.
9) Now go to your apk manager folder, go to Projects\framework-res.apk\res\values\. Edit the file integers.xml and put these two lines under the line of "shortAnimTime":
<integer name="config_activityShortDur">150</integer>
<integer name="config_activityDefaultDur">220</integer>
Save.
10) Return to Script. Enter "11" and enter.
The script will rebuild the framework-res.apk.
11) You are asked if this is a system application. Enter "y" and enter. Then a second question appears. Enter newly "y".
12) Then after it processes, Don't press anything & DON'T CLOSE THIS WINDOW!!! A new folder "keep" is created in the apk manager folder. Go inside it and delete the file "resources.arsc". Now go inside keep\res\anim\ and delete every file with the same name as every file of the "anims" folder of the zip downloaded.
Then return to Script and press enter. It processes, then if everything went ok, in the folder "place-apk-here-for-modding" a file "unsignedframework-res.apk" is created. Copy it outside and rename it "framework_res.apk".
13) Now you can create a flashable zip or you can simply push it to your system.
CONGRATRULATIONS!!! YOU ARE DONE!!!
And if you think this tutorial is useful, CLICK THANKS!!!
Video of this mod working:
http://www.youtube.com/watch?v=vf1U_30Ngfk
digkong said:
13) Now you can create a flashable zip or you can simply push it to your system (but you have to sign the apk).
Click to expand...
Click to collapse
You don't sign system apks.
thanks just corrected it..
digkong said:
i am just copying and pasting capez's work all... credits goes to him
here's the guide...
1) First of all, you need to download and install APK MANAGER:
http://forum.xda-developers.com/showthread.php?t=695701
2) Extract with WinRAR, from the ROM you want to modify, the file framework-res.apk, that you can find in the directory \System\framework\.
3) Go to the apk manager folder and place the framework-res.apk file in the folder "place-apk-here-for-modding".
4) In the apk manager folder, double click on the file "Script". A cmd window will open.
5) Where it says "Please make your decision", write "22" and enter. Then enter "1" and enter. Then enter "9" and enter.
The script will decompile the framework-res.apk.
6) Now go to your apk manager folder, go to Projects\framework-res.apk\res\anim\.
In this folder there are the animations of your rom. They consist in some .xml files decompiled.
7) Download this:
http://www.mediafire.com/?1qjwtotg1r8umm1
8) Copy the files from the folder "anims" of the zip downloaded into the anim folder and you are asked to replace the files; choose yes. Then copy also the files from the folder "other_files" to the anim folder.
9) Now go to your apk manager folder, go to Projects\framework-res.apk\res\values\. Edit the file integers.xml and put these two lines under the line of "shortAnimTime":
<integer name="config_activityShortDur">150</integer>
<integer name="config_activityDefaultDur">220</integer>
Save.
10) Return to Script. Enter "11" and enter.
The script will rebuild the framework-res.apk.
11) You are asked if this is a system application. Enter "y" and enter. Then a second question appears. Enter newly "y".
12) Then after it processes, Don't press anything & DON'T CLOSE THIS WINDOW!!! A new folder "keep" is created in the apk manager folder. Go inside it and delete the file "resources.arsc". Now go inside keep\res\anim\ and delete every file with the same name as every file of the "anims" folder of the zip downloaded.
Then return to Script and press enter. It processes, then if everything went ok, in the folder "place-apk-here-for-modding" a file "unsignedframework-res.apk" is created. Copy it outside and rename it "framework_res.apk".
13) Now you can create a flashable zip or you can simply push it to your system.
CONGRATRULATIONS!!! YOU ARE DONE!!!
And if you think this tutorial is useful, CLICK THANKS!!!
Video of this mod working:
http://www.youtube.com/watch?v=vf1U_30Ngfk
Click to expand...
Click to collapse
Nice!!! I will give a try. Thanks!
digkong said:
thanks just corrected it..
Click to expand...
Click to collapse
Np Cool guide.
just testing,i'll let u know about result
edit 2 : sorry for the first edit i was mistaken,it works great
Probably better suired in Android themes and apps
good tutorial! But I suggest you to mention that IT NEEDS to resign the apk after the tutorial is finished....we need to take the META-INF from the res apk decompiled, then open the unsigned apk, delete its META-INF and paste the META-INF from the original framework-res.apk...otherwise it won't work!
Interesting, thanks.
Very nice, thanks for details.
memnoc said:
good tutorial! But I suggest you to mention that IT NEEDS to resign the apk after the tutorial is finished....we need to take the META-INF from the res apk decompiled, then open the unsigned apk, delete its META-INF and paste the META-INF from the original framework-res.apk...otherwise it won't work!
Click to expand...
Click to collapse
i didn't do that and it works for me :S
evanbigfan said:
i didn't do that and it works for me :S
Click to expand...
Click to collapse
Worked for me too without touching the META-INF
Sent from my HTC Desire HD using xda premium
evanbigfan said:
i didn't do that and it works for me :S
Click to expand...
Click to collapse
Yep, I trust you, and I was surprised too when the ROM doesn't boot cause resources apk usually don't need to be signed at all, but once I signed the frame everything work.. strange.. anyway don't care about it, the tutorial is very clear and well organized well done and Thanks
Inviato dal mio HTC Desire HD usando Tapatalk
memnoc said:
Yep, I trust you, and I was surprised too when the ROM doesn't boot cause resources apk usually don't need to be signed at all, but once I signed the frame everything work.. strange.. anyway don't care about it, the tutorial is very clear and well organized well done and Thanks
Inviato dal mio HTC Desire HD usando Tapatalk
Click to expand...
Click to collapse
thanks any way for the info ,it may be usful in other issues
Thanks for the tutorial, these animations are great However,
I flashed it on Runny 4.0, all the animations work, but when I adb pushed it to /system/framework the market force closed, and then when I rebooted all my accounts were gone?
i keep encountering a problem after I press 9.
"an error occured, please check the log"
then I press 21 to see
"java is not recognized as an internal or external command, operable program or batch file."
"could not find _________________" bunch of directories.
help~~
P00t said:
i keep encountering a problem after I press 9.
"an error occured, please check the log"
then I press 21 to see
"java is not recognized as an internal or external command, operable program or batch file."
"could not find _________________" bunch of directories.
help~~
Click to expand...
Click to collapse
http://www.java.com/en/download/help/path.xml
This will help
rayford85 said:
http://www.java.com/en/download/help/path.xml
This will help
Click to expand...
Click to collapse
ahhh that didnt work as well but i found the solution to it~ i had to search deeper into xda forum LOL
i got it working. i had to change the path.
P00t said:
ahhh that didnt work as well but i found the solution to it~ i had to search deeper into xda forum LOL
i got it working. i had to change the path.
Click to expand...
Click to collapse
Lol that's what the link was to show you how to setup your path, glad you got it
rayford85 said:
Lol that's what the link was to show you how to setup your path, glad you got it
Click to expand...
Click to collapse
Oh I thought that link was just to send me to the download link to JAVA.
im sorry. finally made the ICS ANI!

[GUIDE][TUT]::Modifying & Making Your Own Custom Roms::(New Method)

This is a detailed tutorial about modifying or making your own custom roms....but not as regular method... It is a new method...
So...lets start....
In this Guide...you will come to know how to--
Modifying rom..
Adding apps and removing..
Changing bootanimation, rom's name, fonts, ringtones...etc.
A new and easy method to make the rom....
::Requirements::
Galaxy Mini..
A windows PC.
Some basic knowledge..
Time and Patience(most imp)
::Important Tools::
7zip or any other zip manager>>Download Here<<
Update Zip Packager>>Download Here<<
Notepad++ >>Download Here<<
Dsixda's Kitchen..(OPTIONAL)..>>XDA Link<<
::About "BaseRom".zip::
Now, suppose, your base rom is CyanogenMod7.zip...
So...when u will extract that zip...u will see there...
META-INF (Folder)
system (Folder)
boot.img
META-INF :
This folder contains the files which are related to your recovery....in simple words...these files guide your recovery to flash zip, set permissions and some other things...
So...the change that we want here is to add the text that our recovery shows while flashing the rom...look in the extras for the tut...
boot.img :
This file contains Kernel of ur rom....and it also contains splash screen of ur rom....which u can edit...!! Look in extras..
NOW, the main thing..
::Main Tutorial::
Download your base rom and flash it....(without editing anything).
Flash Gapps..
Flash some other material such as Bravia Engine, Audio Enhancements, Scripts, Tweaks, etc
Flash each n every thing that you want in your rom...
Flash any theming material..which u want in ur rom
If you are modifying some system apps such as phone.apk, systemui.apk, framework-res.apk....then modify them one by one and flash them..
When you are done your theming, tweaking, and rest of the things...(now, you are running your rom having your desired theme, scripts, tweaks...)
Now....go to CWM recovery and do a Nandroid backup..
After the backup is completed...locate to the folder in sd-card where the backup file is created..(SD-Card>clockworkmod>backup>.....)
In this "backup" folder...you will see a folder named as the date when you have taken the backup..
In that folder...you will see a file - system.ext4.tar.
Copy that system.ext4.tar file in your PC...
Extract the file...you will see a folder - system
Now, this "system" folder is your Rom's system folder.. having all scripts, tweaks and theming...
Just delete the folder "lost+found" in that system folder and take this folder to the folder where your META-INF and boot.img are...
IMPORTANT:You have to delete "xbin" folder from the extracted system folder and then u have to copy and paste the original xbin folder to that folder..
::Extras::
Editing build.prop :
Locate to the system folder....open build.prop and edit it as you want by adding lines to it...refer this link...
Adding and Removing Apps :
Under system>>app folder copy the apps that you want to add to your rom...also remove the apps that you want...but click here to know the list of apps that can be removed...
Adding UI print to the meta-inf :
Locate to the file updater-script (META-INF>com>google>android>updater-script).
Open the file updater-script with Notepad++...
Scroll down to the last line of the matter...
Copy and paste the following code exactly below the last line
ui_print("Have A Nice Day");
Click to expand...
Click to collapse
You should type your own desired text at the place of Have A Nice Day..(with "....")
Done!!
After u have done....leave the META-INF folder as it is....for now..
Editing Splash Screen :
Extract the boot.img by using dsixda's kitchen....it is very easy...
After that....refer to this LINK for editing boot splash screen......and then repack the boot.img again using dsixda's kitchen
Editing boot animation of rom :
Download your desired bootanimation.zip.
Rename it "bootanimation.zip".
Now, locate to the folder system>media
You will see a file bootanimation.zip there..
Replace that file with your desired boot animation..(renamed)..
Done!!
Adding ringtones :
Take your ringtone file...it should be in .ogg format..If not then convert it to .ogg..
Locate to the folder system>media>audio>ringtones>
Copy and paste your .ogg files here in ringtones folder..
You can also change notifications, alarm and UI tones like this..
Changing the Fonts :
Take your desired font.ttf file and rename it as DroidSans.ttf..
Locate to the folder system>fonts>
Now, replace the file DroidSans.ttf with your desired DoridSans.ttf...
To change the lock screen clock font...replace the Clocktopia.ttf with your desired one..(rename first)..
Changing the ROM's name :
Note: It will be shown in settings>about phone>
Open build.prop with Notepad++
Find the line-
ro.cm.version="Base rom's name"
Click to expand...
Click to collapse
Type your rom's name instead of "Base rom's name"..
Save..
Done!!
Theming Your Rom :
Refer to the following links for theming guides-
http://forum.xda-developers.com/showthread.php?t=1422116
http://forum.xda-developers.com/showthread.php?t=916814
http://forum.xda-developers.com/showthread.php?t=1342895
http://forum.xda-developers.com/showthread.php?t=821638
http://forum.xda-developers.com/showthread.php?t=1469987
Now you have your MODIFIED : -
META-INF (folder)
system (folder)
boot.img
::Creating your ROM.zip::
Extract the provided UpdateZipPackager.zip
You will see->>placehere(folder)
>>others(folder)
>>script.bat
Now, copy your modified META-INF, system and boot.img in the folder "placehere" in UpdateZipPackager..
Run the script.bat in UpdateZipPackager..
It will ask something...type "n" and press enter..
Now, you will see a list in the script window...
Choose option 2 and press enter..
It will create an update.zip...
This is your roms zip..
Flash your rom and upload it to XDA..!!! Enjoy..!!
Plz...press thanks if I helped you with this guide...
-::Reserved::-
-:::Reserved:::-
-::::Reserved::::-
-:Reserved:-
nice guide dude!
gonna try this wen i m free from my school homeworks!
Sent from my GT-S5570 using Tapatalk 2
ronakmachhi said:
nice guide dude!
gonna try this wen i m free from my school homeworks!
Sent from my GT-S5570 using Tapatalk 2
Click to expand...
Click to collapse
Ok..bro..but...
I have forgot that word "homework" from...last year...lol...
oj_buddy said:
Ok..bro..but...
I have forgot that word "homework" from...last year...lol...
Click to expand...
Click to collapse
bt unfortunately i ll have to concentrate on that as i m in 12th grade-science stream!
Sent from my GT-S5570 using Tapatalk 2
Great tutorial OJ.....
This should help many who want to create their own roms, but I also fear xda will now get flooded with themed or modified roms.
thats an awesome tutorial buddy
Thanks a lot
-Rik(Rittik)
Greats,, its fast to make a custom rom
all app data will be in the rom that we have creat?????causs i don't want my sms and other thing to be in the rom that i will make.....pleazzz anwers....
lackhoo said:
all app data will be in the rom that we have creat?????causs i don't want my sms and other thing to be in the rom that i will make.....pleazzz anwers....
Click to expand...
Click to collapse
NO, it won't be there.... ALl your apps and data will not be in this rom as we've not included the data folder data.ext4.tar (which is the one to store all your data).
SO, don't worry much about it.
all app data will be in the rom that we have creat?????causs i don't want my sms and other thing to be in the rom that i will make.....pleazzz anwers....
Click to expand...
Click to collapse
Use titanium Backup to backup your apps and Some SMS backup app from market...many of them are available..Then after installing neW ROM just restore
em..thats how i do it
easy and simple
A problem i am facing is..i have created around 2-3 update.zip like the way mentioned above...following every procedure...but while Installing througg CWM it says...Installation aborted
-Rik(Rittik)
yagya said:
Great tutorial OJ.....
This should help many who want to create their own roms, but I also fear xda will now get flooded with themed or modified roms.
Click to expand...
Click to collapse
Thanks man...
But...r u serious yagya..?? Only source builds..???... how do you know it..??
Sent from my GT-S5570 using Tapatalk
Rittik said:
thats an awesome tutorial buddy
Thanks a lot
-Rik(Rittik)
Click to expand...
Click to collapse
Thanks...
Sent from my GT-S5570 using Tapatalk
Rittik said:
Use titanium Backup to backup your apps and Some SMS backup app from market...many of them are available..Then after installing neW ROM just restore
em..thats how i do it
easy and simple
A problem i am facing is..i have created around 2-3 update.zip like the way mentioned above...following every procedure...but while Installing througg CWM it says...Installation aborted
-Rik(Rittik)
Click to expand...
Click to collapse
Check your framework-res.apk for errors...as well as...check your meta-inf...try with an unedited meta-inf...and also..dont forget to replace that xbin folder with the original one...from base rom...also delete lost + found folder taken from system.ext4.tar ...try everything freshly..dont make anything wrong in update zip packager..in options selection...u will surely get success..
Sent from my GT-S5570 using Tapatalk
After I did the nandroid backup and went my backup folder, I only saw a "system.img" file inside the other folder - no "system.ext4.tar" ...what should I do in this case?
Oj-buddy, I am trying to follow your guide to make a custom ROM, but I find myself in a spot. You said that after I do the nanadroid backup, I'm supposed to go to: sdcard/clockworkmod/backup/(dated folder which contains my rom) where I will see "system.ext4.tar", but that's not what I see ;these are the files I see: android_ secure.img, boot.img, cache.img, data.img, nandroid.md5, recovery.img, sd-ext.img, system.img.....what should I do at this point?
jayrome876 said:
After I did the nandroid backup and went my backup folder, I only saw a "system.img" file inside the other folder - no "system.ext4.tar" ...what should I do in this case?
Click to expand...
Click to collapse
You should use latest CWM recovery for it.....
or you can also extract system.img with magicISO tool...
both system.img and system.ext4.tar are same files..

[GUIDE] How to port MIUIv4 to our device

I want to share this to make everyone know how I port it to our device so I shouldn't share it to just one or two people.
It is based on this proxuser thread, credit goes to him. I just make it details and make it work for our device.
We will make MIUIv4 framework to run on top of CM9/AOSP base. So we should prepare CM9 base and MIUIv4 to port. You can use any MIUIv4 to port but you can try by choosing the one which similar hardware with our device.
- Prepare extracted CM9 base rom in folder A, and extracted MIUIv4 rom in folder B. Copy file framework.jar, framework-res.apk and services.jar at /system/framework from CM9 folder save them in folder C. After here, we will port from folder B to folder A.
- Remove folder /system/framework and /system/app in folder A and replace them from folder B.
- Remove /system/app/nfc.apk, since our device don't have this feature.
- Copy all *.db and *.td at /system/etc from B to A.
- replace media folder in /system/media at folder B to folder A.
- copy content-types.properties file to /system/lib from B to A.
- copy miui-framework.xml at etc/permission
- copy /system/xbin/invoke-as and /system/xbin/su from folder B to A
- copy /system/lib/liblbesecs.so from folder B to A
- add this lines to updater-script file in folder B:
set_perm(0, 0, 06755, "/system/xbin/invoke-as");
set_perm(0, 0, 0755, "/system/lib/liblbesec.so");
- change values from build.prop
ro.build.version.incremental=2.x.x (version number of MIUIv4)
ro.config.ringtone=MI.ogg
ro.config.notification_sound=FadeIn.ogg
ro.config.alarm_alert=GoodMorning.ogg
ro.config.sms_received_sound=FadeIn.ogg
ro.config.sms_delivered_sound=MessageComplete.ogg
Test the new port:
Now pack folder B to zip files and sign it and flash it using CWM. You should prepare the other working rom to get back to previous rom .
Use adb logcat to debug, and see the result. If it doesn't shown anything, then we should replace libandroid_runtime.so from MIUIv4, but not in my case, I kept it from CM9.
Our device is based on Qualcomm so with our new CM9 theme engine will affected, it will got hung on boot with unresolved at android/content/res/AssetManager. Just break the logcat when it shown some lines with "died" things and scroll up, you'll find it.
So here is the next step which will take more time. You should able to decompile and recompile jar/apk files, Google it for that, it's very easy to do that. We'll go for smaling and baksmaling here. And for comparing, use an application such as winmerge for windows or Meld for linux.
Remember that we have some files in folder C from CM9 and we'll use that as source for smaling steps.
- find /smali/android/content/res/assetManager.smali from framework.jar on Miuiv4 and compare it with the same file from CM9 one, replace all missing lines.
- copy missing method in /smali/android/hardware/Camera.smali
- copy missing method in /smali/android/os/Power.smali, method SetUnstableMemoryState the important one.
- copy /smali/android/server/BluetoothA2dpService*.smali
- copy /smali/android/content/res/PackageRedirectionMap*.smali
- copy /smali/org/codeaurora/Performance.smali
- copy smali/android/media/MediaRecorder*.smali
- copy /smali/android/view/GLES20Canvas*.smali
- copy /smali/android/net/wifi/WifiNative.smali
- copy /smali/android/graphics/paint*.smali
I found them by watching logcat, fixing one by one error on each boot, so now you can save much time by using this guide.
If still stuck, I look for some lines like this:
E/dalvikvm( 234): ERROR: couldn't find native method
E/dalvikvm( 234): Requested: Lxxxxxxx/xxxxxxx/xxxxxxxx;.yyyyyyyyyyyyyZ)I
E/JNIHelp ( 234): RegisterNatives failed for 'xxxxxxx/xxxxxxx/xxxxxxxx', aborting
F/libc ( 234): Fatal signal zzzzzz at 0xdeadbaad (code=1)
Then the problem is in xxxxxxx/xxxxxxx/xxxxxxxx.smali file, try to fix it first by adding missing lines in it if possible or copy xxxxxxx/xxxxxxx/xxxxxxxx*.smali if there is so many different lines.
You should see the MIUIv4 lockscreen if you done fixing all those problem.
After this we can fixing anothers, like 2G/3G data and headset.
To fix headset, it's in WiredServiceObserver.smali in framework-res.apk, find the path string which contain "h2w" word with "headset_sensor" word, remember just paths string, no else. It should be 3 words to replace.
Now to fix 2G/3G data,
replace RIL*.smali and copy LGEQualcommRIL*.smali at path
/smali/com/android/internal/telephony ín framework.jar.
You also need to patch PhoneFactory.smali to construct your class instead of RIL:
find "RIL" word (there will be 2 entries) and replace them to "LGEQualcommRIL".
Fuih..... That what I've learned of porting MIUIv4 guys...
Soon will be born more porters... Great!!!
Happy porting...!!!!
CacingKalung said:
I want to share this to make everyone of you know how I port it to our device so I shouldn't share it to just one or two people.
It is based on this proxuser thread, credit goes to him. I just make it details and make it work for our device.
We will make MIUIv4 framework to run on top of CM9/AOSP base. So we should prepare CM9 base and MIUIv4 to port. You can use any MIUIv4 to port but you can try by choosing the one which similar hardware with our device.
- Prepare extracted CM9 base rom in folder A, and extracted MIUIv4 rom in folder B. Copy file framework.jar, framework-res.apk and services.jar at /system/framework from CM9 folder save them in folder C. After here, we will port from folder B to folder A.
- Remove folder /system/framework and /system/app in folder A and replace them from folder B.
- Remove /system/app/nfc.apk, since our device don't have this feature.
- Copy all *.db and *.td at /system/etc from B to A.
- replace media folder in /system/media at folder B to folder A.
- copy content-types.properties file to /system/lib from B to A.
- copy miui-framework.xml at etc/permission
- copy /system/xbin/invoke-as and /system/xbin/su from folder B to A
- copy /system/lib/liblbesecs.so from folder B to A
- add this lines to updater-script file in folder B:
set_perm(0, 0, 06755, "/system/xbin/invoke-as");
set_perm(0, 0, 0755, "/system/lib/liblbesec.so");
- change values from build.prop
ro.build.version.incremental=2.x.x (version number of MIUIv4)
ro.config.ringtone=MI.ogg
ro.config.notification_sound=FadeIn.ogg
ro.config.alarm_alert=GoodMorning.ogg
ro.config.sms_received_sound=FadeIn.ogg
ro.config.sms_delivered_sound=MessageComplete.ogg
Test the new port:
Now pack folder B to zip files and sign it and flash it using CWM. You should prepare the other working rom to get back to previous rom .
Use adb logcat to debug, and see the result. If it doesn't shown anything, then we should replace libandroid_runtime.so from MIUIv4, but not in my case, I kept it from CM9.
Our device is based on Qualcomm so with our new CM9 theme engine will affected, it will got hung on boot with unresolved at android/content/res/AssetManager. Just break the logcat when it shown some lines with "died" things and scroll up, you'll find it.
So here is the next step which will take more time. You should able to decompile and recompile jar/apk files, Google it for that, it's very easy to do that. We'll go for smaling and baksmaling here. And for comparing, use an application such as winmerge for windows or Meld for linux.
Remember that we have some files in folder C from CM9 and we'll use that as source for smaling steps.
- find /smali/android/content/res/assetManager.smali from framework.jar on Miuiv4 and compare it with the same file from CM9 one, replace all missing lines.
- copy missing method in /smali/android/hardware/Camera.smali
- copy missing method in /smali/android/os/Power.smali, method SetUnstableMemoryState the important one.
- copy /smali/android/server/BluetoothA2dpService*.smali
- copy /smali/android/content/res/PackageRedirectionMap*.smali
- copy /smali/org/codeaurora/Performance.smali
- copy smali/android/media/MediaRecorder*.smali
- copy /smali/android/view/GLES20Canvas*.smali
- copy /smali/android/net/wifi/WifiNative.smali
- copy /smali/android/graphics/paint*.smali
I found them by watching logcat, fixing one by one error on each boot, so now you can skip much time by using this guide.
If still stuck, I look for some lines like this:
E/dalvikvm( 234): ERROR: couldn't find native method
E/dalvikvm( 234): Requested: Lxxxxxxx/xxxxxxx/xxxxxxxx;.yyyyyyyyyyyyyZ)I
E/JNIHelp ( 234): RegisterNatives failed for 'xxxxxxx/xxxxxxx/xxxxxxxx', aborting
F/libc ( 234): Fatal signal zzzzzz at 0xdeadbaad (code=1)
Then the problem is in xxxxxxx/xxxxxxx/xxxxxxxx.smali file, try to fix it first by adding missing lines in it if possible or copy xxxxxxx/xxxxxxx/xxxxxxxx*.smali if there is to many different.
You should see the MIUIv4 lockscreen if you done fixing all those problem.
After this we can fixing anothers, like 2G/3G data and headset.
To fix headset, it's in WiredServiceObserver.smali in framework-res.apk, find the path with contain "h2w" word with "headset_sensor" word, remember just paths string, no else. It should be 3 words to replace.
Now to fix 2G/3G data,
replace RIL*.smali and copy LGEQualcommRIL*.smali at path
/smali/com/android/internal/telephony ín framework.jar.
You also need to patch PhoneFactory.smali to construct your class instead of RIL:
find "RIL" word (there will be 2 entries) and replace them to "LGEQualcommRIL".
Fuih..... That what I've learned of porting MIUIv4 guys...
Soon will be born more porters... Great!!!
Happy porting...!!!!
Click to expand...
Click to collapse
owh yeah so I just forget change the ril.smail on the framework..try again..thanks my sifu...
any plan for jelly bean port??
Sent from my FIH-FB0 using xda
2.6.15 and 2.6.22 boot loop
comdevx said:
2.6.15 and 2.6.22 boot loop
Click to expand...
Click to collapse
if you get boot loop,now you almost get the miui working and please follow this step
So here is the next step which will take more time. You should able to decompile and recompile jar/apk files, Google it for that, it's very easy to do that. We'll go for smaling and baksmaling here. And for comparing, use an application such as winmerge for windows or Meld for linux.
Remember that we have some files in folder C from CM9 and we'll use that as source for smaling steps.
- find /smali/android/content/res/assetManager.smali from framework.jar on Miuiv4 and compare it with the same file from CM9 one, replace all missing lines.
- copy missing method in /smali/android/hardware/Camera.smali
- copy missing method in /smali/android/os/Power.smali, method SetUnstableMemoryState the important one.
- copy /smali/android/server/BluetoothA2dpService*.smali
- copy /smali/android/content/res/PackageRedirectionMap*.smali
- copy /smali/org/codeaurora/Performance.smali
- copy smali/android/media/MediaRecorder*.smali
- copy /smali/android/view/GLES20Canvas*.smali
- copy /smali/android/net/wifi/WifiNative.smali
- copy /smali/android/graphics/paint*.smali
---------- Post added at 06:20 AM ---------- Previous post was at 06:17 AM ----------
abenagiel said:
any plan for jelly bean port??
Sent from my FIH-FB0 using xda
Click to expand...
Click to collapse
i think for driver rom jelly bean not still support for driver qulcomm(adreno) and need new baseband...
comdevx said:
2.6.15 and 2.6.22 boot loop
Click to expand...
Click to collapse
Read carefully my guide and if ypu still stuck at boot, look at logcat and look at deadbad fatal error and again... follow above guide at deadbaad error.
Sent from my bike using Tapatalk
CacingKalung said:
So here is the next step which will take more time. You should able to decompile and recompile jar/apk files, Google it for that, it's very easy to do that. We'll go for smaling and baksmaling here. And for comparing, use an application such as winmerge for windows or Meld for linux.
Remember that we have some files in folder C from CM9 and we'll use that as source for smaling steps.
- find /smali/android/content/res/assetManager.smali from framework.jar on Miuiv4 and compare it with the same file from CM9 one, replace all missing lines.
- copy missing method in /smali/android/hardware/Camera.smali
- copy missing method in /smali/android/os/Power.smali, method SetUnstableMemoryState the important one.
- copy /smali/android/server/BluetoothA2dpService*.smali
- copy /smali/android/content/res/PackageRedirectionMap*.smali
- copy /smali/org/codeaurora/Performance.smali
- copy smali/android/media/MediaRecorder*.smali
- copy /smali/android/view/GLES20Canvas*.smali
- copy /smali/android/net/wifi/WifiNative.smali
- copy /smali/android/graphics/paint*.smali
I found them by watching logcat, fixing one by one error on each boot, so now you can save much time by using this guide.
If still stuck, I look for some lines like this:
E/dalvikvm( 234): ERROR: couldn't find native method
E/dalvikvm( 234): Requested: Lxxxxxxx/xxxxxxx/xxxxxxxx;.yyyyyyyyyyyyyZ)I
E/JNIHelp ( 234): RegisterNatives failed for 'xxxxxxx/xxxxxxx/xxxxxxxx', aborting
F/libc ( 234): Fatal signal zzzzzz at 0xdeadbaad (code=1)
Then the problem is in xxxxxxx/xxxxxxx/xxxxxxxx.smali file, try to fix it first by adding missing lines in it if possible or copy xxxxxxx/xxxxxxx/xxxxxxxx*.smali if there is so many different lines.
You should see the MIUIv4 lockscreen if you done fixing all those problem.
After this we can fixing anothers, like 2G/3G data and headset.
To fix headset, it's in WiredServiceObserver.smali in framework-res.apk, find the path string which contain "h2w" word with "headset_sensor" word, remember just paths string, no else. It should be 3 words to replace.
Now to fix 2G/3G data,
replace RIL*.smali and copy LGEQualcommRIL*.smali at path
/smali/com/android/internal/telephony ín framework.jar.
You also need to patch PhoneFactory.smali to construct your class instead of RIL:
find "RIL" word (there will be 2 entries) and replace them to "LGEQualcommRIL".
Fuih..... That what I've learned of porting MIUIv4 guys...
Soon will be born more porters... Great!!!
Happy porting...!!!!
Click to expand...
Click to collapse
Hey bro replace text from d smali files to cm9 files and repack cm9 jar or miui jar??
a2441918 said:
Hey bro replace text from d smali files to cm9 files and repack cm9 jar or miui jar??
Click to expand...
Click to collapse
from cm9 to miui. repack miui jar.
CacingKalung said:
from cm9 to miui. repack miui jar.
Click to expand...
Click to collapse
bro in cm9 base assetmanager.smali its given like this
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
but in miui, assetmanager.smali is given like
invoke-direct/range {v0 .. v0}, Ljava/lang/Object;-><init>()V
So replace only the missing lines or also correct these lines??
and bro in cm9 bluetootha2dpservice$1.smali the line is
move-result-object v5
.line 113
.local v5, action:Ljava/lang/String;
const-string v28, "android.bluetooth.adapter.action.STATE_CHANGED"
but in miui bluetootha2dpservice$1.smali
.line 72
invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
what to do bro??
for asset manager, just missing lines, no need to correct others.
For bluetootha2dp, replace smali files.
Sent from my bike using Tapatalk 2
Hey mate, nice guide, seems that partially matches porting of TouchWiz I'm doing right now, some errors are similiar. Will keep track on this while porting.
mesaj said:
Hey mate, nice guide, seems that partially matches porting of TouchWiz I'm doing right now, some errors are similiar. Will keep track on this while porting.
Click to expand...
Click to collapse
Good... hope you can share your work with us so we can taste it
Sent from my bike using Tapatalk 2
CacingKalung said:
Good... hope you can share your work with us so we can taste it
Sent from my bike using Tapatalk 2
Click to expand...
Click to collapse
Unfortunatelly, I can't as I'm porting to Samsung Galaxy S2 from S3 May just share some experiences during process.
There's a lot of work with resizing & need first to boot it, that I'm currently working on.
I've got a request on this guide, just to add some more bbcode formatting.
Thanks for all this, hope It'll be helpful.
mesaj said:
Unfortunatelly, I can't as I'm porting to Samsung Galaxy S2 from S3 May just share some experiences during process.
There's a lot of work with resizing & need first to boot it, that I'm currently working on.
I've got a request on this guide, just to add some more bbcode formatting.
Thanks for all this, hope It'll be helpful.
Click to expand...
Click to collapse
No problem... good luck.
Sent from my bike using Tapatalk 2
@cacingkalung
hye mate I need you help this is framework MIUI.US the latest..can you decomplie this framework.jar because I can't get decomplie this file and get error when decomplie and complied using window,can you only help me replaced the RIL.smail and LEG.smail to get mobile data working 2g/3g...
thanks..hope you will help me
elol said:
hye mate I need you help this is framework MIUI.US the latest..can you decomplie this framework.jar because I can't get decomplie this file and get error when decomplie and complied using window,can you only help me replaced the RIL.smail and LEG.smail to get mobile data working 2g/3g...
thanks..hope you will help me
Click to expand...
Click to collapse
@Elol, Yes, I also faced problems when decompiling MIUI.us framework.jar using windows.

[DEV][HOW-TO] Create your own Rom with *many* Features :)

For those who want to really learn how to Developing
Introduction
Code:
/-* i will help YOU as much as i can, but dont spam me with PM
/-* I will explain ALL Things here from Basic Rom create to 20 Toggles in
/-* Statusbar, 7 Lockscreenmod, Scrolling Cache diabling, Custom Bootanimation
/-* enabling and more other Things
/-* What i dont want:
/-* If some people dont like this Guides, DONT POST anything HERE!
/-* Dont spam me with pm (said already) [If your Rom wont boot, Upload it]
/-* here!and i will take a look on that ;)
Soo here is a Index :laugh:​
Introduction
How to extract Rom
How to de-odex Rom
How to make a fully booting Custom Rom (With no Modifications!)
How to mod your Rom (EXTREMLY) :silly:
Include Mods in Rom and finish your Work
Troubleshooting
Code:
The Thread will be incomplete till next week cause it takes long Time to write all Things here ;)
​
Stock Roms Linked here (Thanks to samfirmware.com)​
S5570JPKT2
S5570XWKTN
S5570XWKTH
Download the Files where u can get ur Rom Files for ur own Custom Rom which will be flashable later! (It takes some Time to download it )
Click to expand...
Click to collapse
Programs needed:
[*]MagicISO
[*]WinRar (x32 Download) (x64 Download)
Open the downloaded S5570XXXXX_S5570XXXXX_XXX.zip
Place the S5660XXKTL_S5660XXXXX_S5570XXXXX_HOME.tar.md5 on your Desktop
Click to expand...
Click to collapse
Now right click the extracted File and choose "Open with ..."
Then click "Browse..." (Scroll down and Double Click on WinRar, after u done it, Double Click on WinRar once more)
WinRar will open and then extract system.rfs in ur Desktop
Click to expand...
Click to collapse
Now install and open MagicISO!
After u done it, chose "Open Image File."
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Then choose "All Files (*.*)" before, take a Click here:
After it, choose your system.rfs from your Desktop and you will see all Files
Click to expand...
Click to collapse
Ok lets resume it
Now create a Folder named "extracted" on your Desktop!
After it, go to MagicISO and select all Files u see there:
And let all extract ...
Click to expand...
Click to collapse
Youtube Tutorial:
De-Odexing ​
Now we need to sort all Files first
Create a folder on your Desktop named "Rom"
Now create in the Folder "Rom", 2 new Folders: "META-INF" and "system"
Now push all Files and Folders from "extracted" to "system" folder in "Rom" folder which is placed on Desktop
Click to expand...
Click to collapse
Setup DSIXDA Kitchen on Windows for DE-Odexing !
needed:
- Java6 U33
- cygwin_packages
- DSIXDA Kitchen (Mirror by me) *all Credits to DSIXDA*
So after u have installed Java6, we can go to installing DSIXDA Kitchen
extract all Files u find in cygwin_packages.zip to an folder (name folder how u want). Then install Cygwin. Dont know how the structure of Package looks
If u get an error while install, press "ok", its normal!
Here:
If u come into the screen where u need to select what packages u must install,
Click the first "All" u see there:
then it takes a while to install, wait a bit!
After install run Cygwin for 1 Minute!
Close it and go to C:\cygwin/home/yourUsername/
and create a folder named "kitchen"
Now u extract the DSIXDA_Kitchen.zip in this Folder!
After u are done, open cygwin and type the fllowing commands:
Code:
cd kitchen
Press Enter
then
Code:
chmod 777 ./menu
Press Enter
then
Code:
./menu
Press Enter
Now the kitchen loads :victory:
Click to expand...
Click to collapse
To de-odex ur Rom:
go to C:\cygwin/home/yourusername/kitchen
now rename the "Rom" Folder to WORKING_Rom and push it in kitchen Folder ...
After u done it, open Cygwin and enter the codes posted above
Now press "0" and press enter
Then press "11" and press once more Enter!
The kitchen asks u for ur Decompiling way, press "b" (it will de-odex framework and apps folder)
now the Kitchen asks you: "enable logging to file?" choose/press: y
Now work takes place and u need to/wait a few minutes till all files are de-odexed
Click to expand...
Click to collapse
Rom Making ​
Requirements
[*]DEV_Tutorial.zip
Click to expand...
Click to collapse
So far so good
now we gonna make the Rom ...
First extract DEV_Tutorial.zip in any Folder :laugh:
In it there is an Kernel, Format Scripts, WiFi Modules and META-INF
Then open ur "Rom" Folder now move boot.img and mkfs.ext4;format.sh (maybe its only format) in the "Rom" Folder!
After its done open META-INF in both Folders
Move all Folders and Files in META-Inf from extracted File in META-INF from ur "Rom" Folder.
Now your Updater-Script is prepared ...
U dont need to make any changes anymore
Now go to system/lib in your "WORKING_Rom" Folder and delete "modules" Folder
Also delete Folders in system/ : "wifi" and in system/etc : "wifi"
After u done it, place the "wifi" folder from system/ in the Folder u extracted in the system/ folder of your Rom
and also the WiFi folder from system/etc/ from the extracted file in system/etc/ of your Rom :cyclops:
Oh i forgot that u can create a Folder in system/etc/ named "init.d"
Click to expand...
Click to collapse
now download THIS File
I thought u have opened your Rom Folder already!
So we are going to extract basic things like the custom bootanimation support,
or busybox and root :angel:
Extract DEV_Tutorial2.zip to an Folder
now push all Files which are from (extracted zip) system/app/ Folder in system/app/ in your Rom!
Push all files from (extracted zip) system/bin/ Folder in system/bin/ in your Rom!
And the last one:
Push all Files from (extracted zip) system/xbin/ Folder in system/xbin/ in your Rom!
The Permissions for Root, Busybox, Toolbox are already setted in Updater-Script ...
Click to expand...
Click to collapse
Now we gonna barebone your Rom that its flashable
Files u can delete to make it leightweight as u can [really, really recommend]:
dlna.apk
GenieWidget.apk
GoogleMail.apk (u have Mail.apk)
GoogleFeedback.apk
GoogleQuickSearchBox.apk
Maps.apk
Memo.apk
Protips.apk
SamsungApps.apk
SamsungAppsUNA3.apk
SamsungWidget_ProgramMonitor.apk
SamsungWidget_StockClock.apk
serviceModeApp.apk
Stk.apk
Street.apk
Swype.apk
Talk.apk
talkback.apk
thinkdroid.apk
VoiceSearch.apk
Youtube.apk
all are in system/app Folder placed!
Click to expand...
Click to collapse
Add Custom Bootanimation
U can download one from HERE Its a Google Bootanimation
But ok, download it and go to system/medi of your Rom ...
Now delete bootsamsung.qmg and put the downloaded Bootanimation.zip in! (U can change it later)
Click to expand...
Click to collapse
Flashing!
Atleast u need to zip your Rom and flash it with CWM!
Thats only for testing but later i will tell u how to sign it correctly for publishing!
Click to expand...
Click to collapse
How to add 15 Toggles​
first decompile your de-odexed SystemUI.apk,
using apktool
if u installed apktool correctly, u need to push framework-res.apk and twframework-res.apk and SystemUI.apk in apktool folder!
After u r ready, Press SHIFT and press right-Klick at the same time anywhere in the apktool folder, then press "open in command window here" or something like that, then type in:
1.
Code:
apktool if framework-res.apk
2.
Code:
apktool if twframework-res.apk
3.
Code:
apktool if SystemUI.apk
4.
Code:
apktool d SystemUI.apk
Click to expand...
Click to collapse
After its ready, open "SystemUI" Folder and open "SystemUI/smali/com/android/systemui/status/StatusBarService.smali" with Notepad++
(using strg+f , after it u see the search window) now find:
Code:
0x7f030002
after it mod the example to the modded one!
Code:
[COLOR="Lime"]const v8, 0x7f030002[/COLOR]
invoke-static {p1, v8, v10}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v4
.end local v4 [COLOR="Lime"]#qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;[/COLOR]
check-cast v4, [COLOR="Lime"]Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;[/COLOR]
[COLOR="Lime"].restart local v4 #qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;[/COLOR]
goto :goto_0
now modify this points to
Code:
const v8, [COLOR="red"]0x3030003[/COLOR]
invoke-static {p1, v8, v10}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v4
.end local v4 [COLOR="Red"]#Lcom/lidroid/systemui/quickpanel/PowerWidget;[/COLOR]
[COLOR="Red"]check-cast v4, Lcom/lidroid/systemui/quickpanel/PowerWidget;[/COLOR]
.local v4, [COLOR="red"]qsv:Lcom/lidroid/systemui/quickpanel/PowerWidget;[/COLOR]
[COLOR="red"]invoke-virtual {v4}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V[/COLOR]
goto :goto_0
save it
Now open AndroidManifest.xml
add after </applications>
Code:
I´ll add it later!
and save it
Click to expand...
Click to collapse
Then download and extract THIS and extract it to anywhere, now open "smali/com/" now push "lidroid" folder in the decompiled "SystemUI/smali/com/" Folder! (Without that folder your Satusbar will FC)!
Click to expand...
Click to collapse
now re-open apktool comand window and type in:
Code:
apktool b SystemUI
Click to expand...
Click to collapse
After u done it, u have in "SystemUI/build/apk" Folder 2 Files named:
"resources.arsc" and "classes.dex" !
Now extract the non-decompiled SystemUI.apk using WinRar!
Push all files from the opened APK into any Folder, like "SystemUI" Folder (like me) on your Desktop. Now push "resources.arsc" and "classes.dex" and "AndroidManifest.xml" files from "SystemUI/build/apk" Folder in the extracted SystemUI Folder ...
Click to expand...
Click to collapse
Now select all files in "Extracted" (SystemUI) Folder, and make an right click!
Now choose: "Add to Archieve" in 7zip Option
Name it in the line wher u can change the name to "SystemUI.apk"
and Click ok!
Click to expand...
Click to collapse
Then download APKMULTITOOL!
Extarct it to a folder called "APkmultitool" now push !All! .apk Files from /framework and /apps Folder in
"place-here-for-signing" Folder
After u done it, open script.bat and let it load
Then choose option 16 and let it sign!
After it push all apps from /app Folder back in /app Folder of your Rom and all files from /framework to Framework Folder of your Rom!
Click to expand...
Click to collapse
Then add lidroid-res.apk in /framework Folder and
Oh the pre-last time that its reserved
Troubleshooting ...​
Q: Java is not recognized as an internal or external Command!
A: Go to "Computer" then "System Properties" then "Advanced Settings" then "Enviroment Variables"!
i know its for minecraft but it works also for your problem!
Click to expand...
Click to collapse
ok one more for reservation
thanks good guide :good:
Thank you so much for creating the thread within minutes of me asking you for a guide you yruly are awesome.
Sent from my GT-S5570 using xda app-developers app
thanks :good: waiting guide
No offense meant, but where is the compile part mentioned in the subject? From the index it looks like a unzip & mod & repack series of guides. Please, unless you mean to deal with compiling AOSP/CM/AOKP from sources, edit your subject to make the topic more clear and avoid confusion.
Thank you.
Yeah ok i´ll change the thread Name ...
How to in dev? Lol!!!
Sent from my GT-S5570 using Tapatalk 2
yeah cause i will post tutoriials later which makes 20 Toggles or 7 Lockscreenmod,
Long Press To Skip Volume and others
good tutorial i like tutorials with pictures
and Videos!
I´ll also upload videos to avoid any errors in editing and istalling
Can u make tutorial how to porting lockscreen from other rom ( galaxy mini rom ) ?
Can u make tutorial how to change smali ex : com.larik.koncong.kecebong , to com.laris.keren.ikan
if yes please create guides because iam need now
thanks , good thread .
we extract system folder contains , how should we make meta-inf folder ?
torbatepak said:
we extract system folder contains , how should we make meta-inf folder ?
Click to expand...
Click to collapse
u can copy from other roms , and create updater script own . ( optimal )

[MOD] Internal <> External storage "swap" for 4.2.2. Simply, easy, safe.

[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.

Categories

Resources