Modifing the MotoEmail.apk help please - Motorola Droid Bionic

I have been trying to modify the MotoEmail.apk app from the 6.7.230 ICS leak but can not no matter what I tried. I have tried numerous different versions of aapt and apktool. I can decompile just fine but compiling generates errors every single time.
Is there anyone that can spend a couple of minutes and please help. I would like to edit the \res\values\strings.xml file at line 600 and replace:
Code:
%s wrote:
with:
Code:
-------- Original Message --------
Subject: %1$s
From: %2$s
To: %3$s
CC: %4$s
I have no problem editing the file it just will not compile.
I've tried to add them as attachments but that didn't work.
http://www.draztik.net/MotoEmail.apk
http://www.draztik.net/framework-res.apk

I was able to find the issues with compiling the email app as there were some typos that are even in the ics source code and it compiles but crashes only when I try to reply to a message after making my edits above.

Related

[Q] 4 Lockscreens for SGS, failed attempt...

Hi,
Currently there only exist two types of lockscreen for the sgs i9000. AOSP or samsung glass.
For the Vibrant on the other hand, some people (untermensch ) have managed to get 4 lockscreen types:
AOSP lockscreen
Glass lockscreen
Puzzle lockscreen
Epic lockscreen
More info in this topic: http://forum.xda-developers.com/showthread.php?t=838260
It must definitly be possible to port this to a froyo rom on our SGS but it has taken me a lot of time allready and have not progressed one bit.
Frustrating indeed.
I managed to decompile the android.policy.jar using the command: java -jar baksmali.jar -x android.policy.jar -o android.policy
I added the epic classes from the source zip file in the earlier mentioned post.
I recompiled ((java -jar smali.jar android.policy -o classes.dex) it again and at least no errors at this stage.
Next I tried to decompile the framework-res.apk.
Got errors from apktool, saying that it can't decompile a nine patch image. The nine patch image does not contain a nine patch chunk (so not really a nine patch but png with .0.png extension?)
Tried a lot of things, options, google, this forum but failed to find a solution.
The same thing with the Settings.apk, same kind of error, no solution.
I must be doing something wrong here and have come to a point that I cant figure it out anymore.
I believe that a lot of people would be interested in this kind of thing and this is something achievable.
If somebody could take a shot at this modification please, it would be so awesome to have this for Darkys rom or Docrom.
ps.i do remember that some id's of resources need to change cause there are some duplicates somewhere but don't remember which one where.
check out this thread:
http://forum.xda-developers.com/showthread.php?t=864112&highlight=4+lockscreens

[Q] Help Installing CM9 PLEASE

Hi, i'm trying to install CM9 for the first time (not sure if i should be posting here), and would like some help.
What is supposed to be inside Local_minifest.xml?
I tried getting a file from
h t t p (dot)(dot)//review(dot)cyanogenmod(dot)com/#change,11892
By clicking on the default.xml down the bottom, opening it in Gedit, and copying it over, but i get an error message when i try the repo sync -j16 command.
Could someone please give me a file, or a paste bin of what i'm supposed to be using, or help me out.
Thanks in advance for any help you can give.
(error message)
[email protected]:~/android/system$ repo sync
... A new repo command ( 1.15) is available.
... You should upgrade soon:
cp /home/max/android/system/.repo/repo/repo /home/max/bin/repo
Traceback (most recent call last):
File "/home/max/android/system/.repo/repo/main.py", line 385, in <module>
_Main(sys.argv[1:])
File "/home/max/android/system/.repo/repo/main.py", line 365, in _Main
result = repo._Run(argv) or 0
File "/home/max/android/system/.repo/repo/main.py", line 121, in _Run
copts, cargs = cmd.OptionParser.parse_args(argv)
File "/home/max/android/system/.repo/repo/command.py", line 44, in OptionParser
self._Options(self._optparse)
File "/home/max/android/system/.repo/repo/subcmds/sync.py", line 126, in _Options
self.jobs = self.manifest.default.sync_j
File "/home/max/android/system/.repo/repo/manifest_xml.py", line 228, in default
self._Load()
File "/home/max/android/system/.repo/repo/manifest_xml.py", line 275, in _Load
self._ParseManifest(False)
File "/home/max/android/system/.repo/repo/manifest_xml.py", line 319, in _ParseManifest
(remote.name, self.manifestFile))
error.ManifestParseError: duplicate remote aosp in /home/max/android/system/.repo/local_manifest.xml
Check out this guide and then come back if you're still having problems
http://www.webosnation.com/how-install-cyanogenmod-9-android-your-touchpad
Also check out Reverend Kyle's Youtube channel. He does some really nice tutorials for installing CM on the touchpad:
http://www.youtube.com/user/reverendkjr
Are you trying to install CM9 on your touchpad, or are you downloading and trying to build the CM Rom yourself from source (which is what it seems like you are doing on that page).
Yeah, if you are trying to just install CM9 on your TouchPad, I think you are going about it ALL wrong.
Best guide I have seen and easiest to use with all links being available is from Liliputing, just have to Google it, he even helps you with nightly support
Sent from my SAMSUNG-SGH-I997 using xda premium

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

[Guide][Miui V5] How to Edit framework-miui-res.apk and Related Applications

Hi, it seems some dear users have problems with Miui V5 framework and miui's applications decompiling proccess.
let's begin!
for this job, Im editing the APK Multitool, and all credits will goes to his developer. [raziel23x]
original thread
what's new on this?
changed the aapt to miui compatible, added miui frameworks to default list, added additional frameworks, also you can pull back the files from the phone via adb command.
i wrote it before, original thread
-------------------------------------------------------------------------------------------------------------------------------------------------------------
for version 11.0.1.2 and older!
Download the Attached file.
extract it.
copy these files
Code:
framework-res.apk
framework-miui-res.apk
twframework-res.apk
MiuiSystemUI.apk
from Miui Rom into other folder.
run, Setup.bat script.
Select option 2:
Code:
*
* 2. Installing Framework-Res
* This Will install one of the Framwork-Res Files for 1.x/2.x/3.x/4.x
* This Feature also will install any of the other Dependencies needed
* In order to use this feature make sure to drop all of the needed files
* into the other Folder or else this script will not find them *
*
in next window, install these frameworks by entering related numbers. install it as this order and sequence
Code:
Install framework-res.apk
Install twframework-res.apk
Install Additional Frameworks
Install framework-miui-res.apk
Install MiuiSystemUI.apk
after installing, enter the "9" to get back to main screen.
run setup by entering "3".
Code:
3. Setup Directories
This will setup the appropate directories needed by Apk Multi-Tools
(This script only needs to be ran for first time users do not use if your
Just updating from previous Version
now new folders will create on main folder of this apk multi tool.
Framework's Description
- 1 = framework-res.apk
- 2 = twframework-res.apk
- 3 = additional frameworks
- 4 = additional frameworks
- 5 = additional frameworks
- 6 = framework-miui-res.apk
- 127 = SystemUI.apk​
Version 1.11.0.3 XIAOMI Phones.
1- Download Version 1.0.11.3 [[XIAOMI]MIUI_V5_APKMULTITOOL_1.0.11.3.zip] and extract it.
2- Copy MiuiSystemUI.apk, framework-res.apk and framework-miui-res.apk from your rom or phone into other folder.
3- Run Setup.bat file, choose option 2 and then select option 1 for automatically installing all frameworks.
or you can install frameworks manually
Code:
2. Install framework-res.apk
3. Install dummy frameworks
4. Install framework-miui-res.apk
4- from main menu, run option 3
Code:
3. Setup Directories
This will setup the appropate directories needed by Apk Multi-Tools
(This script only needs to be ran for first time users do not use if your
Just updating from previous Version)
best regards.
How to Edit framework-miui-res.apk?
copy framework-miui-res.apk into "place-apk-here-for-modding" folder, run "Script.bat" file.
choose your project , by entering the " 24 Set current project" [24].
the select your project with related number.
decompile apk.
Code:
9 Decompile apk
when the framework-miui-res.apk get decompiled, goto project folder and on the framework-miui-res.apk , open the "apktool.yml" file via notepadd++.
you will see like this one:
Code:
version: 1.5.2
apkFileName: framework-miui-res.apk
isFrameworkApk: true
usesFramework:
ids:
- 1
sdkInfo:
minSdkVersion: '16'
targetSdkVersion: '16'
packageInfo:
cur_package: miui
orig_package: miui
compressionType: true
add additional frameworks , just like below one
Code:
version: 1.5.2
apkFileName: framework-miui-res.apk
isFrameworkApk: true
usesFramework:
ids:
- 1
- 2
- 3
- 4
- 5
sdkInfo:
minSdkVersion: '16'
targetSdkVersion: '16'
packageInfo:
cur_package: miui
orig_package: miui
compressionType: true
save the file.
now go and edit this file, at final you can compile it.
for compile you can use "11 Compile System APK files" option.​
if you have any problem, please upload the "APK-Multi-Tool.log" file and tell your problem.
Changelog:
version 1.0.11.1 initial release
version 1.0.11.2 , fixed framework installing.
Version 1.0.11.3 , specially for XIAOMI phones and updated apktool to version 1.5.3 snapshot.
+ fixed and removed some scripts
+ all in one framework installer [ option 1]
+ added miui JB frameworks [ ID 2 ~ ID5]
​
M_J_Nazari said:
if you have any problem, please upload the "APK-Multi-Tool.log" file and tell your problem.
Click to expand...
Click to collapse
Thank you Nazari!
I dont know if this script is only meant to work with SGS III files...
I followed your instructions using MI-2 files (without twframework-res.apk of course).
And after de-compiling the apk I can't compile it back.
I'm getting:
error occurred, please check the log (option 21)
Click to expand...
Click to collapse
Btw I notice that inside the apktool.yml
I got
compressiontype: false
Click to expand...
Click to collapse
This is my log:
--------------------------------------------------------------------------
|Sun 06/02/2013 -- 17:55:49.16|
--------------------------------------------------------------------------
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) Client VM (build 23.21-b01, mixed mode, sharing)
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Sagi\apktool\framework\1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.err.CantFindFrameworkResException
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)
at brut.androlib.Androlib.buildResources(Androlib.java:283)
at brut.androlib.Androlib.build(Androlib.java:206)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.err.CantFindFrameworkResException
at brut.androlib.res.AndrolibResources.getFrameworkApk(AndrolibResources.java:544)
at brut.androlib.Androlib.parseUsesFramework(Androlib.java:508)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more
Click to expand...
Click to collapse
I'm guessing it is because of the 'twframework-res.apk' which i dont have...(MI-2 not Samsung).
SagiMedina said:
Thank you Nazari!
I dont know if this script is only meant to work with SGS III files...
I followed your instructions using MI-2 files (without twframework-res.apk of course).
And after de-compiling the apk I can't compile it back.
I'm getting:
Btw I notice that inside the apktool.yml
I got
This is my log:
I'm guessing it is because of the 'twframework-res.apk' which i dont have...(MI-2 not Samsung).
Click to expand...
Click to collapse
W: Could not find sources
so, don't change the "apktool.yml" file and then compile it. see the result. maybe your phone doesn't boot!!
oh,,, i forget to add framework 5 to package, download it and copy to "C:\Users\Sagi\apktool\framework\" folder. i will update the package as soon.
or you can use new package, i added new description and new fixed version.
M_J_Nazari said:
W: Could not find sources
so, don't change the "apktool.yml" file and then compile it. see the result. maybe your phone doesn't boot!!
oh,,, i forget to add framework 5 to package, download it and copy to "C:\Users\Sagi\apktool\framework\" folder. i will update the package as soon.
or you can use new package, i added new description and new fixed version.
Click to expand...
Click to collapse
After I used the new package I succeed to compile it back but the phone doesn't boot.
In apktool.yml I add only
-1
-3
-4
-5
-2 and -6 gave me errors.
I noticed that the new apk size is smaller then the original.
Sent from my MI 2
SagiMedina said:
After I used the new package I succeed to compile it back but the phone doesn't boot.
In apktool.yml I add only
-1
-3
-4
-5
-2 and -6 gave me errors.
I noticed that the new apk size is smaller then the original.
Sent from my MI 2
Click to expand...
Click to collapse
do a search into framework folder, if there is another apk file, i think you need to install this framework. i don't know about the xiaomi phones like mi2 or another.
and, are you sure that you did all steps perfectly?
could you please tell us what did you exactly for compiling process? i mean after entering option "11".
M_J_Nazari said:
and, are you sure that you did all steps perfectly?
could you please tell us what did you exactly for compiling process? i mean after entering option "11".
Click to expand...
Click to collapse
I followed the steps as you wrote except with the twframework, then I edit the apktool.yml
But instead of adding:
-1 to -6
I only add
-1, -3,-4,-5
I edit the style following your guide,
Then I compiled back by entering option 11, copied the 'unsignedframework-miui-res.apk' to my phone and renamed it to 'framework-miui-res.apk' and past it in system/framework. The phone rebooted but got stuck after the bootanimation.
Sent from my MI 2
SagiMedina said:
I followed the steps as you wrote except with the twframework, then I edit the apktool.yml
But instead of adding:
-1 to -6
I only add
-1, -3,-4,-5
I edit the style following your guide,
Then I compiled back by entering option 11, copied the 'unsignedframework-miui-res.apk' to my phone and renamed it to 'framework-miui-res.apk' and past it in system/framework. The phone rebooted but got stuck after the bootanimation.
Sent from my MI 2
Click to expand...
Click to collapse
what's about the keep folder?
M_J_Nazari said:
what's about the keep folder?
Click to expand...
Click to collapse
What is the keep folder?
Sent from my MI 2
SagiMedina said:
What is the keep folder?
Sent from my MI 2
Click to expand...
Click to collapse
ok, i think it is need to know how to work with apk multi tool.
1- decompie
2- edit your framework
3- enter option 11 to compile
4- programs will ask you about the modification , just like this:
Code:
Building Apk
Aside from the signatures, would you like to copy
over any additional files that you didn't modify
from the original apk in order to ensure least
# of errors (y/n)
Type input:
5- enter " y ' and then press enter.
6- wait for programs, to show you this message
Code:
Everything is Ok
Files: x
Size: xxxxx
Compressed: xxxxx
In the APK Multi-Tools folder u'll find
a keep folder. Within it, delete
everything you have modified and leave
files that you haven't. IF you have modified
any xml, then delete resources.arsc from that
folder as well. Once done then press enter
on this script.
Press any key to continue . . .
7- don't touch anything, minimize Apk Multitool program window ,
8-Go back to the main folder of apk multi tool , you will find the "keep" folder.
goto keep folder and delete thisfile "resources.arsc"
9- get back to Apk Multitool program and hit any key to create a new framework-miui-res.apk file with this name
"unsignedframework-miui-res.apk" file.
10- rename it and copy to your phone, do a permission
you can do it via root Explorer
or terminal command
Code:
chmod 0644 /system/framework/framewok-miui-res.apk
or adb commnad
Code:
adb shell chmod 0644 /system/framework/framewok-miui-res.apk
M_J_Nazari said:
...
Click to expand...
Click to collapse
Still no luck Nazari, did everything like you said...
I cant get pass the boot animation once i replace the framework,
why is the new apk is smaller? is it normal?
SagiMedina said:
Still no luck Nazari, did everything like you said...
I cant get pass the boot animation once i replace the framework,
why is the new apk is smaller? is it normal?
Click to expand...
Click to collapse
its normal, you can select compression level by hitting option "21".
but upload your framework-miui-res.apk here to check it and i will make changes to that.
M_J_Nazari said:
its normal, you can select compression level by hitting option "21".
but upload your framework-miui-res.apk here to check it and i will make changes to that.
Click to expand...
Click to collapse
Thanks Nazari!!!
SagiMedina said:
Thanks Nazari!!!
Click to expand...
Click to collapse
it seems xiaomi uses different framework and aapt version, you need to ask them.
M_J_Nazari said:
it seems xiaomi uses different framework and aapt version, you need to ask them.
Click to expand...
Click to collapse
If ill get these different framework and aapt version, I only need to replace them with the those in the 'other' folder?
Guys, you don't have a clue what that other frameworks are for, do you? You can't miss nr 1 or 6 or 2 framework in apktool.yml because that will never work! Apktool.yml is fine and should look like in the first post.
I think your main issue is that you don't know frameworks IDs?
This:
Code:
1. Install framework-miui-res.apk
2. Install framework-res.apk
3. Install twframework-res.apk
6. Install MiuiSystemUI.apk
7. Install Additional Frameworks
Is wrong!
How to tell what ID framework has?
Run this command:
Code:
apktool if framework-miui-res.apk
You will get:
Code:
I: Framework installed to: /home/acid/apktool/framework/6.apk
So framework-miui-res.apk is ID = 6.
Try to install regular framework-res.apk. You will get ID = 1.
To complete the gap between ID1 and ID6 you have to install proper frameworks. AND MiuiSystemUi is NOT a framework! Thats nonsense!
ID is 127 which is out of range.
You have to install framework files that have proper ID from 1 to 6.
ID1:
framework-res.apk
ID2:
frameworks from producer base. So this is twframework-res for Samsung devices, com.htc.resources.apk for HTC, SemcGenericUxpRes.apk for Sony... etc. That doesnt really matter. ID2 frameworks are used when you recompile stock apps like Samsung TW apps or HTC apps (HTCAlbum, Music etc). If you just want to recompile framework-miui-res and boot rom then you can use any ID2 framework or just a dummy file.
ID3:
This is com.htc.dummyskin.apk. Just search for it. You can find it in HTC One roms (One X and One S). Search in MIUI roms for that devices (but with stock HTC based MIUI!). Or grab the file from micode.
ID4:
This is framework-htc-res.apk. Again. search for it. Also HTC roms should have this or grab dummy framework from micode.
ID5:
From micode.
ID6:
framework-miui-res.apk
Dummy frameworks from MiCode:
https://github.com/MiCode/patchrom_build/tree/jellybean/res
You can use 3-5.apk to fill the gap. But still I advice you to use proper ID2 frameworks in case you would like to compile stock apps.
And for last install frameworks in order:
Code:
apktool if framework-res.apk
apktool if twframework-res.apk (or htc or dummy)
apktool if 3.apk
apktool if 4.apk
apktool if 5.apk
apktool if framework-miui-res.apk
That should allow you to boot the rom. Also make sure you have miui aapt and apktool 1.5.3.
thanks a lot @ Accidd for very good explanation.
i worte it for samsung devices, and it seems its fine. this script will install frameworks automatically.
but for other devices i will update the application again, so if we want to compile Xiaomi frameworks , we need to use dummy framework for ID number 2?
It doesn't matter which device you do. You always have to install all frameworks.
Wysłane z MI-2
M_J_Nazari said:
i will update the application again,
Click to expand...
Click to collapse
Thanks Nazari!
And thank you Acid for clearing things!
Sent from my MI 2
Version 1.0.11.3 added to first post to compile Xiaomi phones frameworks.

Theming mediatek-res.apk

I have been interested in theming an MTK 6592 mediatek phone (Infinix Hot Note x551) I have owned for quite a while. Its currently running Stock Android 5.1 Lollipop.
I reached a point where I needed to decompile and recompile the mediatek-res.apk framework resource app.
I was using apktool version 2.1.1 and later on 2.2.0-a4270d-SNAPSHOT
I wanted to get rid of this notification item, every time you opened the Dialer, Contacts or Mms application. I found it annoying - asking every time to choose a default simcard, when I clearly wanted and is able to choose a line on calls, or outgoing SMSs.
Sorry, cant post image links yet!!
Click to expand...
Click to collapse
After a few weeks of on-of/trial and error research, I realized that these could be accomplished by editing the mediatek-res.apk located in /system/framework/mediatek-res.
It decompiled ok, but could not compile after editing(again, trial-error).
These were the compilation errors I was getting: A tonne of errors concerning all the resources and their Id's:
HTML:
W: /home/*****/Desktop/mtk/mediatek-res/res/layout/account_five.xml:6: error: Error: No resource found that matches the given name (at 'id' with value '@id/account_five_img').
I read up on this error and one post here on XDA (didnt save the link, sorry) and also over at github, said to edit the apktool.yml file and include the framework ID for the mediatek-res.apk (already installed via 'apktool if mediatek-res.apk'). Its framework ID was 8. So I added it.
HTML:
usesFramework:
ids:
- 1
to
HTML:
usesFramework:
ids:
- 1
- 8
On compilation, a ton of these new errors came up:
HTML:
W: /home/*****/Desktop/mtk/mediatek-res/res/values/styles.xml:3: error: Resource entry style/ImageSwitch is already defined in package com.mediatek.
Looked around furrther for quite sometime couldnt get a solution to this new errors. I continued on my trial and error ways and discovered that If edited the apktoo.yml file
HTML:
sharedLibrary: false
to
HTML:
sharedLibrary: true
and removed the mediatek-res framework ID from apktool.yml file, the errors were reduced to TWO!!
HTML:
W: /home/*****/Desktop/mtk/mediatek-res/res/values/public.xml:914: error: Public symbol ^attr-private/factor declared here is not defined.
HTML:
W: /home/*****/Desktop/mtk/mediatek-res/res/values/public.xml:915: error: Public symbol ^attr-private/scale declared here is not defined.
On investigating the error, I found out that indeed the two resources( ^attr-private/scale & ^attr-private/factor) were not defined in Ids.xml located in /res/values. I added the two to the bottom of the file,
HTML:
<item type="^attr-private" name="factor">false</item>
<item type="^attr-private" name="scale">false</item>
Also I renamed the file ^attr-privates.xml to ^attr-private.xml
On compilation, NO ERRORS!! and the app but pushed to system the phone ends up in endless bootloop.
I finally resolved the bootloop by replacing the resources.arsc in the compiled apk by the one from the original resources.arsc. They differ in size by a few kilobytes.
STEP BY STEP
1. Using APK Multi-Tools, use option
1. Extract APK
Click to expand...
Click to collapse
. Go to Projects folder and copy the resources.arsc file. This is the original file you shall place in the compiled app.
2. Compile as usual the modified mediatek-res app.
3. Go to '/Build/apk' folder and replace the resources.arsc therein with the one from setp 1.
4. Compile a second time.
5. Your apk will be able to boot and run ok now.
Because I am not very well versed with apktool and its inner workings, I don't know why this errors came up. I know this is a work-around, but for now it will have to do.
If this post saves you a few hours/days/weeks of research, hit thanks!!

Categories

Resources