[ How-to ] Enable App Ops again in 4.4.2 / KOT49H - Android Software Development

Here's a quick guide on how to enable App Ops in 4.4.2 / KOT49H. Decompile Settings.apk, open the Settings.smali and make these changes. Now if you want to keep ART working, don't deodex and just use the classes.dex that already included in the apk.
1.
Code:
.method static constructor <clinit>()V
.locals 3
.prologue
const/4 v2, 0x0
.line 126
sput-boolean v2, Lcom/android/settings/Settings;->sShowNoHomeNotice:Z
.line 309
const/16 v0, 0x2[COLOR="Red"]c[/COLOR]
new-array v0, v0, [Ljava/lang/String;
Change to - +1
Code:
.method static constructor <clinit>()V
.locals 3
.prologue
const/4 v2, 0x0
.line 126
sput-boolean v2, Lcom/android/settings/Settings;->sShowNoHomeNotice:Z
.line 309
const/16 v0, 0x2[COLOR="red"]d[/COLOR]
new-array v0, v0, [Ljava/lang/String;
2.
Code:
const/16 v1, 0x2b
const-class v2, Lcom/android/settings/inputmethod/KeyboardLayoutPickerFragment;
invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v2
aput-object v2, v0, v1
sput-object v0, Lcom/android/settings/Settings;->ENTRY_FRAGMENTS:[Ljava/lang/String;
Add this - What's marked in red should be 1 less than what you changed in the previous step (Or the previous number before adding 1)
Code:
const/16 v1, 0x2b
const-class v2, Lcom/android/settings/inputmethod/KeyboardLayoutPickerFragment;
invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v2
aput-object v2, v0, v1
[B][COLOR="green"]const/16 v1, 0x[COLOR="red"]2c[/COLOR]
const-class v2, Lcom/android/settings/applications/AppOpsSummary;
invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v2
aput-object v2, v0, v1[/COLOR][/B]
sput-object v0, Lcom/android/settings/Settings;->ENTRY_FRAGMENTS:[Ljava/lang/String;
EDIT: Here's how to add it to Settings/Security
Added this to values/strings.xml
Code:
<string name="app_ops_settings_summary">Manage app permissions</string>
Add this to xml/security_settings_misc.xml under the device admin title
Code:
<Preference android:title="@string/app_ops_settings" android:key="app_ops_summary" android:summary="@string/app_ops_settings_summary" android:fragment="com.android.settings.applications.AppOpsSummary" />
{
"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"
}

Great tutorial, but you left out the line that makes the first change actually make sense. The one that initializes the collection to a certain size. I.E. 0x2d instead of 0x2c
Other than that, easy to follow, and useful. Thank you very much for this.

Fenny said:
Great tutorial, but you left out the line that makes the first change actually make sense. The one that initializes the collection to a certain size. I.E. 0x2d instead of 0x2c
Other than that, easy to follow, and useful. Thank you very much for this.
Click to expand...
Click to collapse
That was actually the first step
Calkulin said:
1.
Code:
.method static constructor <clinit>()V
.locals 3
.prologue
const/4 v2, 0x0
.line 126
sput-boolean v2, Lcom/android/settings/Settings;->sShowNoHomeNotice:Z
.line 309
const/16 v0, 0x2[B]c[/B]
Change to
Code:
.method static constructor <clinit>()V
.locals 3
.prologue
const/4 v2, 0x0
.line 126
sput-boolean v2, Lcom/android/settings/Settings;->sShowNoHomeNotice:Z
.line 309
const/16 v0, 0x2[B]d[/B]
Click to expand...
Click to collapse

Calkulin said:
That was actually the first step
Click to expand...
Click to collapse
Right, but there is a line after the end of the code snippet that actually uses the constant /16 that is being defined to initialize the array. Without that, it's just changing an arbitrary constant.

You can also just use AppOpsXposed module for xposed framework.
Sent from my Droid Razr Maxx HD (GSM)

XBlackChaosX said:
You can also just use AppOpsXposed module for xposed framework.
Sent from my Droid Razr Maxx HD (GSM)
Click to expand...
Click to collapse
That would break ART.

Fenny said:
Right, but there is a line after the end of the code snippet that actually uses the constant /16 that is being defined to initialize the array. Without that, it's just changing an arbitrary constant.
Click to expand...
Click to collapse
Both the Nexus 4 and 5 builds that I did, did not have that, so post it and let me see it

True, I haven't gotten the chance to try ART, and I won't until xposed framework somehow starts working with ART. Does ART improve anything on your phone?
Sent from my Droid Razr Maxx HD (GSM)

XBlackChaosX said:
True, I haven't gotten the chance to try ART, and I won't until xposed framework somehow starts working with ART. Does ART improve anything on your phone?
Sent from my Droid Razr Maxx HD (GSM)
Click to expand...
Click to collapse
Less memory usage,faster loading of some applications,and phone had quicker response.

Calkulin said:
Both the Nexus 4 and 5 builds that I did, did not have that, so post it and let me see it
Click to expand...
Click to collapse
Code:
.method static constructor <clinit>()V
.locals 3
.prologue
const/4 v2, 0x0
.line 126
sput-boolean v2, Lcom/android/settings/Settings;->sShowNoHomeNotice:Z
.line 309
const/16 v0, 0x2c
new-array v0, v0, [Ljava/lang/String;
Quite literally, it is the line after it.
I am just suggesting that it should be included for context.
That way we know that this is referring to the array we defined as v0:
Code:
aput-object v2, v0, v1
Don't mind me though. I just have this thing about people blindly following tutorials while not really knowing why they are doing what they are doing...

-edit- nm

I've never done this before! I followed this guide, but I cant find Settings.apk in /system/app. Halp? Thanks!

Kobayashi_SRK said:
I've never done this before! I followed this guide, but I cant find Settings.apk in /system/app. Halp? Thanks!
Click to expand...
Click to collapse
/system/priv-app/
You will always need /system/framework/framework-res.apk. Install this as a framework.
Once you rebuild, take just the classes.dex from the build/apk/ folder and jam it back in the original apk. Repush that to your device with adb and chmod 644 it.
Also, if you're on a ROM with custom settings already, the values in this guide might not be suitable. Mine were offset by +2.

Kobayashi_SRK said:
I've never done this before! I followed this guide, but I cant find Settings.apk in /system/app. Halp? Thanks!
Click to expand...
Click to collapse
It is in /system/priv-app IIRC.

Awesome! Everything worked until I tried to rebuild the APK. I know I must be missing some simple step somewhere...
stdout:
Code:
[[email protected] android_****ery]$ sudo apktool b Settings
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 19, --target-sdk-version, 19, -F, /tmp/APKTOOL8793864650703229355.tmp, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /home/kobayashi/android_****ery/Settings/res, -M, /home/kobayashi/android_****ery/Settings/AndroidManifest.xml]
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.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 19, --target-sdk-version, 19, -F, /tmp/APKTOOL8793864650703229355.tmp, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /home/kobayashi/android_****ery/Settings/res, -M, /home/kobayashi/android_****ery/Settings/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:357)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 19, --target-sdk-version, 19, -F, /tmp/APKTOOL8793864650703229355.tmp, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /home/kobayashi/android_****ery/Settings/res, -M, /home/kobayashi/android_****ery/Settings/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:93)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:355)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
at java.lang.Runtime.exec(Runtime.java:617)
at java.lang.Runtime.exec(Runtime.java:485)
at brut.util.OS.exec(OS.java:84)
... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
... 10 more
My previous commands:
Code:
adb pull /system/priv-app/Settings.apk
adb pull /system/framework/framework-res.apk
apktool if framework-res.apk
apktool d Settings.apk
nano Settings.smali
apktool b Settings
Thanks in advance, guys!

Will this work on SGH-M919?

Kobayashi_SRK said:
Awesome! Everything worked until I tried to rebuild the APK. I know I must be missing some simple step somewhere...
stdout:
Code:
[[email protected] android_****ery]$ sudo apktool b Settings
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 19, --target-sdk-version, 19, -F, /tmp/APKTOOL8793864650703229355.tmp, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /home/kobayashi/android_****ery/Settings/res, -M, /home/kobayashi/android_****ery/Settings/AndroidManifest.xml]
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.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 19, --target-sdk-version, 19, -F, /tmp/APKTOOL8793864650703229355.tmp, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /home/kobayashi/android_****ery/Settings/res, -M, /home/kobayashi/android_****ery/Settings/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:357)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 19, --target-sdk-version, 19, -F, /tmp/APKTOOL8793864650703229355.tmp, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /home/kobayashi/android_****ery/Settings/res, -M, /home/kobayashi/android_****ery/Settings/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:93)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:355)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
at java.lang.Runtime.exec(Runtime.java:617)
at java.lang.Runtime.exec(Runtime.java:485)
at brut.util.OS.exec(OS.java:84)
... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
... 10 more
My previous commands:
Code:
adb pull /system/priv-app/Settings.apk
adb pull /system/framework/framework-res.apk
apktool if framework-res.apk
apktool d Settings.apk
nano Settings.smali
apktool b Settings
Thanks in advance, guys!
Click to expand...
Click to collapse
Apktool can't find aapt from the android toolkit. Make sure that utility is in your path. You could set apktool not to decompile resources, or alternatively you can use smali / baksmali to the same effect.
Code:
java -jar baksmali.jar -o Settings
nano Settings.smali
java -jar smali.jar Settings -o classes.dex
Then just rezip the apk with the new built classes.dex
Sent from my Nexus 7 using Tapatalk 4

Fenny said:
Apktool can't find aapt from the android toolkit. Make sure that utility is in your path.
Click to expand...
Click to collapse
I dunno how to use java -jar yet, and decompiling with -s doesn't give me the Settings.smali file I need to alter.
However, I already had aapt installed, just had to logout for the changes to take effect in my bash config.
--------
Thanks so much everyone for your help!
Here's everything I did:
Code:
adb pull /system/priv-app/Settings.apk
adb pull /system/framework/framework-res.apk
apktool if framework-res.apk
apktool d Settings.apk
nano Settings/smali/com/android/settings/Settings.smali
apktool b Settings
adb push Settings.apk /sdcard/
adb root
adb remount
adb shell cp /system/priv-app/Settings.apk /system/priv-app/Settings.bak
adb shell cp /sdcard/Settings.apk /system/priv-app/Settings.apk
adb reboot
Here's the million dollar question. Everything appears to have worked right, but where do I access AppOps?
EDIT:
I just tried pulling my new Settings.apk from my phone. I decompiled it, and looked again at the Settings.smali file to find that none of my changes were saved... Gonna try this again.
EDIT 2:
Okay, yeah. Just pulled Settings.bak, decompiled, re-applied changes to Settings.smali, apktool b Settings, then moved the Settings.apk file to a different folder, decompiled that, and found none of my changes to Settings.smali stuck. I must be missing something obvious here....
Does apktool spit out the newly built .apk somewhere else?
EDIT 3:
Oh! It puts the new Settings.apk file in Settings/dist/
Derp. Now I think I understand what everyone's been saying about jamming the classes.dex file into the new .apk. I dunno how to do that though. Time for more researching...

Kobayashi_SRK said:
Here's the million dollar question. Everything appears to have worked right, but where do I access AppOps?
EDIT:
I just tried pulling my new Settings.apk from my phone. I decompiled it, and looked again at the Settings.smali file to find that none of my changes were saved... Gonna try this again.
EDIT 2:
Okay, yeah. Just pulled Settings.bak, decompiled, re-applied changes to Settings.smali, apktool b Settings, then moved the Settings.apk file to a different folder, decompiled that, and found none of my changes to Settings.smali stuck. I must be missing something obvious here....
Does apktool spit out the newly built .apk somewhere else?
EDIT 3:
Oh! It puts the new Settings.apk file in Settings/dist/
Derp. Now I think I understand what everyone's been saying about jamming the classes.dex file into the new .apk. I dunno how to do that though. Time for more researching...
Click to expand...
Click to collapse
Okay, here is the big secret. Apk files are secretly zip files. Unzip the original apk file to a folder. Copy your newly built classes.dex into that folder, and rezip. Just make sure you maintain the same folder structure. (I.E. make sure that classes.dex is in the root of the zip)
Since this is a system apk there should be no need to re-sign the apk. You can check to see if you need to re-sign by looking to see if the classes.dex file is included in the signatures in the meta-inf folder. If you modify any file included in that list of hashes, you must re-sign the apk.
P.S. You should probably also chmod the apk to 644 rw,r,r.
Sent from my Nexus 7 using Tapatalk 4

Thank you!! Worked brilliantly.
Only thing is that i can't see App Ops in activities when creating a shortcut. I can use App Ops Starter from playstore though to launch app ops (people commented it didn't work with 4.4.2 but worked for me after this smali hack).
I just want to add a straight "link" to App Ops on EchoeRom Settings app, but couldn't for the life of me get the activities or target classes right.. Always caused a FC when pressing "Launch App Ops" from my settings. That forced me to continue using App Ops Starter app, even though i wanted to get rid of extra apps..
Anyone has an idea why it didn't work? I tried it so many times, but this was the simplest one i thought would work:
Code:
PreferenceScreen android:icon="@drawable/app_ops" android:title="App Ops" android:summary="Control app permissions">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.applications.AppOpsSummary" />
</PreferenceScreen>
and
Code:
PreferenceScreen android:icon="@drawable/app_ops" android:title="App Ops" android:summary="Control app permissions">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.Settings$AppOpsSummaryActivity" />
</PreferenceScreen>
but couldn't get it to work. I also tried this
Code:
<PreferenceScreen android:title="App Ops" android:summary="Control app permissions" android:fragment="com.android.settings.applications.AppOpsSummary">
<extra android:name="classname" android:value="com.android.settings.Settings$AppOpsSummaryActivity" />
without any luck. I tried around 20 different variations.. Anyone could tell me where i'm going wrong and how i should implement the "link" to items inside system settings. I have only added links to other apps before..

Related

[HOWTO] enable on-screen buttons in ICS rom

{
"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"
}
sorry for my poor english.. i write this guide by request.
this is pretty simple thing..
1. decompile framework-res.apk
- you need apktool.jar 1.4.3 version to decompile ics apk.
download 1.4.3 : http://code.google.com/p/android-apktool/downloads/list
download 1.4.2 : http://code.google.com/p/android-apktool/downloads/detail?name=apktool1.4.2.tar.bz2&can=1&q=
(if you have problems with 1.4.3, use 1.4.2 instead)
2. open /res/values/bools.xml with a text editor
3. find "config_showNavigationBar" and set to true
4. to turn off capacitive buttons backlight, maybe you need to edit arrays.xml
- it does not work on my nexus s but seem to be working well on some other devices..
-----------------------------------------------------------------------------
* 5 [WVGA devices only] it would be better to slightly resize navigation bar height to avoid keyboard overlapping problem (see this post).
(or you have to lower lcd density but that cause app compatibility issues)
: open dimens.xml and find the line "navigation_bar_height".
and you need one more step to compensate buttons sizes.
download : http://www.mediafire.com/?758mnayrlt3dee4
this zip include 4 png files. add those files to SystemUI.apk (/res/drawable-hdpi/) using 7-zip or other program. (replace original PNGs to these files).
-----------------------------------------------------------------------------
6. recompile
- you need new aapt.exe from latest platform-tools.
download : http://www.mediafire.com/?0q52u6v8vdkpq1i
7. done
*if you don't know how to modify apk file, read this post first.
-
Where did you get apktool 1.4.2?
How would I disable the onscrwen keys in twlauncher 4. 5? Cause we already configured the ics keys to be our softkeus?
Sent from my SCH-I400 using xda premium
KBanause said:
Where did you get apktool 1.4.2?
Click to expand...
Click to collapse
yes interesting question
KBanause said:
Where did you get apktool 1.4.2?
Click to expand...
Click to collapse
here it is : http://www.multiupload.com/YWJHOSZ7GJ
you can find it here
ciscogee said:
How would I disable the onscrwen keys in twlauncher 4. 5? Cause we already configured the ics keys to be our softkeus?
Sent from my SCH-I400 using xda premium
Click to expand...
Click to collapse
sorry but you'd better ask your rom dev to do it..
evilisto said:
here it is : http://www.multiupload.com/YWJHOSZ7GJ
you can find it here
Click to expand...
Click to collapse
Thanks. At least I was able to recompile the framework-res.apk wothout any errors. Now I have to check if I can use it without bootloops
evilisto said:
here it is : http://www.multiupload.com/YWJHOSZ7GJ
you can find it here
sorry but you'd better ask your rom dev to do it..
Click to expand...
Click to collapse
Worked for me with this apktool
Edit: decompile that is
THX!
Could you got a little more in-depth on step 5? Whats the correct way to recompile the apk with aapt?
pingpongboss said:
Could you got a little more in-depth on step 5? Whats the correct way to recompile the apk with aapt?
Click to expand...
Click to collapse
just put aapt.exe in the same folder as apktool.jar. that's all
can someone please help me with using apktool and decompiling my framework-res?
I'm not having any trouble with decompiling, but after making the necessary changes to bools and array, I can not get it to recompile.
What am I doing wrong here?
to decompile....
Code:
apktool d framework-res.apk
....make the changes, then...
Code:
apktool b framework-res
and i get this:
Code:
c:\apktool>apktool b framework-res.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
c:\apktool>
Any help would be much appreciated.
EDIT -
Just noticed that I typed....
Code:
apktool b framework-res.apk
...instead of...
Code:
apktool b framework-res
When I tried it without the .apk, I get this....
Code:
c:\apktool>apktool b framework-res
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: c:\apktool\framework-res\res/drawable-sw600dp-h
dpi
invalid resource directory name: c:\apktool\framework-res\res/layout-sw600dp
invalid resource directory name: c:\apktool\framework-res\res/layout-w600dp
invalid resource directory name: c:\apktool\framework-res\res/values-h720dp
invalid resource directory name: c:\apktool\framework-res\res/values-sw600dp
invalid resource directory name: c:\apktool\framework-res\res/values-sw600dp-w10
24dp
invalid resource directory name: c:\apktool\framework-res\res/values-sw600dp-w12
80dp
invalid resource directory name: c:\apktool\framework-res\res/values-w360dp
invalid resource directory name: c:\apktool\framework-res\res/values-w480dp
invalid resource directory name: c:\apktool\framework-res\res/values-w500dp
invalid resource directory name: c:\apktool\framework-res\res/values-w600dp
invalid resource directory name: c:\apktool\framework-res\res/values-w720dp
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\BRANDO~1.AMY\AppData\Local
\Temp\APKTOOL5284591862303952400.tmp, -x, -S, c:\apktool\framework-res\res, -M,
c:\apktool\framework-res\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\BRANDO~1.AMY\AppData\Local\Temp\APKTOOL5284591862303952400.tmp, -x, -S, c:\
apktool\framework-res\res, -M, c:\apktool\framework-res\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more
sixfearstheseven said:
I'm not having any trouble with decompiling, but after making the necessary changes to bools and array, I can not get it to recompile.
What am I doing wrong here?
to decompile....
Code:
apktool d framework-res.apk
....make the changes, then...
Code:
apktool b framework-res
and i get this:
Code:
c:\apktool>apktool b framework-res.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
c:\apktool>
Any help would be much appreciated.
EDIT -
Just noticed that I typed....
Code:
apktool b framework-res.apk
...instead of...
Code:
apktool b framework-res
When I tried it without the .apk, I get this....
Code:
c:\apktool>apktool b framework-res
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: c:\apktool\framework-res\res/drawable-sw600dp-h
dpi
invalid resource directory name: c:\apktool\framework-res\res/layout-sw600dp
invalid resource directory name: c:\apktool\framework-res\res/layout-w600dp
invalid resource directory name: c:\apktool\framework-res\res/values-h720dp
invalid resource directory name: c:\apktool\framework-res\res/values-sw600dp
invalid resource directory name: c:\apktool\framework-res\res/values-sw600dp-w10
24dp
invalid resource directory name: c:\apktool\framework-res\res/values-sw600dp-w12
80dp
invalid resource directory name: c:\apktool\framework-res\res/values-w360dp
invalid resource directory name: c:\apktool\framework-res\res/values-w480dp
invalid resource directory name: c:\apktool\framework-res\res/values-w500dp
invalid resource directory name: c:\apktool\framework-res\res/values-w600dp
invalid resource directory name: c:\apktool\framework-res\res/values-w720dp
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\BRANDO~1.AMY\AppData\Local
\Temp\APKTOOL5284591862303952400.tmp, -x, -S, c:\apktool\framework-res\res, -M,
c:\apktool\framework-res\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\BRANDO~1.AMY\AppData\Local\Temp\APKTOOL5284591862303952400.tmp, -x, -S, c:\
apktool\framework-res\res, -M, c:\apktool\framework-res\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more
Click to expand...
Click to collapse
Same here, getting the same error when recompiling it -_- 3 people have told me it's because aapt isn't the ICS version but I updated it 3 times and even asked someone to upload and I get that same error.
GazaIan said:
Same here, getting the same error when recompiling it -_- 3 people have told me it's because aapt isn't the ICS version but I updated it 3 times and even asked someone to upload and I get that same error.
Click to expand...
Click to collapse
Yep, i did the same thing with aapt. I triple and quadruple checked that it was the ICS compatible version, but still no dice.
I don't know. I'm still patiently waiting for a proper developer to throw together a version for the Incredible that has the on screen nav buttons since i know next to nothing about this stuff, but seriously, this process looks so simple yet I'm having so much trouble with it.
Even if i did get it to compile, I'd be stuck because adb never wants to push or pull files from my phone.
Sent from my Incredible using xda premium
sixfearstheseven said:
Yep, i did the same thing with aapt. I triple and quadruple checked that it was the ICS compatible version, but still no dice.
I don't know. I'm still patiently waiting for a proper developer to throw together a version for the Incredible that has the on screen nav buttons since i know next to nothing about this stuff, but seriously, this process looks so simple yet I'm having so much trouble with it.
Even if i did get it to compile, I'd be stuck because adb never wants to push or pull files from my phone.
Sent from my Incredible using xda premium
Click to expand...
Click to collapse
You can always copy it over and set permissions (although it usually crashes before you can), or put it in an update.zip. The update.zip method is my favorite.
GazaIan said:
You can always copy it over and set permissions (although it usually crashes before you can), or put it in an update.zip. The update.zip method is my favorite.
Click to expand...
Click to collapse
How does that work? Sorry, I'm pretty new to all of this. Do I just zip up the framework apk, name it update.zip, then flash it in CWM? Or is there more to it?
If it's that easy, that would be awesome, if only I could get the apk to compile.
I'm so frustrated with this that I'm about willing to offer a donation to someone who could do it for me, although it would be much more satisfying if I could get it done on my own. Maybe I could give a donation to someone who could successfully walk me through it. The offers out there of anyone wants to take it.
Sent from my Incredible using xda premium
sixfearstheseven said:
Yep, i did the same thing with aapt. I triple and quadruple checked that it was the ICS compatible version, but still no dice.
I don't know. I'm still patiently waiting for a proper developer to throw together a version for the Incredible that has the on screen nav buttons since i know next to nothing about this stuff, but seriously, this process looks so simple yet I'm having so much trouble with it.
Even if i did get it to compile, I'd be stuck because adb never wants to push or pull files from my phone.
Sent from my Incredible using xda premium
Click to expand...
Click to collapse
try again with this aapt... : http://www.mediafire.com/?0q52u6v8vdkpq1i
evilisto said:
try again with this aapt... : http://www.mediafire.com/?0q52u6v8vdkpq1i
Click to expand...
Click to collapse
Were you able to get it to work with that?
I found a work around two days ago. I took the customized XML files and put them in a Metamorph zip file. I ran it and it successfully changed framework-res.apk but the navigation buttons still wouldn't show. Now, I don't know much about this, so I'm not sure if doing it that way should have worked, but if it should have, it didn't, which would mean the instructions in the first post are incomplete.
I'm doing this on my Incredible, so maybe the ROM I'm using is missing something else. I have no idea. I've tried it on three different ICS ROMs and it didn't work on any of them.
When I get a chance, I'll try it with the new aapt.
Sent from my ADR6300 using xda premium
Thanks for that new aapt, it works. It recompiled everything, but the file size is 4mb smaller than the original framework-res.apk. I get nothing but bootloops now. I also compiled with APK Multi Tool which also worked, but with the same results - bootloops.
Would it be possible to enable the soft buttons on a gingerbread ROM?
~=[,,_,,]:3 <----nyancat
Futur Innovations said:
Would it be possible to enable the soft buttons on a gingerbread ROM?
~=[,,_,,]:3 <----nyancat
Click to expand...
Click to collapse
I highly doubt it, enough to confidently say no.
Sent from my GT-P7510 using xda premium

[HOW TO] Compile/Decompile ICS Apk easily|100% working

We are all here to learn, take from community and give back to community!!!
@Lord ClockaN
Hya guys, after A LOT of requests, I decided to share with the community something that I found really REALLY useful for Dev's but also for other users too that want to mess up with compiling and decompiling process. Usually, non problems at all with that, but since ICS come out, many dev\users are not able to decompile\compile properly many ics apk (not all). This guide will ensure you a good result, 100% working, easy, and fastest way to mess up with ics for theming and resizing purposes, or whatever you want
BIG THX to my friend and Dev teammate @Bichon for this
Credits
@Beachon (yes, again)
@Xavierjohn22, the amazing author of AutoApktool! Visit his thread HERE, click his thanks button, and support his work with donations, and my personal thanks to author for this tool which is the most powerful and easiest tool ever.
@Brut_all for Apktool
@XDA Community
@Google
About Apktooll
Please consider to visit the original thread about this tool, because what I'm explaining here is just 1\10 of the real skill of this tool. You can do basically whatever you want with AutoApktool, themers will love it, Dev's will appreciate it a lot, I'm sure.
Why can't we use Apktool???
Well, you can, but it's more difficult, that's it.
Why do you say "must use 1.4.1 apktool version"??
The reason why is that since 1.4.2 version, apktool generate java code while recompiling process is going on, and this lead to errors that 9/10 makes decompile process fail.
Requirements (Windows environment, mine is Seven 64 bit)
Java (last version)
JDK (last version)
JDR (last version, usually included in JDK or Java)
SDK (last 3.0 version for ICS source code)
Auto_Apktool 2.0.0 (DOWNLOAD THIS ONE NOT OTHERS!!!)
HOW-TO (NOTE: before start, select Apktool version with option 21, YOU MUST CHOOSE 1.4.1 version!!)
1) Download and simply unpack Auto_ApkTool 2.0.0
2)Click on "autoapktoolmain.bat", prompt will open
{
"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"
}
3)put the apk you want to mess up with in "_INPUT_APK"
4) you can chose more than one option to decompile (option 6 is strongly recommended)
5) when option 6 is being selected, drag the apk from _INPUT_APK folder into the windows prompt and click enter
6) A Note window will appear, and will show IF the decompiling process has been done properly. Once you close that window, you will see the decompiled folder in _INPUT_APK folder
7) do your edits (xml, snali, or png, doesn't matter)
8) recompile with option 7 (NOTE: this time you MUST drag all the FOLDER, NOT the apk)
9) Once recompiling finished, open the decompiled folder, go to "dist" folder, and here you got your edited apk
10) you MUST sign the apk with option 10 (NOTE: drag the apk from dist folder to the prompt, then press enter, and in the SAME folder, a signedxxx.apk will appear)
11) Rename the apk, and push it |NOTE: you can push the apk with 62 option or with sdk typing:
Code:
adb remount
adb push xxx.apk system/app
adb reboot
That's it
Exactly what I was looking for. Thanks a milli.
Dosnt work with stock deodexed SGS2 LPH rom. Log:
[*] C:\Users\Sale\Desktop\AutoAPKTool2.0.0\_INPUT_APK\SystemUI.apk
decompiling C:\Users\Sale\Desktop\AutoAPKTool2.0.0\_INPUT_APK\SystemUI.apk...
I: Baksmaling...
Exception in thread "main" java.lang.RuntimeException: bad magic value: 64 65 78 0a 30 33 36 00
at org.jf.dexlib.DexFile.<init>(DexFile.java:377)
at org.jf.dexlib.DexFile.<init>(DexFile.java:274)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:44)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)
at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
salesale said:
Dosnt work with stock deodexed SGS2 LPH rom. Log:
[*] C:\Users\Sale\Desktop\AutoAPKTool2.0.0\_INPUT_APK\SystemUI.apk
decompiling C:\Users\Sale\Desktop\AutoAPKTool2.0.0\_INPUT_APK\SystemUI.apk...
I: Baksmaling...
Exception in thread "main" java.lang.RuntimeException: bad magic value: 64 65 78 0a 30 33 36 00
at org.jf.dexlib.DexFile.<init>(DexFile.java:377)
at org.jf.dexlib.DexFile.<init>(DexFile.java:274)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:44)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)
at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
Click to expand...
Click to collapse
Just saw this exact issue, and I don't think it's a tool fault..what U edited before recompiling?
Inviato dal mio HTC Desire HD with Beats Audio usando Tapatalk
Nothing, just decompile and always the fault
salesale said:
Nothing, just decompile and always the fault
Click to expand...
Click to collapse
First you must install framework-res.apk first then choose default option to select ur SystemUI.apk.
Then should be work fine....
If still cannot mean that apk files has been edited before !!!!!
Looks like 9png. files was edited...
Is it true that you edit any png files in res/drawable-* folder ?????
I have installed framework-res. I am not edit any file.
Here is CM9, stock LPB and stock LPH
CM9 http://dl.dropbox.com/u/28679276/CM9.7z
LPB http://www.mediafire.com/?yk9p9rezuv5r4bv
LPH http://dl.dropbox.com/u/28679276/XXLPH.7z
Can you try to decompile? Thanks
salesale said:
Nothing, just decompile and always the fault
Click to expand...
Click to collapse
R U ok with java and jdk? The fault is when U decompile or after edit and recompiling?
Inviato dal mio HTC Desire HD with Beats Audio usando Tapatalk
Java is OK. Works with nexus, SGS1, GNex files. The fault is when decompile
salesale said:
Java is OK. Works with nexus, SGS1, GNex files. The fault is when decompile
Click to expand...
Click to collapse
Something wrong with that apk, which ics version is? Are you able to decompile some apk of the same base?
Inviato dal mio HTC Desire HD with Beats Audio usando Tapatalk
Man, when i try to recompile the program give me the next error:
[*] "C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI"
recompiling "C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI"...
I: Smaling...
I: Building resources...
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res\drawable-hdpi\alert_bar_background_normal.9.png
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res\drawable-hdpi\compat_mode_help_divider_bottom.9.png
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res\drawable-hdpi\status_bar_call_ongoing_background.9.png
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res\drawable-hdpi\tw_plmn_bg.9.png
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res\drawable-hdpi\tw_quicksetting_divider_line.9.png
C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res\values\public.xml:69: error: Public entry identifier 0x7f0200d0 entry index is larger than available symbols (index 208, total symbols 44).
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\KAI5SE~1\AppData\Local\Temp\APKTOOL8579198258812201192.tmp, -I, C:\Users\Kai5ser Z\apktool\framework\1.apk, -S, C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res, -M, C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\KAI5SE~1\AppData\Local\Temp\APKTOOL8579198258812201192.tmp, -I, C:\Users\Kai5ser Z\apktool\framework\1.apk, -S, C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res, -M, C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
Sorry for put it all. maybe you can help me, when i try it to compilate, allways give me that error.
Kaiser Z
Pl. Explain what is the possible reason for showing PARSE error ( not installed) and installed but force close error ( not even start ).
KaiserZ said:
Man, when i try to recompile the program give me the next error:
[*] "C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI"
recompiling "C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI"...
I: Smaling...
I: Building resources...
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res\drawable-hdpi\alert_bar_background_normal.9.png
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res\drawable-hdpi\compat_mode_help_divider_bottom.9.png
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res\drawable-hdpi\status_bar_call_ongoing_background.9.png
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res\drawable-hdpi\tw_plmn_bg.9.png
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res\drawable-hdpi\tw_quicksetting_divider_line.9.png
C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res\values\public.xml:69: error: Public entry identifier 0x7f0200d0 entry index is larger than available symbols (index 208, total symbols 44).
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\KAI5SE~1\AppData\Local\Temp\APKTOOL8579198258812201192.tmp, -I, C:\Users\Kai5ser Z\apktool\framework\1.apk, -S, C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res, -M, C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\KAI5SE~1\AppData\Local\Temp\APKTOOL8579198258812201192.tmp, -I, C:\Users\Kai5ser Z\apktool\framework\1.apk, -S, C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res, -M, C:\Users\Kai5ser Z\Downloads\Auto_ApkTool_2.0.0\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
Sorry for put it all. maybe you can help me, when i try it to compilate, allways give me that error.
Kaiser Z
Click to expand...
Click to collapse
U are messin up with 9png mate, as themer who I am, I remember you that those png MUST be fixed with 9png patch...also remember that guys, messing up with png is always safer and cleaner when it's done on the stock apk, which means no xml edits, no smali, whatever! First of all, custom png, second recompile, third smali/xml edits, recompile again, that's the way..
Inviato dal mio HTC Desire HD with Beats Audio usando Tapatalk
memnoc said:
U are messin up with 9png mate, as themer who I am, I remember you that those png MUST be fixed with 9png patch...also remember that guys, messing up with png is always safer and cleaner when it's done on the stock apk, which means no xml edits, no smali, whatever! First of all, custom png, second recompile, third smali/xml edits, recompile again, that's the way..
Inviato dal mio HTC Desire HD with Beats Audio usando Tapatalk
Click to expand...
Click to collapse
Man you gonna hate, but im so noob, can you explain me more easily every spet that you sed.....? please, i really wanna do that, i mean, i wanna to custom the apk, i hope you can help me, and if you do that, i gonna give mi gratitud . greetings. I hope you can understan what i sad, my english is not good XD
Kaiser Z
memnoc: can u make a mirror download. I can't download from https://rapidshare.com/files/1410893164/Auto_ApkTool_2.0.0.zip please i recomend u uplad from mediafire.com
Great guide... However, I am running into the same wall that I always to when I try and re-compile the ICS Systemui.apk from my Asus Transformer Prime. I get a aapt.exe crash, followed by the following error:
Code:
C:\Users\Troy\Desktop\AutoAPKTool2.0.0\_INPUT_APK\SystemUI
recompiling C:\Users\Troy\Desktop\AutoAPKTool2.0.0\_INPUT_APK\SystemUI...
I: Smaling...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Troy\AppData\Local\Temp\APKTOOL2330637792693006158.tmp, -I, C:\Users\Troy\apktool\framework\1.apk, -S, C:\Users\Troy\Desktop\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res, -M, C:\Users\Troy\Desktop\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Troy\AppData\Local\Temp\APKTOOL2330637792693006158.tmp, -I, C:\Users\Troy\apktool\framework\1.apk, -S, C:\Users\Troy\Desktop\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\res, -M, C:\Users\Troy\Desktop\AutoAPKTool2.0.0\_INPUT_APK\SystemUI\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
I made no changes to the systemui, I simply decompiled it (which worked fine) and then recompiled it.
Yes, I did apktool install the framework from the same system, before hand.
I have gotten this error everytime on the systemui, no matter which guide or apktool version I use. The framework-res works without a hitch, but the damn systemui is a ***** that has no mercy!
Thank you for any help you can throw my way. Me and a few others on the Prime thread are trying to get a % battery mod done for the Prime, but we need to be able to recompile the SystemUI.apk first.
- Thanks

[MOD][HOWTO] 4 Way Reboot / Clock / Battery / ART-Dalvik ADB Toggle

Important tools to have handy that will be used in these guides:
APKTool
Baksmali / Smali
Example Builds for Stock Odex KOT49H:
Advanced Power Menu
Statusbar Modifications
Advanced Power Menu:
First you will want to copy the entire framework folder from the build you plan to use to a working folder.
After that is done, make sure you have baksmali, smali.jar, and baksmali.jar in the same working folder.
Copy the odex file for the item you want to modify, in this case android.policy.odex into the root of the working folder.
Open up a command prompt or terminal and cd to the working directory then run:
Code:
./baksmali -a 19 -x android.policy.odex -d framework -o policy
Now open up the policy folder that was just created and open all the folders until you get to:
policy/com/android/internal/policy/impl
In this folder, you will want to open GlobalActions.smali
Search for:
Code:
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
Right below that, you will want to make sure you have:
Code:
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$99;
const v2, 0x108007c
const v3, 0x1040361
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$99;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
the next code after this group should now be .line 264
Close and save this file, then open GlobalActions$SinglePressAction.smali
You will see a section that reads:
Code:
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/GlobalActions;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x40a
name = "SinglePressAction"
.end annotation
Below that, you will want to add:
Code:
# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;
Now skip past the next section:
Code:
# instance fields
.field private final mIcon:Landroid/graphics/drawable/Drawable;
.field private final mIconResId:I
.field private final mMessage:Ljava/lang/CharSequence;
.field private final mMessageResId:I
and add the following section directly under # direct methods:
Code:
.method static constructor ()V
.registers 3
const/4 v0, 0x4
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Reboot"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Restart"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Bootloader"
aput-object v2, v0, v1
const/4 v1, 0x3
const-string v2, "Recovery"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method
You can now save and close this file. There are three additional files (attached to the post as GlobalActions.zip) that should also be added to the folder you are currently working in.
You are now ready to package the modification back into a file. Make sure you are still in the working directory in your command prompt or terminal and run:
Code:
java -Xmx1024m -jar smali.jar policy -o classes.dex
Now it is time to use winrar, 7zip, or whatever archive program you have handy to add the new classes.dex to android.policy.jar
Once this has been done, move the file to the device and follow the section for how to odex a file.
Statusbar Modifications:
For this one, you will be modifying the SystemUI.apk directly with apktool. Copy that to the working directory and run:
Code:
./apktool if framework/framework-res.apk
Code:
./apktool decode SystemUI.apk
First, open up the SystemUI/smali/com folder and add the contents of percentage.zip (attached to post), so the new percentage folder is in the same directory as android already was.
Now return to the SystemUI folder and open SystemUI/res/layout/status_bar.xml and search for:
Code:
<com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="10.5dip" android:layout_height="16.0dip" android:layout_marginBottom="0.33000004dip" android:layout_marginStart="4.0dip" />
This is the battery icon. You can keep it or remove it. The placement from the top to the bottom of this file goes from left to right on screen. If you place a battery percentage before the icon in the file, it will be on the left of the icon on your screen. Same as placing it after would be on the right of the icon on screen.
Depending where you decide you want the percentage, paste this code:
Code:
<com.percentage.BatteryText android:textSize="14.0dip" android:gravity="center" android:layout_width="wrap_content" android:layout_height="fill_parent" />
If you want to change the size of the text, replace 14.0dip with the value you want, such as 16.0dip to match the battery height.
To center the clock, first remove the current com.android.systemui.statusbar.policy.Clock line and search for:
Code:
<com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentStart="true" />
Directly below the </LinearLayout> add:
Code:
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent">
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="center" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
</LinearLayout>
This will create a centered layout in the middle of the statusbar that contains the clock.
Now you can close and save this file and return to the command prompt or terminal window and run:
Code:
./apktool build SystemUI
You will find your new SystemUI.apk in the SystemUI/dist directory that was just created.
Don't forget to create an odex file if you came from an odex build, which is the next guide below.
How to Odex a File:
Copy dexopt-wrapper to /system/xbin/ ( One can be found at the Original Tutorial )
Code:
chmod 755 /system/xbin/dexopt-wrapper
Code:
dexopt-wrapper MODIFIED-FILE.*** TEMPORARY-ODEX-FILE.odex /system/framework/core.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/webviewchromium.jar
(The long string of files at the end is everything after export BOOTCLASSPATH in init.rc / init.environ.rc)
Code:
busybox dd if=ORIGINAL-ODEX-FILE.odex of=TEMPORARY-ODEX-FILE.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
Code:
mv TEMPORARY-ODEX-FILE.odex ORIGINAL-ODEX-FILE(NAME).odex
Now place the modified file and new odex file in a flashable zip or directly into the target directory replacing the originals.
Toggling ART and Dalvik from ADB:
Code:
adb pull /data/property/persist.sys.dalvik.vm.lib
open the file and replace the "libart.so" with "libdvm.so" (no quotes) to switch from ART to Dalvik
open the file and replace the "libdvm.so" with "libart.so" (no quotes) to switch from Dalvik to ART
Code:
adb push persist.sys.dalvik.vm.lib /data/property/
Code:
adb shell reboot
Thanks! Works great.
This is what the android community is all about. Thanks mate.
...and I'm spent. Well, I think that covers everything but the DPI modifications. I may or may not get to those later depending if they are already available when I get back. Right now I use a 240 system-wide DPI so they are more or less pointless in my case.
twistedumbrella said:
...I noticed cargobr151 was getting a little swamped trying to maintain all the various mods and updates....
Click to expand...
Click to collapse
Who says that?
Why you asking me not for permission, before you use my files and modify them?
Why you use my pictures without asking me?
Thanks for that!!!!
cargobr151 said:
Who says that?
Why you asking me not for permission, before you use my files and modify them?
Why you use my pictures without asking me?
Thanks for that!!!!
Click to expand...
Click to collapse
In the battery mod thread you were saying you were busy. Linked directly to the images and your thread. And permission to take stock system files, follow a tutorial, and still give you credit anyway? Seriously? I know you do it for the credit, but I did it for the users.
In the battery mod thread you were saying you were busy...[/QUOTE]
And? This does not mean that I make no versions.
twistedumbrella said:
...I know you do it for the credit, but I did it for the users...
Click to expand...
Click to collapse
I did it for credits? What i get therefore? Exactly...nothing. :laugh::laugh::laugh:
You did it for the users?
But only, after someone created the files, which you can use.
cargobr151 said:
In the battery mod thread you were saying you were busy...
And? This does not mean that I make no versions.
I did it for credits? What i get therefore? Exactly...nothing. :laugh::laugh::laugh:
You did it for the users?
But only, after someone created the files, which you can use.
Click to expand...
Click to collapse
garzacorporations said:
Not working for me on 4.4.2 stock.
Sent from my Nexus 5 using xda premium
Click to expand...
Click to collapse
See below
Speaking of which... A lot of these ANCIENT modifications are still heavily used so it would be good to have them all rounded up as instructions instead of single use flash files. I think I'll gather up the guides that were used and post those here so next time an update hits people have an option to make it themselves.
It seems the original publisher of the advanced power menu rushed through the mod and released a broken version so that is proof enough that the ones hosted here are rebuilt manually and not cloned.
The builds are available under the example heading
Save the drama for your mama. I just want a working mod.
Thanks for the work, both of you.
xybur said:
Save the drama for your mama. I just want a working mod.
Thanks for the work, both of you.
Click to expand...
Click to collapse
...I really have to explain this again? Someone call an adult, these kids are making a mess all over the brand new thread.
Question... Does this work with ART enable? Specially the 4 way reboot.
Request...Is it possible to make a volume buttons "skip tracks" zip or a guide on how to do it?
Thanks
Edit: OK, I read your explanation in the other thread :thumbup:
miguepereira77 said:
Question... Does this work with ART enable? Specially the 4 way reboot.
Request...Is it possible to make a volume buttons "skip tracks" zip or a guide on how to do it?
Thanks
Edit: OK, I read your explanation in the other thread :thumbup:
Click to expand...
Click to collapse
Technically it should work if you enable ART AFTER installing the mods. I tried it, but was unable to test because I had Xposed and it locked up my phone. Speaking of, I should add the quick guide to disable ART from ADB.
Well, I found http://forum.xda-developers.com/showthread.php?t=2071970 so let's see if it works. I have a lot of respect for the people that can actually write smali code (but not those who copy it and flip out like that makes them developers). It looks a lot like when I write Java after not sleeping and functions end up wherever I am when I start writing a chunk.
I'm guessing it's not worth doing in a Windows environment?
EddyOS said:
I'm guessing it's not worth doing in a Windows environment?
Click to expand...
Click to collapse
They make some visual apktool for windows. It's probably easier. I use a Mac. It's like the outcast since everything has to be ported or modified.
I have a Ubuntu build I can jump on if needed
Did you cover changing the size of the % at all? I'm after the battery % to the left of the icon same size as the clock font and with the % the same size as the number (like cargo's original mod)
EddyOS said:
I have a Ubuntu build I can jump on if needed
Did you cover changing the size of the % at all? I'm after the battery % to the left of the icon same size as the clock font and with the % the same size as the number (like cargo's original mod)
Click to expand...
Click to collapse
Something is up with my app or the forum because half that section vanished. In the XML, you would change the font size from 14 (I think it was?) to 16, 18, whatever for the com.percentage.BatteryText
I change a few things in the bat mod.
Change the bat icon line android:layout_marginStart="4.0dip" to android:layout_marginStart="2.0dip"
and add this at the end of the percent line: android:layout_marginStart="2.0dip"
Works on percent on the left of icon only
Without
View attachment 2451249
With mod
View attachment 2451250
siefaz said:
I change a few things in the bat mod.
Change the bat icon line android:layout_marginStart="4.0dip" to android:layout_marginStart="2.0dip"
and add this at the end of the percent line: android:layout_marginStart="2.0dip"
Works on percent on the left of icon only
Without
View attachment 2451249
With mod
View attachment 2451250
Click to expand...
Click to collapse
You could add the 2 pixel buffer as marginEnd on the icon to do it with the text on the right

(HOW TO)Xperia Features Port Collection(CM12.1)

Xperia Features Port Collection
Code:
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
Notes
I did not port everything please read the Thanks To section and give thanks to the original Porters.
This is a collection of How to's so that everything is in one section. I have added Xperia apps that I have Ported.
If you know of any other Port Guides Please let me know so I can add them
How To
Tutorial in Second Post
Thanks To
@STRYDER~007 for this Tutorial on Superuser MOD and for SystemUI http://forum.xda-developers.com/cro...t-xperia-z5-systemui-particle-effect-t3206206
@xperiaz2 for this tutorial and Camera Effects http://forum.xda-developers.com/crossdevice-dev/sony/guide-how-to-port-featured-sony-camera-t3169253
@xperiaz2 for this guide on Phonebook,Dialer & InCallUIhttp://forum.xda-developers.com/crossdevice-dev/sony/guide-how-to-port-featured-sony-t3208276
@gamzekal for this guide on Small Appshttp://forum.xda-developers.com/crossdevice-dev/sony/cm12-how-to-easily-port-xperia-lolipop-t3110734
Featured Apps
Calculator
Calendar
File Manager
Live Wallpaper
Home
Keyboard
Clock
Movie Creator
Dlna
Music
Albums
Movies
Sketch
Lifelog
PhotoEditor
PhoneBook
Dailer
Featured Cameras
Add the Cameras Widget to your Home Screen and launch camera apps from there.
do not launch the Camera app as it force closes.
Background Defocus
Areffect
Arfun
Live on Youtube
Social Live
Panorama
Manual
Features of SystemUI
Particle Effect
Z Style Status Bar
Z Style Pull Down
Small Apps
Bugs:-
Some of the Quick Settings tiles are not working.
PIN,Pattern and Password locks are not working. (3x3 pattern lock works fine.)
Click to expand...
Click to collapse
Downloads In Second Post​
1.Framework-res.apk
REF: http://forum.xda-developers.com/crossdevice-dev/sony/cm12-how-to-easily-port-xperia-lolipop-t3110734
Decompile Framework-res.apk
open \framework-res\AndroidManifest.xml
add this code above
<uses-permission android:name="android.permission.CONFIRM_FULL_BACKUP"/>
Code:
<permission android:name="com.sony.smallapp.permission.CONTROL_SMALLAPP" android:protectionLevel="system|signature"/>
<permission android:description="@string/permdesc_smallapp" android:label="@string/permlab_smallapp" android:name="com.sony.smallapp.permission.SMALLAPP" android:protectionLevel="dangerous"/>
<permission android:description="@string/permdesc_taskSwitcherPluginView" android:label="@string/permlab_taskSwitcherPluginView" android:name="com.sonymobile.permission.TASK_SWITCHER_PLUGIN_VIEW" android:protectionLevel="signatureOrSystem"/>
<permission android:name="com.sonymobile.permission.ACCESS_BEACON_MANAGER" android:protectionLevel="system|signature"/>
open \framework-res\res\values\strings.xml
and add these lines at the end before
</resources>
Code:
<string name="permlab_smallapp">Show small apps</string>
<string name="permdesc_smallapp">Allow the application to display small apps on top of other applications.</string>
<string name="permlab_taskSwitcherPluginView">Provide plugin-view to the task-switcher</string>
<string name="permdesc_taskSwitcherPluginView">Allows the application to provide a plugin-view to the task-switcher.</string>
Save your modifications and recompile it.
2.android.policy.jar
Decompile android.policy.jar
REF: http://forum.xda-developers.com/crossdevice-dev/sony/cm12-how-to-easily-port-xperia-lolipop-t3110734
open \android.policy\com\android\internal\policy\impl\PhoneWindowManager.smali
find this "android.permission.SYSTEM_ALERT_WINDOW"
mine looked like this
Code:
const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
const/16 v3, 0x18
aput v3, p2, v2
goto :goto_2a
:sswitch_data_42
.sparse-switch
0x7d2 -> :sswitch_3b
0x7d3 -> :sswitch_3b
0x7d5 -> :sswitch_36
0x7d6 -> :sswitch_3b
0x7d7 -> :sswitch_3b
0x7da -> :sswitch_3b
0x7db -> :sswitch_2a
0x7dd -> :sswitch_2a
0x7e7 -> :sswitch_2a
0x7ee -> :sswitch_2a
0x7ef -> :sswitch_2a
0x7f0 -> :sswitch_2a
.end sparse-switch
.end method
so i modified like this
Code:
const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
const/16 v3, 0x18
aput v3, p2, v2
goto :goto_2a
[COLOR="red"] :sswitch_2d
const-string v0, "com.sony.smallapp.permission.SMALLAPP"
goto :goto_2a[/COLOR]
:sswitch_data_42
.sparse-switch
0x7d2 -> :sswitch_3b
0x7d3 -> :sswitch_3b
0x7d5 -> :sswitch_36
0x7d6 -> :sswitch_3b
0x7d7 -> :sswitch_3b
0x7da -> :sswitch_3b
0x7db -> :sswitch_2a
0x7dd -> :sswitch_2a
0x7e7 -> :sswitch_2a
0x7ee -> :sswitch_2a
0x7ef -> :sswitch_2a
0x7f0 -> :sswitch_2a
[COLOR="Red"] 0xbb5 -> :sswitch_2d
0xbb6 -> :sswitch_2d[/COLOR]
.end sparse-switch
.end method
notice that the goto: after "com.sony.smallapp.permission.SMALLAPP" is the same goto as a the goto above :sswitch_2d
and that the :sswitch_2d was not in the origonal method if you already have a :sswitch_2d make it something else like :sswitch_3
Save your modifications and recompile it.
3.framework.jar
Decompile your framework.jar
REF: http://forum.xda-developers.com/crossdevice-dev/sony/guide-how-to-port-featured-sony-t3208276
REF: http://forum.xda-developers.com/crossdevice-dev/sony/cm12-how-to-easily-port-xperia-lolipop-t3110734
Open /Framework/android/telephony/TelephonyManager.smali
find this line .method public handlePinMmi and add this before
Code:
.method public getVoicemailString()Ljava/lang/String;
.registers 3
.prologue
.line 3592
iget-object v0, p0, Landroid/telephony/TelephonyManager;->mContext:Landroid/content/Context;
if-nez v0, :cond_6
const/4 v0, 0x0
.line 3593
:goto_5
return-object v0
:cond_6
iget-object v0, p0, Landroid/telephony/TelephonyManager;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const v1, 0x1040051
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
move-result-object v0
goto :goto_5
.end method
Open /Framework/android/telecom/Call.smali
find this method
Code:
.method public getDetails()Landroid/telecom/Call$Details;
.registers 2
iget-object v0, p0, Landroid/telecom/Call;->mDetails:Landroid/telecom/Call$Details;
return-object v0
.end method
and add this after if you cant find this code just add it to the end
Code:
.method public getNotificationCode()I
.registers 2
.prologue
.line 415
iget v0, p0, Landroid/telecom/Call;->mNotificationCode:I
return v0
.end method
.method public getNotificationType()I
.registers 2
.prologue
.line 410
iget v0, p0, Landroid/telecom/Call;->mNotificationType:I
return v0
.end method
find this
Code:
.field private final mListeners:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List",
"<",
"Landroid/telecom/Call$Listener;",
">;"
}
.end annotation
.end field
and add this after if you cant find this just add it under
# instance fields
Code:
.field private mNotificationCode:I
.field private mNotificationType:I
Open /Framework/android/telecom/Phone.smali
Add This Field at line 55
Code:
.field private mSomcInCallAdapterExtend:Landroid/telecom/SomcInCallAdapterExtend;
Add This method before .method public switchToOtherActiveSub
Code:
.method public final somcGetCommand(ILjava/lang/String;)Ljava/lang/String;
.registers 5
.parameter "commandId"
.parameter "option"
.prologue
.line 386
const/4 v0, 0x0
.line 387
.local v0, result:Ljava/lang/String;
iget-object v1, p0, Landroid/telecom/Phone;->mSomcInCallAdapterExtend:Landroid/telecom/SomcInCallAdapterExtend;
if-eqz v1, :cond_b
.line 388
iget-object v1, p0, Landroid/telecom/Phone;->mSomcInCallAdapterExtend:Landroid/telecom/SomcInCallAdapterExtend;
invoke-virtual {v1, p1, p2}, Landroid/telecom/SomcInCallAdapterExtend;->somcGetCommand(ILjava/lang/String;)Ljava/lang/String;
move-result-object v0
.line 389
:cond_b
return-object v0
.end method
Download the attached framework.zip and extract it.
copy all the files to your framework
recompile
4.services.jar
Follow this tutorial
http://forum.xda-developers.com/showpost.php?p=62909773&postcount=4
5.Flashing
Download this
XPERIA MOD SLIPSYSTEM
open the zip using winrar
copy the files created to /system/framework folder by dragging and dropping
How To Install
1. Flash Rom
2. Flash Gapps
3. Flash Xperia Mod
4. Wipe Data, Cache and Dalvik
Fixes
Device gets stuck after bootanimation
SystemUI No SuperUserMod
Frameworks
this section will consist of flashable frameworks that have already been built so users dont have to port for the same rom twice.
Nice Guide.Keep it up!!!
Does it any chance will work without superuser mod...
As stryder ported another system ui which doesn't require superusermod(same thread u linked) n that worked for me
I tried to enable superuser mod
Made necessary changes in services.jar
But problem is phone boots up normally but reboots after every 30-40 sec...
Device-yureka
Rom-cm12.1snapshot
55pawan said:
Does it any chance will work without superuser mod...
As stryder ported another system ui which doesn't require superusermod(same thread u linked) n that worked for me
I tried to enable superuser mod
Made necessary changes in services.jar
But problem is phone boots up normally but reboots after every 30-40 sec...
Device-yureka
Rom-cm12.1snapshot
Click to expand...
Click to collapse
Yes there is a chance. not sure if the Dailer will work properly though. I have added the No SuperUserMod SystemUI to the fixes section, because I notice the same thing on my AICP Build it wouldnt work with the z5 systemui. so I just flashed the SystemUI in the fixes. Mine booted and dailer worked but not properly.
my suggestion is try it. add SuperUserMod anyway even if its not working. then flash the SystemUI Fix.
If you do manage to port it please send me the 4 framework files from the guide and a link to your rom. I want to start putting flashable zips so people dont have to port it themselve they can check if it already ported yet.
Thankyou!!! Everything worked except for Phone App.... had to flash it apart and wipe data
i'm trying all thing but this is my error log
Log For : framework.jar
Log Type : Recompiling
Log Recorded At : Mon 09-11-2015 13:51:42.90
Log Recorded By : Advanced ApkTool v4.1.0 By BDFreak
------------------------------------------------------
..\3-Out\framework.jar\smali\android\telecom\Phone.smali[826,4] Error for input '.parameter': Invalid directive
..\3-Out\framework.jar\smali\android\telecom\Phone.smali[827,4] Error for input '.parameter': Invalid directive
..\3-Out\framework.jar\smali\android\telecom\Phone.smali[826,15] mismatched input '"commandId"' expecting END_METHOD_DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: android/telecom/Phone.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:71)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:55)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:372)
at brut.androlib.Androlib.buildSources(Androlib.java:299)
at brut.androlib.Androlib.build(Androlib.java:282)
at brut.androlib.Androlib.build(Androlib.java:256)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
------------------------------------------------------
me framework and framework-res http://www.4shared.com/file/vx_v_VNNce/orignal_fremwark.html
can you port it for me
My experience
when i decompile & recompile it without any modfied it done ok
when i modfied AndroidManifest.xml i have this error
HTML:
C:\ApkTools>apktool b framework-res framework-res4.apk
I: Using Apktool 2.0.0-a766db-SNAPSHOT
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
C:\ApkTools\framework-res\AndroidManifest.xml:596: error: Error: No resource found that matches the given name (at 'description' with value '@string/permdesc_taskSwitcherPluginView').
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\AMR~1.FAY\AppData\Local\Temp\brut_util_Jar_5206867388793866612.tmp, p, --forced-package-id, 1, --min-sdk-version, 22, --target-sdk-version, 22, --version-code, 22, --version-name, 5.1.1-14b489c0ec, -F, C:\Users\AMR~1.FAY\AppData\Local\Temp\APKTOOL3756931933599328368.tmp, -x, -0, arsc, -S, C:\ApkTools\framework-res\res, -M, C:\ApkTools\framework-res\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:443)
at brut.androlib.Androlib.buildResources(Androlib.java:380)
at brut.androlib.Androlib.build(Androlib.java:283)
at brut.androlib.Androlib.build(Androlib.java:255)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\AMR~1.FAY\AppData\Local\Temp\brut_util_Jar_5206867388793866612.tmp, p, --forced-package-id, 1, --min-sdk-version, 22, --target-sdk-version, 22, --version-code, 22, --version-name, 5.1.1-14b489c0ec, -F, C:\Users\AMR~1.FAY\AppData\Local\Temp\APKTOOL3756931933599328368.tmp, -x, -0, arsc, -S, C:\ApkTools\framework-res\res, -M, C:\ApkTools\framework-res\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:511)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:429)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [C:\Users\AMR~1.FAY\AppData\Local\Temp\brut_util_Jar_5206867388793866612.tmp, p, --forced-package-id, 1, --min-sdk-version, 22, --target-sdk-version, 22, --version-code, 22, --version-name, 5.1.1-14b489c0ec, -F, C:\Users\AMR~1.FAY\AppData\Local\Temp\APKTOOL3756931933599328368.tmp, -x, -0, arsc, -S, C:\ApkTools\framework-res\res, -M, C:\ApkTools\framework-res\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:505)
... 6 more
i put META-INF & resources.arsc from original apk then try again it successful but the device does not work and stands at logo
when i decompile the modfied framework-res i have this error what is wrong ??
HTML:
C:\ApkTools>apktool d framework-res.apk
I: Using Apktool 2.0.0-a766db-SNAPSHOT on framework-res.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode XML
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:147)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decodeManifest(XmlPullStreamDecoder.java:153)
at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecoder.java:134)
at brut.androlib.res.AndrolibResources.decodeManifestWithResources(AndrolibResources.java:294)
at brut.androlib.Androlib.decodeManifestWithResources(Androlib.java:138)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:102)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
Caused by: java.io.IOException: Expected: 0x00080003, got: 0x6d783f3c
at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)
at brut.androlib.res.decoder.AXmlResourceParser.doNext(AXmlResourceParser.java:839)
at brut.androlib.res.decoder.AXmlResourceParser.next(AXmlResourceParser.java:96)
at brut.androlib.res.decoder.AXmlResourceParser.nextToken(AXmlResourceParser.java:106)
at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.nextToken(XmlPullParserDelegate.java:105)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:140)
... 7 more
I think it's because of modfied AndroidManifest.xml What's the solution
error while recompiling
can you help me with below error plz
thanks you
done all as you said still this error
Log For : framework.jar
Log Type : Recompiling
Log Recorded At : 18-11-2015 -- 1:47:29.20
Log Recorded By : Advanced ApkTool v4.1.0 By BDFreak
------------------------------------------------------
..\3-Out\framework.jar\smali\android\os\storage\StorageManager$ListenerDelegate$1.smali[26,4] Error for input '.parameter': Invalid directive
..\3-Out\framework.jar\smali\android\os\storage\StorageManager$ListenerDelegate$1.smali[27,4] Error for input '.parameter': Invalid directive
..\3-Out\framework.jar\smali\android\os\storage\StorageManager$ListenerDelegate$1.smali[28,4] Error for input '.parameter': Invalid directive
..\3-Out\framework.jar\smali\android\os\storage\StorageManager$ListenerDelegate$1.smali[27,15] mismatched input '"x0"' expecting END_METHOD_DIRECTIVE
..\3-Out\framework.jar\smali\android\os\storage\StorageManager$ListenerDelegate$1.smali[45,4] Error for input '.parameter': Invalid directive
..\3-Out\framework.jar\smali\android\os\storage\StorageManager$ListenerDelegate$1.smali[45,15] mismatched input '"msg"' expecting END_METHOD_DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: android/os/storage/StorageManager$ListenerDelegate$1.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:71)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:55)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:378)
at brut.androlib.Androlib.buildSources(Androlib.java:305)
at brut.androlib.Androlib.build(Androlib.java:288)
at brut.androlib.Androlib.build(Androlib.java:261)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
------------------------------------------------

DIRECTV NOW app for Shield TV?

Hi all,
**This is regarding the DirecTV NOW service that just launched 11/30, not the normal satellite DirecTV**
At launch, no app for Android TV yet, just on mobile and tablets. I tried the following sideload methods:
Sideload mobile Android apk
-Only air cursor works and video will not stream. Eventually force closes
Sideload Fire TV stick apk
-wont let you sign in without Amazon app store
A lot of you here are a lot smarter than I am. Any ideas to try? It's a shame they didn't support Android TV at launch.
Does anyone have a gen 2 Fire TV device?
Ok, so I was able to extract the Fire TV .apk file and sideload onto my Nvidia Shield TV. I was able to open it and navigate using the standard Shield remote. The only issue I am having is playing live TV content. Sometimes it loaded fine and other times it gives me an error and telling me to Refresh the content. Seems to be very buggy for Android TV. Here is a link to the extracted .apk file. I would like to see what you guys get trying this out.
uploadfiles.io/52771#.WEGhSyGy1_U.email
Anyone knows if this works under any US VPN outside of USA?
I guess I will try modding this app later to try to make it work on the Shield. Or try the one posted here but I know the IOS app on my iPhone I just can't make it work behind a US VPN, it detects that I'm not in USA with any US VPN connection I try. It gets the info from Location Services.
saulin78 said:
Anyone knows if this works under any US VPN outside of USA?
I guess I will try modding this app later to try to make it work on the Shield. Or try the one posted here but I know the IOS app on my iPhone I just can't make it work behind a US VPN, it detects that I'm not in USA with any US VPN connection I try. It gets the info from Location Services.
Click to expand...
Click to collapse
If a VPN doesn't work, I'm not sure. The app wouldn't stream on my phone because it was rooted. I removed root and voila, streamed fine. So unfortunately that takes some options off the table.
..
JJ-KwiK said:
I modified the apk to remove any Amazon Appstore checks for someone else. I don't in the US, so I can't test if it's working. Here's the apk if anyone is interested.
https://mega.nz/#!2ponECAL!VyyXMwZ36g13MBiD7jeX3VbV3_8mriYaDK3hBhbr5mk
Click to expand...
Click to collapse
I just tested. I can confirm it no longer asks for Amazon credentials, but it won't let you stream. The app works perfectly, and will even start streaming for a split second, then you get an error 40.
They must do some sort of device check only when attempting to stream because this is the same exact way it behaved when I tried it on my rooted phone (my shield is not rooted).
I can also confirm that it no longer prompts you about the missing Amazon app store. Streaming remains unchanged from the original ported app however, I can only get about 15-25 channels to stream reliably, with the overall majority showing error 40 after working for just a split second. (All the ESPN and Disney channel's seem to stream fine).
JJ-KwiK said:
I modified the apk to remove any Amazon Appstore checks for someone else. I don't in the US, so I can't test if it's working. Here's the apk if anyone is interested.
https://mega.nz/#!2ponECAL!VyyXMwZ36g13MBiD7jeX3VbV3_8mriYaDK3hBhbr5mk
Click to expand...
Click to collapse
Hey man, can you remove the check for the updated one that just came out?
http://www.mediafire.com/file/d5ds6cie7x57hst/DirecTV.Now.AFTV2.apk
montajd said:
Hey man, can you remove the check for the updated one that just came out?
http://www.mediafire.com/file/d5ds6cie7x57hst/DirecTV.Now.AFTV2.apk
Click to expand...
Click to collapse
This ^^^. They required GPS to stream and that requirement has been removed in the new version. Could very well have been what was tripping us up
..
Thanks for modding the app again. The good news is that you don't have to modify it for lean back, it already appears in the launcher after installation.
The bad news is it still only streams a small handful of the channels, so the newer version of the app didn't solve any of the issues of trying to use it on the shield.
The app functions so well that I am hopeful that they will reach a deal to get the official app to Android TV sooner rather than later. Here's hoping that they can integrate it into the Live Channels app, which is probably what the hold up is.
..
JJ-KwiK which tool or which commands are You using to decompile and recompile the apk?
I keep getting an error when recompiling with apktool after I made my modifications with Notepad++
I usually don't have issues with other apps. That's why I'd like to know what you are using to decompile, recompile and sign the apk
I think we can remove 3 checks if we bypass these checks. If anyone wants to do these and also remove the Amazon Store Check from the latest FireTV version maybe we can get a working version for the Shield.
Code:
in ---> \smali\com\comscore\applications\AppStartMeasurement.smali
invoke-static {}, Lcom/comscore/utils/RootDetector;->isDeviceRooted()Z
move-result v1
if-eqz v1, :cond_1
Code:
In ---> \smali\com\insidesecure\drmagent\v2\internal\DRMAgentNativeBridge.smali
invoke-static {}, Lcom/comscore/utils/RootDetector;->a()Z
move-result v1
if-eqz v1, :cond_1
Code:
In ---> \smali\com\comscore\analytics\Census.smali
invoke-virtual {v1}, Lcom/comscore/analytics/Core;->isSecure()Z
move-result v0
if-eqz v0, :cond_2
Code:
In ---> smali\com\comscore\analytics\comScore.smali
invoke-virtual {p0}, Lcom/comscore/analytics/Core;->isSecure()Z
move-result v0
if-eqz v0, :cond_1
Code:
In ---> \smali\com\comscore\utils\OfflineMeasurementsCache.smali
invoke-virtual {v0}, Lcom/comscore/analytics/Core;->isSecure()Z
move-result v0
if-eqz v0, :cond_5
There is also the check that throws an error if outside USA even behind a VPN. But I'd like to know if bypassing these checks help
This is what I get with apktool when recompiling
Code:
C:\Users\Vero>C:\apk2tv1.1\apktool b C:\apk2tv1.1\temp
I: Using Apktool 2.2.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes3 folder into classes3.dex...
I: Checking whether resources has changed...
I: Building resources...
W: C:\apk2tv1.1\temp\res\layout\preference_list_fragment.xml:4: error: Error: Re
source is not public. (at 'id' with value '@android:id/menu').
W:
W: C:\apk2tv1.1\temp\res\layout\preference_widget_switch.xml:2: error: Error: Re
source is not public. (at 'id' with value '@android:id/right_icon').
W:
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec (exit code = 1): [C:\User
s\Vero\AppData\Local\Temp\brut_util_Jar_8423560757252002085.tmp, p, --forced-pac
kage-id, 127, --min-sdk-version, 19, --target-sdk-version, 24, --version-code, 1
0002106, --version-name, 1.0.0.2106, -F, C:\Users\Vero\AppData\Local\Temp\APKTOO
L8970358793249648231.tmp, -0, arsc, -0, res/raw/quickplay_authentec_opl150_pr_ce
rt, -0, res/raw/quickplay_authentec_opl150_pr_privatekey, -0, res/raw/quickplay_
authentec_opl150_wm_cert, -0, res/raw/quickplay_authentec_opl150_wm_privatekey,
-0, res/raw/quickplay_authentec_opl2000_pr_cert, -0, res/raw/quickplay_authentec
_opl2000_pr_privatekey, -0, res/raw/quickplay_authentec_opl2000_wm_cert, -0, res
/raw/quickplay_authentec_opl2000_wm_privatekey, -0, res/raw/quickplay_authentec_
opl400_pr_cert, -0, res/raw/quickplay_authentec_opl400_pr_privatekey, -0, res/ra
w/quickplay_authentec_opl400_wm_cert, -0, res/raw/quickplay_authentec_opl400_wm_
privatekey, -0, arsc, -I, C:\Users\Vero\AppData\Local\apktool\framework\1.apk, -
S, C:\apk2tv1.1\temp\res, -M, C:\apk2tv1.1\temp\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:473)
at brut.androlib.Androlib.buildResources(Androlib.java:407)
at brut.androlib.Androlib.build(Androlib.java:306)
at brut.androlib.Androlib.build(Androlib.java:263)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not
exec (exit code = 1): [C:\Users\Vero\AppData\Local\Temp\brut_util_Jar_842356075
7252002085.tmp, p, --forced-package-id, 127, --min-sdk-version, 19, --target-sdk
-version, 24, --version-code, 10002106, --version-name, 1.0.0.2106, -F, C:\Users
\Vero\AppData\Local\Temp\APKTOOL8970358793249648231.tmp, -0, arsc, -0, res/raw/q
uickplay_authentec_opl150_pr_cert, -0, res/raw/quickplay_authentec_opl150_pr_pri
vatekey, -0, res/raw/quickplay_authentec_opl150_wm_cert, -0, res/raw/quickplay_a
uthentec_opl150_wm_privatekey, -0, res/raw/quickplay_authentec_opl2000_pr_cert,
-0, res/raw/quickplay_authentec_opl2000_pr_privatekey, -0, res/raw/quickplay_aut
hentec_opl2000_wm_cert, -0, res/raw/quickplay_authentec_opl2000_wm_privatekey, -
0, res/raw/quickplay_authentec_opl400_pr_cert, -0, res/raw/quickplay_authentec_o
pl400_pr_privatekey, -0, res/raw/quickplay_authentec_opl400_wm_cert, -0, res/raw
/quickplay_authentec_opl400_wm_privatekey, -0, arsc, -I, C:\Users\Vero\AppData\L
ocal\apktool\framework\1.apk, -S, C:\apk2tv1.1\temp\res, -M, C:\apk2tv1.1\temp\A
ndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:439)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:459)
... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\
Vero\AppData\Local\Temp\brut_util_Jar_8423560757252002085.tmp, p, --forced-packa
ge-id, 127, --min-sdk-version, 19, --target-sdk-version, 24, --version-code, 100
02106, --version-name, 1.0.0.2106, -F, C:\Users\Vero\AppData\Local\Temp\APKTOOL8
970358793249648231.tmp, -0, arsc, -0, res/raw/quickplay_authentec_opl150_pr_cert
, -0, res/raw/quickplay_authentec_opl150_pr_privatekey, -0, res/raw/quickplay_au
thentec_opl150_wm_cert, -0, res/raw/quickplay_authentec_opl150_wm_privatekey, -0
, res/raw/quickplay_authentec_opl2000_pr_cert, -0, res/raw/quickplay_authentec_o
pl2000_pr_privatekey, -0, res/raw/quickplay_authentec_opl2000_wm_cert, -0, res/r
aw/quickplay_authentec_opl2000_wm_privatekey, -0, res/raw/quickplay_authentec_op
l400_pr_cert, -0, res/raw/quickplay_authentec_opl400_pr_privatekey, -0, res/raw/
quickplay_authentec_opl400_wm_cert, -0, res/raw/quickplay_authentec_opl400_wm_pr
ivatekey, -0, arsc, -I, C:\Users\Vero\AppData\Local\apktool\framework\1.apk, -S,
C:\apk2tv1.1\temp\res, -M, C:\apk2tv1.1\temp\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:95)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:433)
... 6 more
Basically if we can patch the app to let it know that the device is secure and not rooted it might work. This is how I patched the AT&T U-Verse app and I can stream with it on the Nvidia Shield Android TV
..
Thanks JJ-KwiK. With that tool and Dex Manager. I was able to do the modifications and recompile the apk. However. I'm still getting error 40. It's still failing the security check
At least we can Google Cast until an official app is released or hacked proper. Would be nice to cast over mobile data though and not use up ISP data.
Is there any word on an official release for an Android TV version of DTV Now? I got the free Apple TV 4 deal but much prefer my Mi Box.
ya i got the free apple tv coming which i know would work well but i really would like to have this on my shield tv sooner than later! Thanks for the work i know i tried for a log time to get amazon videos on the shield
https://plus.google.com/+IsraelOliverJr414515/posts/KUURHCPHySi
Haven't tried it yet but feedback says it's working on all channels with no buffering.
Sent from my LG-H918 using Tapatalk

Categories

Resources