[Guide] [How-to] Remove Connections Optimizer Android 4.3 TW - Sprint Samsung Galaxy S III

Remove Connections Optimizer
I thought I better share this here in case anyone else needs it as well.
There seems to be some confusion over the Connections Optimizer because once the app has been removed from a rom, the menu item still displays causing FC issues when selected.
This will remove the option from Settings/More networks/Mobile networks (screenshot attached).
[Guide] For the Devs
Smali edit.
SecPhone/com/android/phone/PhoneFeature.smali
Remove or comment out the line highlighted in Red.
Cheers - TD
Remove the line highlighted in RED:
Code:
const-string v6, "sprint_connections_optimizer"
invoke-virtual {v9}, Ljava/lang/Boolean;->booleanValue()Z
move-result v2
if-nez v2, :cond_12b5
const/4 v2, 0x0
:goto_d86
invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v2
[COLOR="Red"]invoke-virtual {v3, v6, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;[/COLOR]

const-string v6, "sprint_connections_optimizer"
invoke-virtual {v9}, Ljava/lang/Boolean;->booleanValue()Z
move-result v2
if-nez v2, :cond_72
const/4 v2, 0x0
:goto_3a
invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v2
invoke-virtual {v3, v6, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/ObjectLjava/lang/Object; <<REMOVED
Need help with this one seems the Mod doesnt work anymore.
Here are the errors I get with the apktool when building the file after using your method.
C:\apktool>apktool if framework-res.apk
I: Framework installed to: C:\Users\Mr. Street\apktool\framework\1.apk
C:\apktool>apktool if twframework-res.apk
I: Framework installed to: C:\Users\Mr. Street\apktool\framework\2.apk
C:\apktool>apktool if SystemUI.apk
I: Framework installed to: C:\Users\Mr. Street\apktool\framework\127.apk
C:\apktool>apktool b -f SecPhone
I: Using Apktool 2.0.2-dirty
I: Smaling smali folder into classes.dex...
I: Building resources...
E/ResourceType(10252): Failed resolving ResTable_map name at 1244 with ident 0x02040000
W/ResourceType(10252): Attempt to retrieve bag 0x0201001f which is invalid or in a cycle.
W/ResourceType(10252): Attempt to retrieve bag 0x0201001f which is invalid or in a cycle.
warning: Package not found for resource #0201001f
warning: Package not found for resource #0201001f
warning: Package not found for resource #0201001f
I: Building apk file...
I: Copying unknown files/dir...

Related

[MOD] 4-Way Reboot - How to (GB) (ICS) (JB)

Thanks to snq- for original 4-way reboot.
Got the idea from THIS thread.
This is just simple mod that adds 4 booting options behind power menus "power off" -button ( 1. reboot 2. hot boot 3. recovery 4. download ).
So, compared to advanced power menu, this has only one new button. But I made this because now there is no need for framework.jar/framework-res changes. This is much more friendly to update.
I only make this tutorial and attach needed files. Everyone can use it way they want to, but give credit to original maker.
Check THIS post for Samsung ICS roms
Check THIS post for Samsung JB roms
Problem? Check THESE for help.
What you need to do is:
-Decompile android.policy.jar of your rom
-Copy attached folder to yours
-Open GlobalActions.smali
-Search line "Lcom/android/internal/policy/impl/GlobalActions$4;" ( some roms might have different number on shutdown button. You find right one by for example tracing shutdown icon id )
-Change number 4 to 99 ( two of them )
Before
Code:
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$4;
const v3, 0x1080030
const v4, 0x1040150
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$4;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
After
Code:
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$99;
const v3, 0x1080030
const v4, 0x1040150
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$99;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
-Open GlobalActions$SinglePressAction.smali
-Before line "# instance fields"
paste following code
Code:
# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;
-Then after line "# direct methods"
paste following code
Code:
.method static constructor ()V
.registers 3
const/4 v0, 0x5
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, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x3
const-string v2, "Recovery"
aput-object v2, v0, v1
const/4 v1, 0x4
const-string v2, "Shutdown"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method
-So your file should look something like this after those changes
Code:
.class abstract Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.super Ljava/lang/Object;
.source "GlobalActions.java"
# interfaces
.implements Lcom/android/internal/policy/impl/GlobalActions$Action;
# 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
# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;
# instance fields
.field private final mIconResId:I
.field private final mMessageResId:I
# direct methods
.method static constructor ()V
.registers 3
const/4 v0, 0x5
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, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x3
const-string v2, "Recovery"
aput-object v2, v0, v1
const/4 v1, 0x4
const-string v2, "Shutdown"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method
.method protected constructor (II)V
.registers 3
.parameter "iconResId"
.........
.........
-Compile .jar and your done.
{
"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"
}
Additional
If you don't want that "Shutdown Method" text on top of that menu then:
-Open GlobalActions$99.smali
-Remove following code
Code:
const-string v2, "Shutdown Method"
invoke-virtual {v1, v2}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;
move-result-object v1
Problem? Check following posts for help.
When pressing restart/shutdown button and you only see title and "ok" and "cancel" -buttons, then see THIS post.
Hot reboot does not work? See HERE.
Hi, i tried to do this mod but not work....the option menu disappears and system reboot...
I renamed the file and his path in GlobalActions$15.smali but I can not make it work...
barikke74 said:
Hi, i tried to do this mod but not work....the option menu disappears and system reboot...
I renamed the file and his path in GlobalActions$15.smali but I can not make it work...
Click to expand...
Click to collapse
Hi!
You have to change those three files names then. In your case like 15, 15$1, 15$2. Then you changed that path in globalactions from 4 to 15? Great so far. Now you need to change every name called globalactions$10 to that $15 inside those three files i attached. You might want to use notepad++ for this. There's addon that can do this easily.
Maybe i rename those files to something else, since people have so big numbers on globalactions.
EDIT. I uploaded new source files. Now It's named $99, so i bet that none have that already existing. Edited tutorial also, so you name 4 to 99 in GlobalActions.smali
Hi kahvitahra and thanks for the quick response
I did all that you said but it does not work
Now I try with the new source
Thanks again
barikke74 said:
Hi kahvitahra and thanks for the quick response
I did all that you said but it does not work
Now I try with the new source
Thanks again
Click to expand...
Click to collapse
If you still have problems, then please attach logcat, so i can see what causes it.
I do not work ...
I put the logcat, I hope will be helpful to
http://dl.dropbox.com/u/52103175/alogcat.2012-03-31-14-38-49+0200.txt
and this is the policy
http://dl.dropbox.com/u/52103175/android.policy.jar
barikke74 said:
I do not work ...
I put the logcat, I hope will be helpful to
http://dl.dropbox.com/u/52103175/alogcat.2012-03-31-14-38-49+0200.txt
and this is the policy
http://dl.dropbox.com/u/52103175/android.policy.jar
Click to expand...
Click to collapse
What rom is that? is it ICS?
My bad that i have not been using ICS yet. Atleast your rom have build that global.actions differently. Your power off button is number $5. So instead of changing that 4 to 99, you should change 5 to 99. There can be something else changed also, but you can try just that if you like. Or since you have restart button already(?) then if i was you i would replace that button ($6) and then remove that shutdown from my files.
I should flash ICS and test this on it.
Yes, my ROM is ICS based...
If you try on ICS i wait your notice
Thanks for your time
Will test this out now
Moved to themes and apps.
Btw, nice work
Samsung ICS roms
What you need to do is:
-Decompile android.policy.jar of your rom
-Copy attached ICS folder to yours (POST 1)
-In file "GlobalActions$99.smali" there is id 0x1110008, you might want to check that this id is same in you roms puplic.xml ( config_sf_slowBlur ). In gingerbread roms this did not change, but not I'm not sure about these ICS roms.
( check also that ids 0x104000a = "ok" -string and 0x104 = "cancel" -string matches in your framework. )
-Open GlobalActions.smali
-Search line "new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$6;" ( some roms might have different number on reboot button. You find right one by for example tracking mRestart. See example below. )
-Change number 6 to 99 ( two of them )
Before
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$6;
const v1, 0x1080640
const v2, 0x1040165
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$6;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
After
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$99;
const v1, 0x1080640
const v2, 0x1040165
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$99;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
-Open GlobalActions$SinglePressAction.smali
-Before line "# instance fields"
paste following code
Code:
# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;
-Then after line "# direct methods"
paste following code
Code:
.method static constructor <clinit>()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, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Download"
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
-So your file should look something like this after those changes
Code:
.class abstract Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.super Ljava/lang/Object;
.source "GlobalActions.java"
# interfaces
.implements Lcom/android/internal/policy/impl/GlobalActions$Action;
# 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
# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;
# instance fields
.field private final mIconResId:I
.field private final mMessageResId:I
# direct methods
.method static constructor <clinit>()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, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Download"
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
.method protected constructor <init>(II)V
.registers 3
.parameter "iconResId"
.........
.........
-Compile .jar and your done.
I'm sorry but can not seem to make it work
I follow your instructions to the letter.....i don't understand
EDIT: ok ok.....finally I succeeded
Thanks 10000000
barikke74 said:
I'm sorry but can not seem to make it work
I follow your instructions to the letter.....i don't understand
EDIT: ok ok.....finally I succeeded
Thanks 10000000
Click to expand...
Click to collapse
It should work. Tested it on couple of ICS roms. Attach logcat with error, then maybe i could help you.
Edit. Great man.
I can't decompile android.policy.jar. It said it doesn't contain classes.dex. I opened it with winrar, it only has 1 folder META-INF. It's a SGS2 with ICS LP3
interpol2050 said:
I can't decompile android.policy.jar. It said it doesn't contain classes.dex. I opened it with winrar, it only has 1 folder META-INF. It's a SGS2 with ICS LP3
Click to expand...
Click to collapse
Your rom must be odexed then?
See THIS thread for how to decompile and odex those back.
I tried to deodex android.policy.jar but got this error. Could you help?
C:\Users\Q*****\Documents\Samsung\Deodex-Odex>java -Xmx1024m -jar baksmali.jar
-c :core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:framework2.j
ar:android.policy.jar:services.jar:apache-xml.jar:filterfw.jar -x android.policy
.odex
UNEXPECTED TOP-LEVEL EXCEPTION:
org.jf.dexlib.Util.ExceptionWithContext: Unknown opcode: f1
at org.jf.dexlib.Util.ExceptionWithContext.withContext(ExceptionWithCont
ext.java:54)
at org.jf.dexlib.Code.InstructionIterator.IterateInstructions(Instructio
nIterator.java:87)
at org.jf.dexlib.CodeItem.readItem(CodeItem.java:157)
at org.jf.dexlib.Item.readFrom(Item.java:76)
at org.jf.dexlib.OffsettedSection.readItems(OffsettedSection.java:48)
at org.jf.dexlib.Section.readFrom(Section.java:143)
at org.jf.dexlib.DexFile.<init>(DexFile.java:431)
at org.jf.baksmali.main.main(main.java:250)
Caused by: java.lang.RuntimeException: Unknown opcode: f1
at org.jf.dexlib.Code.InstructionIterator.IterateInstructions(InstructionIterator.java:51)
... 6 more
Error occured at code address 28
code_item @0x12c04
interpol2050 said:
I tried to deodex android.policy.jar but got this error. Could you help?
C:\Users\Q*****\Documents\Samsung\Deodex-Odex>java -Xmx1024m -jar baksmali.jar
-c :core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:framework2.j
ar:android.policy.jar:services.jar:apache-xml.jar:filterfw.jar -x android.policy
.odex
UNEXPECTED TOP-LEVEL EXCEPTION:
org.jf.dexlib.Util.ExceptionWithContext: Unknown opcode: f1
at org.jf.dexlib.Util.ExceptionWithContext.withContext(ExceptionWithCont
ext.java:54)
at org.jf.dexlib.Code.InstructionIterator.IterateInstructions(Instructio
nIterator.java:87)
at org.jf.dexlib.CodeItem.readItem(CodeItem.java:157)
at org.jf.dexlib.Item.readFrom(Item.java:76)
at org.jf.dexlib.OffsettedSection.readItems(OffsettedSection.java:48)
at org.jf.dexlib.Section.readFrom(Section.java:143)
at org.jf.dexlib.DexFile.<init>(DexFile.java:431)
at org.jf.baksmali.main.main(main.java:250)
Caused by: java.lang.RuntimeException: Unknown opcode: f1
at org.jf.dexlib.Code.InstructionIterator.IterateInstructions(InstructionIterator.java:51)
... 6 more
Error occured at code address 28
code_item @0x12c04
Click to expand...
Click to collapse
DL latest baksmali/smali 1.3.2 and for ICS files you also need to use API Level: 15. So add "-a 15" command when baksmalin. See HERE.
I did this: Deodex -> decompile -> modify -> compile -> reodex -> copy signature. No error occured and all seem fine as expected. I placed original android.policy.jar and patched and signed android.policy.odex to /system/framework but my SG2 stuck at boot animation. Any idea? ( I restored my SG2 btw )

[WIP] Need Help from all you experienced themer out there.

I happen to fall in love with Lewa OS.
Lewa os as this wonderfull app named PIM.apk which works as dialer cum messaging app.
The only flaw in this apk is it shows smiley key while composing message instead of enter key.
I am trying to modify the messaging app (PIM.apk) of Lewa os so that it displays “Enter key instead of smiley key when we compose messages
does anyone know how should i go about it.?
”
I've uploaded all the required files. if you could check the xml what should I edit in this xml so that smiley key changes to enter key.
I have searched the forum found this tutorial but this tutorial doesn’t seem to work on this apk.
mikko3024 said:
How to apply the Mms.apk next line mod.
Note: This guide assumes that you have knowledge of decompiling-recompiling apks, baksmali-ing and smali-ing.
The mod is a two part modification.
- First is to remove the smiley button when typing an sms/mms with the enter button by modifying layout xml res files. After changing the xml res files, the enter button would appear. But the enter button would function as in the enter-to-send behavior.
- Second is to modify a smali ui file to change the enter-to-send behavior and allow inserting next lines in the text editor.
Part I - Showing the enter button.
1. Decompile the Mms.apk. (apktool or any tool of your preference)
2. Open res/layout/compose_message_activity.xml
3. find |textShortMessage and delete it. (From my experience there is usually a single instance of that text in the file.)
4. Recompile the apk.
Note: You may need to perform apktool if framework-res.apk first to successfully decompile and recompile without errors.
Part II - Smali edit.
1. From the decompiled files under Part I, open smali/com/android/mms/ui/ComposeMessageActivity.smali.
2. Modify the method onEditorAction with the snippet below. (The line with .method public onEditorAction(Landroid/widget/TextView;ILandroid/view/KeyEventZ)
Modified .method snippet:
Code:
.method public onEditorAction(Landroid/widget/TextView;ILandroid/view/KeyEvent;)Z
.locals 4
.parameter "v"
.parameter "actionId"
.parameter "event"
.prologue
const/4 v3, 0x1
const/4 v2, 0x0
.line 3217
if-eqz p3, :cond_4
.line 3218
invoke-virtual {p3}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v0
const/16 v1, 0x17
if-eq v0, v1, :cond_0
invoke-virtual {p3}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v0
const/16 v1, 0x42
if-ne v0, v1, :cond_1
:cond_0
move v0, v2
.line 3232
:goto_0
return v0
.line 3221
:cond_1
invoke-virtual {p3}, Landroid/view/KeyEvent;->isShiftPressed()Z
move-result v0
if-nez v0, :cond_3
.line 3222
invoke-direct {p0}, Lcom/android/mms/ui/ComposeMessageActivity;->isPreparedForSending()Z
move-result v0
if-eqz v0, :cond_2
.line 3223
invoke-direct {p0}, Lcom/android/mms/ui/ComposeMessageActivity;->confirmSendMessageIfNeeded()V
:cond_2
move v0, v3
.line 3225
goto :goto_0
:cond_3
move v0, v2
.line 3227
goto :goto_0
.line 3229
:cond_4
invoke-direct {p0}, Lcom/android/mms/ui/ComposeMessageActivity;->isPreparedForSending()Z
move-result v0
if-eqz v0, :cond_5
.line 3230
invoke-direct {p0}, Lcom/android/mms/ui/ComposeMessageActivity;->confirmSendMessageIfNeeded()V
:cond_5
move v0, v3
.line 3232
goto :goto_0
.end method
3. Adjust the .line numbering to the numbering used by the previous method before patching. Not adjusting the .line numbering would/may cause errors.
Note that your .line numbering may be different from my .line numbering. For example your previous .method may occupy 3040 to 3055. Adjust the above code's .line numbering to fit that range.
4. After modifying the smali file, create a duplicate of the smali folder.
5. Smali the smali folder to obtain a new classes.dex file.
Code:
java -jar ./smali.jar -o ./classes.dex ./smali
6. Open the patched Mms.apk file earlier using WinZip or WinRAR and overwrite its classes.dex file with the new modified one.
If you're on Ubuntu you can type this command in terminal:
Code:
zip -m Mms.apk classes.dex
7. Copy the patched Mms.apk file to your phone's /system/app folder. Apply proper ownership and permissions.
Click to expand...
Click to collapse

[HOWTO] Extended Power Menu (EPM): adding Recovery & Download

{
"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"
}
This thread is a continuation of many previous ones, mainly the one by untermensch (http://forum.xda-developers.com/showthread.php?t=811532). I kept the mod going for ICS (http://forum.xda-developers.com/showpost.php?p=24218275&postcount=217), and figured 4.2.2 is deserving of a new thread.
The good news is the framework actually simplified the mod, requiring only two files to be updated. This tutorial is based on UCUAMDL.
1. framework-res.apk (this 1st part is unchanged from previous thread)
a) In strings.xml, add:
Code:
<string name="epm_recovery">Recovery</string>
<string name="epm_download">Download</string>
b) In public.xml, add (NOTE: these resource IDs will change in the future!!):
Code:
<public type="string" name="epm_recovery" id="0x010408e3" />
<public type="string" name="epm_download" id="0x010408e4" />
<public type="drawable" name="ic_lock_recovery" id="0x01080c9d" />
<public type="drawable" name="ic_lock_download" id="0x01080c9e" />
c) Lastly, add your two icons as ic_lock_recovery.png and ic_lock_download.png in drawable-hdpi.
Compile framework-res.apk, upload and reboot phone.
-----------------------------------------------------------------------------------------------
2. android.policy.jar
a) In GlobalActions.smali, add the following variables around line 150:
Code:
.field private mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.field private mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
b) Same file, find:
.line 566
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$5;
const v1, 0x108097f
const v2, 0x1040199
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$5;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
Add this code directly below it (NOTE: this code references the resource IDs above, be sure to correct if they've changed):
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$18;
const v1, [COLOR="Red"]0x1080c9d[/COLOR]
const v2, [COLOR="red"]0x10408e3[/COLOR]
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$18;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$19;
const v1, [COLOR="red"]0x1080c9e[/COLOR]
const v2, [COLOR="red"]0x10408e4[/COLOR]
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$19;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
c) About 10 lines below, you will see:
.line 659
const/4 v0, 0x6
Change it to:
Code:
const/16 v0, 0x8
d) About 20 lines below that, you will see:
const/4 v1, 0x5
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mBugReport:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
Add this code directly after:
Code:
const/4 v1, 0x6
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x7
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
e) All that's left is to add the 2 smalis to handle when the menu items are selected. This is where the code is now simplified, as we don't need to mess with framework.jar anymore. In short, ShutDownThread.smali in framework has a reboot method that supports a parameter. So we simply call it with the appropriate param (either recovery or download).
Still in policy.jar, copy GlobalActions$5.smali as a template for GlobalActions$18.smali, change all the $5 to $18, and then we are going to replace the onPress method with this:
Code:
.method public onPress()V
.registers 6
.prologue
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions[COLOR="Red"]$18[/COLOR];->this$0:Lcom/android/internal/policy/impl/GlobalActions;
# getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v1}, Lcom/android/internal/policy/impl/GlobalActions;->access$000(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
move-result-object v1
const-string v2, [COLOR="red"]"recovery"[/COLOR]
const/4 v3, [COLOR="red"]0x1[/COLOR] # CONFIRMATION FLAG
invoke-static {v1, v2, v3}, Lcom/android/server/power/ShutdownThread;->reboot(Landroid/content/Context;Ljava/lang/String;Z)V
return-void
.end method
Repeat this step for GlobalActions$19.smali but change "recovery" to "download", and $18 to $19, in the code fragment above. Also note, you can decide whether you want a confirmation dialog or not by setting v3 to 0x0 (no) or 0x1 (yes).
Compile android.policy.jar, upload and reboot! If all went well, you will see the EPM with your new options :fingers-crossed:
ADDENDUM:
If you're interested in adding Flashlight to the EPM, this is the onPress method:
Code:
.method public onPress()V
.registers 6
.prologue
sget-boolean v0, Lcom/android/internal/policy/impl/GlobalActions$20;->mFlashlight:Z
if-nez v0, :cond_6
const/4 v2, 0x1
goto :goto_7
:cond_6
const/4 v2, 0x0
:goto_7
sput-boolean v2, Lcom/android/internal/policy/impl/GlobalActions$20;->mFlashlight:Z
invoke-static {v2}, Lcom/sec/android/hardware/SecHardwareInterface;->setTorchLight(I)V
return-void
.end method
Good info. Looks like I have some work to do. Question, would these modifications require deodexed rom?
Tapped from the Shear Galaxy Near You!
htcslic said:
Good info. Looks like I have some work to do. Question, would these modifications require deodexed rom?
Tapped from the Shear Galaxy Near You!
Click to expand...
Click to collapse
I only work with deodexed files.
jeboo said:
I only work with deodexed files.
Click to expand...
Click to collapse
Gonna try with odex'd and see how things go..
Tapped from the Shear Galaxy Near You!
Awesome work jeboo
thanks for your efforts!
Sent from my SHV-E300S using XDA Premium HD app
I've updated the OP onPress() code to make the phone shut down gracefully (animation, etc). It seems rebootOrShutdown was a bit too low level. You can also decide if you want a confirmation box too. Thanks to shoman for pointing this out
Are you thinking of making a flashable zip?
Sent from my SAMSUNG-SGH-I337 using xda premium
goobieracing said:
Are you thinking of making a flashable zip?
Sent from my SAMSUNG-SGH-I337 using xda premium
Click to expand...
Click to collapse
I rarely post .zips, and it would be unwise in this case. Mismatched resource IDs will lead to crash and/or possible bootloop.
I updated the OP with the code needed for adding a Flashlight menu option.
jeboo said:
I updated the OP with the code needed for adding a Flashlight menu option.
Click to expand...
Click to collapse
Really Nice brother! Thanks alot
Can you make toturial for screen short....
Sent from my GT-I9205
I have use this info 2 or 3 times now, great work, and works perfect...thanks.
---------- Post added at 09:53 AM ---------- Previous post was at 09:51 AM ----------
jeboo said:
I rarely post .zips, and it would be unwise in this case. Mismatched resource IDs will lead to crash and/or possible bootloop.
Click to expand...
Click to collapse
lol, and trust me, this is exactly what happens, it will not boot. been there done that...
I wish there was one place with info like this for other mods....you know, like a all in one place...would be cool.
I'll post the screenshot code later, it was not a trivial patch
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
jeboo said:
I'll post the screenshot code later, it was not a trivial patch
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
Click to expand...
Click to collapse
@jeboo Hey bro I'm trying to do this setup for the Note 3, can I get the icons for the download and recovery options if you don't mind? Thanks bro!
htcslic said:
Gonna try with odex'd and see how things go..
Tapped from the Shear Galaxy Near You!
Click to expand...
Click to collapse
I posted this in a different thread but this one seems more active.
I am running JB 4.2.2 on a Tmobile Galaxy S4. Here is what I've done thus far:
1) Pulled /system/framework/framework-res.apk
2) Installed framework.
Code:
I: Framework installed to: C:\Users\Syed\apktool\framework\1.apk
3) Decompiled framework-res.apk
Code:
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
4) Added the two drawables in /res/drawable-hdpi
5) Added the two strings in /res/values/strings.xml
Code:
<string name="download">Bootloader</string>
<string name="recovery">Recovery</string>
6) Compiled framework-res.apk
7) Deodexed android.policy.jar with "Universal Deodexer V4"
8) Made my GlobalActions smali changes.
9) Tried to odex android.policy.jar back but got stuck on how to do it. Used Auto Odexer Script by Alkhafaf. If I can get past this part, I'll be able to push both the updated framework-res.apk and the odex'ed android.policy.jar and see the results.
Were you able to succeed with your odex'ed files? Thanks.
i have tried many guides for EPM and got same result my phone dont pass the first screen ie. Galaxy ace gts5830i
Any solution??
Sent from my GT-S5830i using Tapatalk 2
destructo570 said:
i have tried many guides for EPM and got same result my phone dont pass the first screen ie. Galaxy ace gts5830i
Any solution??
Click to expand...
Click to collapse
There are a couple xposed modules that do this. Might be worth the try.
destructo570 said:
i have tried many guides for EPM and got same result my phone dont pass the first screen ie. Galaxy ace gts5830i
Any solution??
Sent from my GT-S5830i using Tapatalk 2
Click to expand...
Click to collapse
I'll post a new diff once 4.4 is out..There may be some subtle changes causing problems.
EPM
I tried this on a Verizon S4 running MK2 4.3 and when I hold down the power button. The phone just hot boots.
Do you have a how to for 4.3? I just figured it out. Got it working on 4.3. See here http://forum.xda-developers.com/showthread.php?t=2623196
Thank You for all your hard work
Hello!
Thank you for your great mod!
I've followed all the instructions and got 2 extra strings in power menu, but there's one issue:
For some reason Recovery id named "Bootloader" and Download is named :Recovery" and also, when i press "Download"("Recovery on the screenshot) phone just reboots as normal, while, when i press "Recovery" ("Bootloader" on the screenshot), phone normally boots to recovery.
So, can anybody help me to correct this?
Thank you!
UPD. Fixed names, but phone still doesnt boot to download mode.

[MOD][GUIDE]Enable Heads Up Notifications

This guide was written based on the Sprint Samsung Galaxy S3 ND8 KitKat stock ROM but with the proper modifications may work for other KitKat ROMs. Please don't ask me to modify this to work with ROM xyz or to compile this for you into a ROM. I won't do it.
Background Info
As you know, Android 4.4 has a heads-up notification feature built in but disabled with no way to enable it from settings. While there are various Xposed modules that will enable this for you as well as give some additional functionality (such as whitelisting), I personally don't use Xposed because it causes conflicts on my ROM so I decided to figure out how to enable it myself. Simply enabling Heads Up notifications caused all sorts of force closes any time an ongoing notification presented itself so that had to be worked out as well.
Requirements
apktool 2.0 beta 9 and the knowledge of how to use it. There are various guides on how to use apktool on XDA. Find one and read it. Make sure to read the information on the apktool site as well since some of the options in 2.0 may be different from the guides you find.
A text editor that supports Unix-style text files. I recommend Notepad++.
Files
You'll be working with the following apks:
SystemUI.apk
SecSettings.apk
SystemUI.apk
Decompile SystemUI.apk using apktool.
Open smali\com\android\systemui\statusbar\BaseStatusBar.smali in your preferred text editor.
Find .method protected shouldInterrupt(Landroid/service/notification/StatusBarNotificationZ.
This method is of no use to us in it's current form and is what causes the force closes/ongoing notification issues so we are going to completely remove it and replace it with the following:
Code:
.method protected shouldInterrupt(Landroid/service/notification/StatusBarNotification;)Z
.locals 12
.param p1, "sbn" # Landroid/service/notification/StatusBarNotification;
.prologue
const/4 v8, 0x0
const/4 v9, 0x1
.line 1292
invoke-virtual {p1}, Landroid/service/notification/StatusBarNotification;->isOngoing()Z
move-result v4
if-nez v4, :cond_0
iget-object v10, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mPowerManager:Landroid/os/PowerManager;
invoke-virtual {v10}, Landroid/os/PowerManager;->isScreenOn()Z
move-result v1
:goto_0
return v1
:cond_0
move v1, v8
goto :goto_0
.end method
Save the file and recompile SystemUI using apktool. Don't forget to re-sign the APK (either use an APK signer if you have a ROM that has 3rd-party system app signatures enabled or copy the AndroidManifest.xml file and META-INF folder from the original to the new APK).
That's it for SystemUI.apk.
SecSettings.apk
Decompile SecSettings.apk with apktool.
First, we need to add the title and summary for the setting to enable Heads Up notifications. Open res\values\Strings.xml in your preferred text editor.
Add the following lines to the bottom of the file:
Code:
<string name="heads_up">Heads up notifications</string>
<string name="heads_up_desc">Enable heads up notifications</string>
Save the file and close it.
Next we need to add the setting entry. Open res\xml\display_settings.xml in your preferred text editor.
Add the following line underneath your preferred setting category (I chose to place it under "General" in my ROM):
Code:
<CheckBoxPreference android:title="@string/heads_up" android:key="heads_up_setting" android:widgetLayout="@touchwiz:layout/preference_widget_twcheckbox" />
Save the file and close it.
Finally, we will add the code to enable/disable Heads Up notifications. Open smali\com\android\settings\DisplaySettings.smali in your preferred text editor.
Find # instance fields and add the following line (on a new line) somewhere before # direct methods:
Code:
.field private mHeadsUp:Landroid/preference/CheckBoxPreference;
Find .method private updateState()V, then locate the section of code that looks similar to this:
Code:
:cond_0
invoke-direct {p0}, Lcom/android/settings/DisplaySettings;->updateInformativeScreenSummary()V
.line 1374
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v4, "display_battery_percentage"
invoke-static {v0, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-eqz v0, :cond_2
move v0, v1
:goto_0
invoke-virtual {v3, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
Your variables (v#'s), conditionals (cond_#'s), gotos (goto_#'s), and .line #'s may differ. Under the line invoke-virtual {v3, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V, add:
Code:
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mHeadsUp:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v4, "heads_up_enabled"
invoke-static {v0, v4, v2}, Landroid/provider/Settings$Global;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-eqz v0, :cond_8
move v0, v1
:goto_6
invoke-virtual {v3, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
You'll want to change the variables to match the ones in the prior code section if they are different for you. Also make sure to change the conditional and goto labels to one hexadecimal numeral higher than the highest one already present in the method (for example, in stock ND8, the highest conditional is cond_7 so we choose cond_8 for the conditional here and the highest goto is goto_5 so we chose goto_6).
Scroll down to the end of the method and add the following above .end method:
Code:
:cond_8
move v0, v2
goto/16 :goto_6
Make sure to change v2 to whatever variable is defined at the beginning of the method as 0x0 (ie. const/4 v2, 0x0 in this case).
Find .method public onCreate(Landroid/os/BundleV, then locate the section of code that looks similar to the following:
Code:
const-string v0, "display_battery_level"
invoke-virtual {p0, v0}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v0
check-cast v0, Landroid/preference/CheckBoxPreference;
iput-object v0, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
Again, your variables (v#'s) may differ. Beneath the line iput-object v0, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;, add the following:
Code:
const-string v0, "heads_up_setting"
invoke-virtual {p0, v0}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v0
check-cast v0, Landroid/preference/CheckBoxPreference;
iput-object v0, p0, Lcom/android/settings/DisplaySettings;->mHeadsUp:Landroid/preference/CheckBoxPreference;
Make sure to change the variable #'s to match the ones in the prior code section.
Find .method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/PreferenceZ and locate the section of code that looks similar to:
Code:
:cond_a
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_c
.line 1530
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1531
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v4, "display_battery_percentage"
if-eqz v0, :cond_b
move v3, v2
:cond_b
invoke-static {v1, v4, v3}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_3
.line 1533
:cond_c
As usual, your variables (v#'s), conditionals (cond_#'s), gotos (goto_#'s), and .line #'s may differ. Under :cond_c, add the following:
Code:
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mHeadsUp:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_2b
.line 1530
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mHeadsUp:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1531
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v4, "heads_up_enabled"
if-eqz v0, :cond_2c
move v3, v2
:cond_2c
invoke-static {v1, v4, v3}, Landroid/provider/Settings$Global;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_3
:cond_2b
Again, you'll want to change the variables to match the ones in the prior code section if they are different for you and make sure to change the conditional labels to one hexadecimal numeral higher than the highest one already present in the method. Change the goto/16 :goto_3 to match the one in the previous code section.
Save the file and close it.
That's it for SecSettings.apk. Recompile and re-sign it.
Install both files to your phone using your preferred method. You should already know this but I'll say it anyway, THESE FILES CANNOT BE INSTALLED LIKE NORMAL SIDE-LOADED APKs. I prefer to reboot to recovery and use ADB to push the files to the system, but you can use whatever method is easiest for you (ie. Aroma file manager, flashable zip, etc.).
So I guess those of us that aren't very good at this will have to wait then? Lol
Sent from my SPH-L710 using Tapatalk
Great tutorial man! Thank you looking forward to add this to all my releases soon. Great job!
Great, it compiles without mistakes with Dn3 4.4.2 for N7105, but I was playing with my 4 years old daughter and I'm sure something will be wrong, lol!
I just had to use cond 8 instead of 7, but I will report very likely my failure... It will take longer for me to let it work.
Anyway, it is a very useful tutorial and it's the only one here.
Mismatch?
I think there is a typo in the code for statusbar, it says mismatched input "p1" expecting END_METHOD_DIRECTIVE
I took this one from your original code (the one inside your rom) and it compiles fine
.method protected shouldInterrupt(Landroid/service/notification/StatusBarNotificationZ
.locals 12
.parameter "sbn"
.prologue
const/4 v8, 0x0
const/4 v9, 0x1
.line 1292
invoke-virtual {p1}, Landroid/service/notification/StatusBarNotification;->isOngoing()Z
move-result v4
if-nez v4, :cond_0
iget-object v10, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mPowerManager:Landroid/os/PowerManager;
invoke-virtual {v10}, Landroid/os/PowerManager;->isScreenOn()Z
move-result v1
:goto_0
return v1
:cond_0
move v1, v8
goto :goto_0
.end method
I will re-check the next steps, because last night I was unable to get everything working (I am not a dev).
Thanks again.
lucaoldb said:
I think there is a typo in the code for statusbar, it says mismatched input "p1" expecting END_METHOD_DIRECTIVE
I took this one from your original code (the one inside your rom) and it compiles fine
.method protected shouldInterrupt(Landroid/service/notification/StatusBarNotificationZ
.locals 12
.parameter "sbn"
.prologue
const/4 v8, 0x0
const/4 v9, 0x1
.line 1292
invoke-virtual {p1}, Landroid/service/notification/StatusBarNotification;->isOngoing()Z
move-result v4
if-nez v4, :cond_0
iget-object v10, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mPowerManager:Landroid/os/PowerManager;
invoke-virtual {v10}, Landroid/os/PowerManager;->isScreenOn()Z
move-result v1
:goto_0
return v1
:cond_0
move v1, v8
goto :goto_0
.end method
I will re-check the next steps, because last night I was unable to get everything working (I am not a dev).
Thanks again.
Click to expand...
Click to collapse
The code in the guide is taken straight from my ROM. All this method does is check to see if the notification is ongoing or not, then check to make sure the screen is on. also, I highly recommend using the latest version of apktool.
First of all, thank you.
I still have to edit the files by myself, but I have tested both your system ui and your secsettings on to the rom I am using (Dn3 4.4.2 for N7105) and they work fine, including heads up notifications... So I will keep these settings for some days, until I have the time to learn more about this matter.
Btw, I will try some of yor themed apps I found inside your rom, which are very good looking.
So what does the hud look like and how does it work? Not familiar with it.
Sent from my SPH-L710 using Tapatalk
Works great. Thank you moonknightus
Deleted
marcran75 said:
Deleted
Click to expand...
Click to collapse
???
Sent from my SPH-L710 using Tapatalk
Just an fyi, I just tried this on the S5 stock touchwiz (which is 4.4.2). I get an error when trying to compile SecSettings.apk.
Code:
I: Smaling smali folder into classes.dex...
..\_WorkArea1\_working\SecSettings.apk\smali\com\android\settings\DisplaySettings.smali[2936,4] There is already a label with that name.
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/settings/DisplaySettings.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:358)
at brut.androlib.Androlib.buildSources(Androlib.java:298)
at brut.androlib.Androlib.build(Androlib.java:284)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:240)
at brut.apktool.Main.main(Main.java:89)
It seems like the method or something is already being duplicated. SystemUI recompiled perfectly.
tp2215 said:
Just an fyi, I just tried this on the S5 stock touchwiz (which is 4.4.2). I get an error when trying to compile SecSettings.apk.
Code:
I: Smaling smali folder into classes.dex...
..\_WorkArea1\_working\SecSettings.apk\smali\com\android\settings\DisplaySettings.smali[2936,4] There is already a label with that name.
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/settings/DisplaySettings.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:358)
at brut.androlib.Androlib.buildSources(Androlib.java:298)
at brut.androlib.Androlib.build(Androlib.java:284)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:240)
at brut.apktool.Main.main(Main.java:89)
It seems like the method or something is already being duplicated. SystemUI recompiled perfectly.
Click to expand...
Click to collapse
Either a goto or a conditional label is being duplicated. Reread the instructions paying attention to the part that says to adjust the labels accordingly. The S3 and S5 use very similar code but by no means is it identical.
Thanks moonknightus for this guide. I manage to apply this mod to my tablet.:good: .Now my only problem is your other mod.
@moonknightus please check your PM sir
Do I actually need to sign the apks our can I just use them once they are modified
Sent from my SPH-L710 using Tapatalk
bigwillyg said:
Do I actually need to sign the apks our can I just use them once they are modified
Sent from my SPH-L710 using Tapatalk
Click to expand...
Click to collapse
Either use an APK signer if you have a ROM that has 3rd-party system app signatures enabled or copy the AndroidManifest.xml file and META-INF folder from the original to the new APK.As stated by moonknightus in his other thread.
filchi756 said:
Either use an APK signer if you have a ROM that has 3rd-party system app signatures enabled or copy the AndroidManifest.xml file and META-INF folder from the original to the new APK.As stated by moonknightus in his other thread.
Click to expand...
Click to collapse
Ah gotcha. Thanks
Sent from my SPH-L710 using Tapatalk
Shouldn't this be :cond_8?
Code:
[COLOR="Red"]:cond_7
[/COLOR] move v0, v2
goto/16 :goto_6
tdunham said:
Shouldn't this be :cond_8?
Code:
[COLOR="Red"]:cond_7
[/COLOR] move v0, v2
goto/16 :goto_6
Click to expand...
Click to collapse
Yup

Whitelist packages on Android 10

Hi guys,
I found this to put packages on a white list so that they are not killed on standby:
https://forum.xda-developers.com/an...to-whitelist-packages-mtcd-head-unit-t3765437
I just can't find Mtcmanager.apk in Android 10. Can someone tell me which * .apk has to be modified in Android 10 so that some apps are not killed in standby?
Greetings Flosch
Is your unit an MTCD/E
Yes, MTCD-LM
Hi,
I've come a little further. I found the HCTManagerService.apk app and decompiled it. Now I was able to find a file called "ClearProcess.smali" there are 2 lists, I think processes and services ...
Here is an excerpt from this file:
Code:
.line 37
const/4 v0, -0x1
sput v0, Landroid/microntek/ClearProcess;->mMode:I
.line 39
const-string v1, "com.percherry.roundadas"
const-string v2, "com.android.externalstorage"
const-string v3, "android.microntek."
const-string v4, "com.murtas."
const-string v5, "com.microntek."
const-string v6, "com.goodocom.gocsdk"
const-string v7, "android.rockchip.update.service"
const-string v8, "com.android.systemui"
const-string v9, "com.hct.obdservice.OBDService"
const-string v10, "com.unisound"
const-string v11, "com.intel.thermal"
const-string v12, "com.dpadnavi.assist"
const-string v13, "cn.manstep.phonemirror"
const-string v14, "com.android.bluetooth"
const-string v15, "com.hiworld."
const-string v16, "net.easyconn"
const-string v17, "com.txznet.txz"
const-string v18, "com.txznet.adapter"
const-string v19, "com.txznet.smartadapter"
const-string v20, "com.google.android"
const-string v21, "com.vayosoft.carsystem"
const-string v22, "com.ituran.driveusagemonitor"
const-string v23, "com.android.chrome"
const-string v24, "com.hct."
const-string v25, "com.vn.zestech.mapviet.tracking"
const-string v26, "com.joaomgcd."
const-string v27, "flar2."
const-string v28, "com.tl.tpms"
filled-new-array/range {v1 .. v28}, [Ljava/lang/String;
move-result-object v0
sput-object v0, Landroid/microntek/ClearProcess;->serverlist:[Ljava/lang/String;
.line 75
const-string v1, "com.percherry.roundadas"
const-string v2, "com.android.externalstorage"
const-string v3, "android.microntek."
const-string v4, "com.murtas."
const-string v5, "com.microntek."
const-string v6, "com.goodocom.gocsdk"
const-string v7, "android.rockchip.update.service"
const-string v8, "com.android.systemui"
const-string v9, "com.hct.obd.OBDActivity"
const-string v10, "com.unisound"
const-string v11, "com.dpadnavi.assist"
const-string v12, "com.intel.thermal"
const-string v13, "cn.manstep.phonemirror"
const-string v14, "com.hiworld."
const-string v15, "com.carboy.launch"
const-string v16, "com.android.bluetooth"
const-string v17, "net.easyconn"
const-string v18, "com.txznet.txz"
const-string v19, "com.txznet.adapter"
const-string v20, "com.txznet.smartadapter"
const-string v21, "com.android.launcher"
const-string v22, "com.google.android"
const-string v23, "com.vayosoft.carsystem"
const-string v24, "com.ituran.driveusagemonitor"
const-string v25, "com.android.chrome"
const-string v26, "com.hct."
const-string v27, "com.joaomgcd."
const-string v28, "flar2."
const-string v29, "com.tl.tpms"
filled-new-array/range {v1 .. v29}, [Ljava/lang/String;
move-result-object v0
sput-object v0, Landroid/microntek/ClearProcess;->packagelist:[Ljava/lang/String;
return-void
.end method
I replaced the package "net.easyconn" with "de.blitzer.plus" in both lists and it works great. The app remains open and is active after standby.
Then I tried to expand the list and added an entry:
const-string v29, "de.blitzer.plus"
And the second list:
const-string v30, "de.blitzer.plus"
Unfortunately, that doesn't work properly. In some cases the app remains open, in other cases the HU makes a cold start or freezes.
Can anyone tell me how to properly edit this file so that it works?
Flosch_93 said:
Hi,
I've come a little further. I found the HCTManagerService.apk app and decompiled it. Now I was able to find a file called "ClearProcess.smali" there are 2 lists, I think processes and services ...
Here is an excerpt from this file:
Code:
.line 37
const/4 v0, -0x1
sput v0, Landroid/microntek/ClearProcess;->mMode:I
.line 39
const-string v1, "com.percherry.roundadas"
const-string v2, "com.android.externalstorage"
const-string v3, "android.microntek."
const-string v4, "com.murtas."
const-string v5, "com.microntek."
const-string v6, "com.goodocom.gocsdk"
const-string v7, "android.rockchip.update.service"
const-string v8, "com.android.systemui"
const-string v9, "com.hct.obdservice.OBDService"
const-string v10, "com.unisound"
const-string v11, "com.intel.thermal"
const-string v12, "com.dpadnavi.assist"
const-string v13, "cn.manstep.phonemirror"
const-string v14, "com.android.bluetooth"
const-string v15, "com.hiworld."
const-string v16, "net.easyconn"
const-string v17, "com.txznet.txz"
const-string v18, "com.txznet.adapter"
const-string v19, "com.txznet.smartadapter"
const-string v20, "com.google.android"
const-string v21, "com.vayosoft.carsystem"
const-string v22, "com.ituran.driveusagemonitor"
const-string v23, "com.android.chrome"
const-string v24, "com.hct."
const-string v25, "com.vn.zestech.mapviet.tracking"
const-string v26, "com.joaomgcd."
const-string v27, "flar2."
const-string v28, "com.tl.tpms"
filled-new-array/range {v1 .. v28}, [Ljava/lang/String;
move-result-object v0
sput-object v0, Landroid/microntek/ClearProcess;->serverlist:[Ljava/lang/String;
.line 75
const-string v1, "com.percherry.roundadas"
const-string v2, "com.android.externalstorage"
const-string v3, "android.microntek."
const-string v4, "com.murtas."
const-string v5, "com.microntek."
const-string v6, "com.goodocom.gocsdk"
const-string v7, "android.rockchip.update.service"
const-string v8, "com.android.systemui"
const-string v9, "com.hct.obd.OBDActivity"
const-string v10, "com.unisound"
const-string v11, "com.dpadnavi.assist"
const-string v12, "com.intel.thermal"
const-string v13, "cn.manstep.phonemirror"
const-string v14, "com.hiworld."
const-string v15, "com.carboy.launch"
const-string v16, "com.android.bluetooth"
const-string v17, "net.easyconn"
const-string v18, "com.txznet.txz"
const-string v19, "com.txznet.adapter"
const-string v20, "com.txznet.smartadapter"
const-string v21, "com.android.launcher"
const-string v22, "com.google.android"
const-string v23, "com.vayosoft.carsystem"
const-string v24, "com.ituran.driveusagemonitor"
const-string v25, "com.android.chrome"
const-string v26, "com.hct."
const-string v27, "com.joaomgcd."
const-string v28, "flar2."
const-string v29, "com.tl.tpms"
filled-new-array/range {v1 .. v29}, [Ljava/lang/String;
move-result-object v0
sput-object v0, Landroid/microntek/ClearProcess;->packagelist:[Ljava/lang/String;
return-void
.end method
I replaced the package "net.easyconn" with "de.blitzer.plus" in both lists and it works great. The app remains open and is active after standby.
Then I tried to expand the list and added an entry:
const-string v29, "de.blitzer.plus"
And the second list:
const-string v30, "de.blitzer.plus"
Unfortunately, that doesn't work properly. In some cases the app remains open, in other cases the HU makes a cold start or freezes.
Can anyone tell me how to properly edit this file so that it works?
Click to expand...
Click to collapse
Hello,
I have not tried it myself, my guess would be to try incrementing
.registers 30
to 31. Good luck.
has anyone found a way to prevent running of last open app when waking up from sleep? Mymtcservice does not work on android 10 unfortunately..
Hi guys, i m trying this trick but no succes...
I just try decompile and recompile with no change, got an error, see my cmd log:
What i do wrong ?
E:\Autoradio\xda>apktool d HCTManagerService.apk
I: Using Apktool 2.5.0 on HCTManagerService.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\berla\AppData\Local\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
E:\Autoradio\xda>apktool b HCTManagerService
I: Using Apktool 2.5.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: E:\Autoradio\xda\HCTManagerService\res\values\styles.xml:13: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.DeviceDefault.SearchBar'.
W:
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\berla\AppData\Local\Temp\brut_util_Jar_56773495980652974245180335429438862523.tmp, p, --forced-package-id, 127, --min-sdk-version, 29, --target-sdk-version, 29, --version-code, 29, --version-name, 10, --no-version-vectors, -F, C:\Users\berla\AppData\Local\Temp\APKTOOL4019454365405323203.tmp, -e, C:\Users\berla\AppData\Local\Temp\APKTOOL7791656425622347865.tmp, -0, arsc, -I, C:\Users\berla\AppData\Local\apktool\framework\1.apk, -S, E:\Autoradio\xda\HCTManagerService\res, -M, E:\Autoradio\xda\HCTManagerService\AndroidManifest.xml]

Categories

Resources