[Need Help] [Hooking init method] - Xposed Framework Development

Hi, I have StatusBarIconView.smali (com/android/systemui/statusbar) and I want to hook this method:
Code:
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;Landroid/app/Notification;)V
.locals 5
.param p1, "context" # Landroid/content/Context;
.param p2, "slot" # Ljava/lang/String;
.param p3, "notification" # Landroid/app/Notification;
...........................Here we have some code.......................
.line 84
.local v0, "iconPadding":I
invoke-virtual {p0, v0, v4, v0, v4}, Lcom/android/systemui/statusbar/StatusBarIconView;->setPadding(IIII)V
.line 85
return-void
.end method
I want to hook this method in order to change padding.
Using BatchApktool I can see java code:
PHP:
public StatusBarIconView(Context context, String slot, Notification notification) {
super(context);
Resources res = context.getResources();
this.mSlot = slot;
this.mNumberPain = new Paint();
this.mNumberPain.setTextAlign(Align.CENTER);
this.mNumberPain.setColor(res.getColor(R.drawable.notification_number_text_color));
this.mNumberPain.setAntiAlias(true);
this.mNotification = notification;
setContentDescription(notification);
int iconPadding = getResources().getDimensionPixelSize(R.dimen.status_bar_icon_padding);
setPadding(iconPadding, 0, iconPadding, 0);
}
I can change padding manually with .smali editing. But I want to change it with xposed module.
And I don't know how to hook this <init> method properly. Is it possible at all?
Here's what I tried:
PHP:
XposedHelpers.findAndHookMethod("com.android.systemui.statusbar.StatusBarIconView", lpparam.classLoader, "init",Context.class,String.class, "android.app.Notification" ,new XC_MethodHook() {
@Override protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
View v = (View) param.thisObject;
v.setPadding(3, 15, 3, 15);
}
});
And I got noclassfound error (or nosuchmethod error ... forgot which one)
Also I replaced "init" with "<init>" or "StatusBarIconView" with no result as well.

<init> is basically a constructor.
Use XposedHelpers.findAndHookConstructor instead of findAndHookMethod.

Related

Hey Guys,show yourself help me~!

Maybe you already know that as time goes by,some APKs can't be signed by the old ways like useing some tools like Auto-signed.The program maker added some protections in the APK,like MD5 checking.
The following two codes are from classes.dex in sougou2.0.apk
This is java language ,gotten by dex2jar and jd-gui
public static String getMD5Data(byte[] paramArrayOfByte)
{
try
{
Object localObject1 = MessageDigest.getInstance("MD5");
((MessageDigest)localObject1).update(paramArrayOfByte);
localObject1 = a(((MessageDigest)localObject1).digest()).toLowerCase();
localObject1 = localObject1;
return localObject1;
}
catch (Exception localObject2)
{
while (true)
{
localException.getMessage();
Object localObject2 = null;
}
}
}
And this is Dalvik opcodes,gotten by baksmali.jar
.method public static getMD5Data([B)Ljava/lang/String;
.registers 2
:try_start_0
const-string v0, "MD5"
invoke-static {v0}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/StringLjava/security/MessageDigest;
move-result-object v0
invoke-virtual {v0, p0}, Ljava/security/MessageDigest;->update([B)V
invoke-virtual {v0}, Ljava/security/MessageDigest;->digest()[B
move-result-object v0
invoke-static {v0}, Lcom/sohu/inputmethod/settings/SettingManager$EncryptUtil;->a([B)Ljava/lang/String;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;
:try_end_14
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_14} :catch_16
move-result-object v0
:goto_15
return-object v0
:catch_16
move-exception v0
invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
const/4 v0, 0x0
goto :goto_15
.end method
From the first code I can know that the program will "try" first ,and when there's something wrong ,it will "catch" (Exception localObject2) ,but the Object localObject2 = null ,so the program won't run.
Now I have the problem ,How to change the second code to make the program can run after signed even something in the APK is changed like some pictures.I just can't read the Dalvik opcodes.
Please help me.I'm working on this for days and it driving me crazy~!
bingkan said:
Maybe you already know that as time goes by,some APKs can't be signed by the old ways like useing some tools like Auto-signed.The program maker added some protections in the APK,like MD5 checking.
The following two codes are from classes.dex in sougou2.0.apk
This is java language ,gotten by dex2jar and jd-gui
public static String getMD5Data(byte[] paramArrayOfByte)
{
try
{
Object localObject1 = MessageDigest.getInstance("MD5");
((MessageDigest)localObject1).update(paramArrayOfByte);
localObject1 = a(((MessageDigest)localObject1).digest()).toLowerCase();
localObject1 = localObject1;
return localObject1;
}
catch (Exception localObject2)
{
while (true)
{
localException.getMessage();
Object localObject2 = null;
}
}
}
And this is Dalvik opcodes,gotten by baksmali.jar
.method public static getMD5Data([B)Ljava/lang/String;
.registers 2
:try_start_0
const-string v0, "MD5"
invoke-static {v0}, Ljava/security/MessageDigest;->getInstance(Ljava/lang/StringLjava/security/MessageDigest;
move-result-object v0
invoke-virtual {v0, p0}, Ljava/security/MessageDigest;->update([B)V
invoke-virtual {v0}, Ljava/security/MessageDigest;->digest()[B
move-result-object v0
invoke-static {v0}, Lcom/sohu/inputmethod/settings/SettingManager$EncryptUtil;->a([B)Ljava/lang/String;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;
:try_end_14
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_14} :catch_16
move-result-object v0
:goto_15
return-object v0
:catch_16
move-exception v0
invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
const/4 v0, 0x0
goto :goto_15
.end method
From the first code I can know that the program will "try" first ,and when there's something wrong ,it will "catch" (Exception localObject2) ,but the Object localObject2 = null ,so the program won't run.
Now I have the problem ,How to change the second code to make the program can run after signed even something in the APK is changed like some pictures.I just can't read the Dalvik opcodes.
Please help me.I'm working on this for days and it driving me crazy~!
Click to expand...
Click to collapse
Just decompile the whole package, load it to eclipse, modify, compile again.
Have you tried once?
Is there any other easer ways?

[MOD][2012-02-15] CRT-ON animation - based on 4.0.3

!!! This was developed and tested with ICS 4.0.3 and 4.0.3.0.2.0.1.0 !!!
!!! I take no responsibility in case of any damage to your device !!!
This is in alpha stage of development
i made same changes to framework and some libs to enable CRT-ON animation on ICS AOSP 4.0.3 and 4.0.3.0.2.0.1.0
If you want to install it, first make a nandroid backup and then update with zip package via CWM recovery
At this moment i know about some issues:
- if you turn off the phone while there is Face unlock screen and then turn on the phone, it occasionally results in reboot
- if you turn off the phone while there is lock screen and then turn on the phone, CRT-ON animation will not be played
Changelog
Code:
2012-02-15
- rewritten
2012-02-10
- initial release
Project home on Google Code:
http://code.google.com/p/ics-custom-services/
[size=+2]CONSIDER DONATION[/size] : https://www.paypal.com/cgi-bin/webs...bn=PP-DonationsBF:btn_donate_SM.gif:NonHosted
It would be possible to do this for 4.0.4???
Thank you very much for your work
michaelpegaso said:
It would be possible to do this for 4.0.4???
Thank you very much for your work
Click to expand...
Click to collapse
it should be possible...
This would be awesome!!
Sent from my Galaxy Nexus using Tapatalk
Would be awesome if you can port it for AOKP B22!
Sent from my Galaxy Nexus using XDA Premium App
Any chance you could share your source? Got bootloop on latest Apex, so would like to implement it myself.
Sent from my Galaxy Nexus using xda premium
tristan202 said:
Any chance you could share your source? Got bootloop on latest Apex, so would like to implement it myself.
Sent from my Galaxy Nexus using xda premium
Click to expand...
Click to collapse
definitely, but you have to wait until Monday...
Bootloop on CM9 alpha with Franco 16.2
Sent from my Galaxy Nexus using Tapatalk
2012-02-15
- rewritten
kamma said:
2012-02-15
- rewritten
Click to expand...
Click to collapse
Would you be so kind and share the source?
Sent from my Galaxy Nexus using xda premium
tristan202 said:
Would you be so kind and share the source?
Sent from my Galaxy Nexus using xda premium
Click to expand...
Click to collapse
diff or source ?
Project home on Google Code:
http://code.google.com/p/ics-custom-services/
kamma said:
diff or source ?
Click to expand...
Click to collapse
Source is fine. I can do the diff myself.
Sent from my Galaxy Nexus using xda premium
How did you get your powermanagerservice smali to look like it does in your source page? Im using Notepad++ to open the smali and it looks more like this
Code:
.line 173
iput-boolean v4, p0, Lcom/android/server/PowerManagerService;->mInitialized:Z
.line 174
iput v4, p0, Lcom/android/server/PowerManagerService;->mPartialCount:I
.line 180
iput-boolean v4, p0, Lcom/android/server/PowerManagerService;->mKeyboardVisible:Z
.line 181
iput-boolean v6, p0, Lcom/android/server/PowerManagerService;->mUserActivityAllowed:Z
.line 182
iput v4, p0, Lcom/android/server/PowerManagerService;->mProximityWakeLockCount:I
.line 183
iput-boolean v4, p0, Lcom/android/server/PowerManagerService;->mProximitySensorEnabled:Z
.line 184
iput-boolean v4, p0, Lcom/android/server/PowerManagerService;->mProximitySensorActive:Z
.line 185
iput v5, p0, Lcom/android/server/PowerManagerService;->mProximityPendingValue:I
.line 188
const v2, 0x7fffffff
iput v2, p0, Lcom/android/server/PowerManagerService;->mMaximumScreenOffTimeout:I
.line 193
const-wide/16 v2, 0x0
And i want it to look like yours...
Code:
253 253 boolean mUnplugTurnsOnScreen;
254 254 private int mWarningSpewThrottleCount;
255 255 private long mWarningSpewThrottleTime;
256 - private int mAnimationSetting = ANIM_SETTING_OFF;
256 + private int mAnimationSetting = ANIM_SETTING_OFF | ANIM_SETTING_ON;
257 257
258 258 // Must match with the ISurfaceComposer constants in C++.
259 259 private static final int ANIM_SETTING_ON = 0x01;
...
272 272 private native void nativeInit();
273 273 private native void nativeSetPowerState(boolean screenOn, boolean screenBright);
274 274 private native void nativeStartSurfaceFlingerAnimation(int mode);
275 + private native void nativeStartSurfaceFlingerAnimationOn(int mode);
275 276
276 277 /*
277 278 static PrintStream mLog;
...
467 468 // recalculate everything
468 469 setScreenOffTimeoutsLocked();
469 470
471 + /*
470 472 final float windowScale = getFloat(WINDOW_ANIMATION_SCALE, 1.0f);
471 473 final float transitionScale = getFloat(TRANSITION_ANIMATION_SCALE, 1.0f);
472 474 mAnimationSetting = 0;
...
477 479 // Uncomment this if you want the screen-on animation.
478 480 // mAnimationSetting |= ANIM_SETTING_ON;
travmofosho said:
How did you get your powermanagerservice smali to look like it does in your source page? Im using Notepad++ to open the smali and it looks more like this
Code:
.line 173
iput-boolean v4, p0, Lcom/android/server/PowerManagerService;->mInitialized:Z
.line 174
iput v4, p0, Lcom/android/server/PowerManagerService;->mPartialCount:I
.line 180
iput-boolean v4, p0, Lcom/android/server/PowerManagerService;->mKeyboardVisible:Z
.line 181
iput-boolean v6, p0, Lcom/android/server/PowerManagerService;->mUserActivityAllowed:Z
.line 182
iput v4, p0, Lcom/android/server/PowerManagerService;->mProximityWakeLockCount:I
.line 183
iput-boolean v4, p0, Lcom/android/server/PowerManagerService;->mProximitySensorEnabled:Z
.line 184
iput-boolean v4, p0, Lcom/android/server/PowerManagerService;->mProximitySensorActive:Z
.line 185
iput v5, p0, Lcom/android/server/PowerManagerService;->mProximityPendingValue:I
.line 188
const v2, 0x7fffffff
iput v2, p0, Lcom/android/server/PowerManagerService;->mMaximumScreenOffTimeout:I
.line 193
const-wide/16 v2, 0x0
And i want it to look like yours...
Code:
253 253 boolean mUnplugTurnsOnScreen;
254 254 private int mWarningSpewThrottleCount;
255 255 private long mWarningSpewThrottleTime;
256 - private int mAnimationSetting = ANIM_SETTING_OFF;
256 + private int mAnimationSetting = ANIM_SETTING_OFF | ANIM_SETTING_ON;
257 257
258 258 // Must match with the ISurfaceComposer constants in C++.
259 259 private static final int ANIM_SETTING_ON = 0x01;
...
272 272 private native void nativeInit();
273 273 private native void nativeSetPowerState(boolean screenOn, boolean screenBright);
274 274 private native void nativeStartSurfaceFlingerAnimation(int mode);
275 + private native void nativeStartSurfaceFlingerAnimationOn(int mode);
275 276
276 277 /*
277 278 static PrintStream mLog;
...
467 468 // recalculate everything
468 469 setScreenOffTimeoutsLocked();
469 470
471 + /*
470 472 final float windowScale = getFloat(WINDOW_ANIMATION_SCALE, 1.0f);
471 473 final float transitionScale = getFloat(TRANSITION_ANIMATION_SCALE, 1.0f);
472 474 mAnimationSetting = 0;
...
477 479 // Uncomment this if you want the screen-on animation.
478 480 // mAnimationSetting |= ANIM_SETTING_ON;
Click to expand...
Click to collapse
He provided the source, you can't put that in smali files. You need to get the entire source tree, make the required changes and compile.
The box said 'Requires Windows XP or better', so I installed Linux...
tristan202 said:
He provided the source, you can't put that in smali files. You need to get the entire source tree, make the required changes and compile.
The box said 'Requires Windows XP or better', so I installed Linux...
Click to expand...
Click to collapse
Ooo I see thanks alot. I always wondered about that lol
Sent from my SPH-D700 using xda premium
Boot loop on Codename android and popcorn kernel
v8rumble said:
Boot loop on Codename android and popcorn kernel
Click to expand...
Click to collapse
May not be specific enough to be helpful, but I had a similar bootloop with this mod on a recent AOKP/Franco combination. Had to do a full wipe and reinstall of the ROM and kernel to get it back to working order.
Might have been something I did, I didn't investigate, but I've never bootlooped my GNexus before with any mods/kernels/ROMS.
In any case, don't be me. Do a Nandroid backup before you try this.
static416 said:
May not be specific enough to be helpful, but I had a similar bootloop with this mod on a recent AOKP/Franco combination. Had to do a full wipe and reinstall of the ROM and kernel to get it back to working order.
Might have been something I did, I didn't investigate, but I've never bootlooped my GNexus before with any mods/kernels/ROMS.
In any case, don't be me. Do a Nandroid backup before you try this.
Click to expand...
Click to collapse
thats highly possible to get bootloop, because this mod is developed and tested on pure AOSP and most of the custom ROMs have modified services.jar, so after applying this mod the services.jar is incompatible.
static416 said:
May not be specific enough to be helpful, but I had a similar bootloop with this mod on a recent AOKP/Franco combination. Had to do a full wipe and reinstall of the ROM and kernel to get it back to working order.
Might have been something I did, I didn't investigate, but I've never bootlooped my GNexus before with any mods/kernels/ROMS.
In any case, don't be me. Do a Nandroid backup before you try this.
Click to expand...
Click to collapse
Really shouldn't be necessary to wipe all and flash a new rom. You should only need to push the original services.jar.
The box said 'Requires Windows XP or better', so I installed Linux...

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

[GUIDE][PORT] [cm11] Dinamic statusbar

what is Dinamic statusbar??
can you see here
or here my original facebook post​
i comparing from another rom include this feature to pure CM11 base
big thanks to
Allah swt
my family
CyanogenMod
@ocoot
@bamzzz
@qoejohn
prabu siliwangi
anggi muhammad
syaeful anwar
deddy kitul
you
REQUIREMENT:
- BRAIN
- Patient
- experience
- Know how to decompile/recompiling Apk and JAR file
- notepad++
- Tool for decompiling, : apkmanager/apktool/Virtous/apkmultitools/ or else ( i use apktool 1.5.2 )
download file recources below
Settings.apk
Decompile Settings.apk
add string
Code:
<string name="dynamic_system_bars_title">Dynamic system bars</string>
<string name="dynamic_status_bar_title">Dynamic status bar</string>
<string name="dynamic_status_bar_summary">Automatically update the background of the status bar</string>
<string name="dynamic_navigation_bar_title">Dynamic navigation bar</string>
<string name="dynamic_navigation_bar_summary">Automatically update the background of the navigation bar</string>
<string name="dynamic_system_bars_gradient_title">System bar gradient</string>
<string name="dynamic_system_bars_gradient_summary">Overlay a gradient on the system bars</string>
<string name="dynamic_status_bar_filter_title">Darker status bar</string>
<string name="dynamic_status_bar_filter_summary">Overlay a darkening filter on the status bar</string>
open
res/xml/display_settings.xml
add wherever you want
Code:
<PreferenceScreen android:title="Dinamic Status Bar" android:fragment="com.android.settings.oplosandev.DSBSettings" />
place DSBSettings.smali into folder "smali" ,after recompile and decompile automatic place directories name smali
Recompile
Decompile
open
DSBSettings.smali
matched
const v0, 0x7f050071 #type="xml" name="dsb_settings"
Recompile
sign
push
SystemUI.apk
decompile SystemUI
open
Lcom/android/systemui/statusbar/phone/PhoneStatusBarTransitions.smali
find
Code:
# instance fields
add above
Code:
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/systemui/statusbar/phone/PhoneStatusBarTransitions$1;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBarTransitions$GradientObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBarTransitions$PhoneStatusBarBackgroundDrawable;
}
.end annotation
findmethod
Code:
.method public constructor <init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)V
replace with
Code:
.method public constructor <init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)V
.locals 4
.parameter "view"
.prologue
const/4 v3, 0x1
.line 47
new-instance v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBarTransitions$PhoneStatusBarBackgroundDrawable;
invoke-virtual {p1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->getContext()Landroid/content/Context;
move-result-object v2
invoke-direct {v1, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarTransitions$PhoneStatusBarBackgroundDrawable;-><init>(Landroid/content/Context;)V
invoke-direct {p0, p1, v1}, Lcom/android/systemui/statusbar/phone/BarTransitions;-><init>(Landroid/view/View;Lcom/android/systemui/statusbar/phone/BarTransitions$BarBackgroundDrawable;)V
.line 48
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarTransitions;->mView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.line 49
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarTransitions;->mView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->getContext()Landroid/content/Context;
move-result-object v1
invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
.line 50
.local v0, res:Landroid/content/res/Resources;
const v1, 0x7f0b002b [COLOR="Red"]#type="dimen" name="status_bar_icon_drawing_alpha"[/COLOR]
invoke-virtual {v0, v1, v3, v3}, Landroid/content/res/Resources;->getFraction(III)F
move-result v1
iput v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarTransitions;->mIconAlphaWhenOpaque:F
.line 51
return-void
.end method
skip this step if in your have it
add this
dimens.xml
Code:
<item type="dimen" name="status_bar_icon_drawing_alpha">75.0%</item>
colors.xml
Code:
<color name="status_bar_background_opaque">#ff000000</color>
<color name="status_bar_background_semi_transparent">#66000000</color>
intergers.xml
Code:
<integer name="dsb_transition_duration">500</integer>
push smali
recoompile
decompile
open public.xml
and matched all id
Lcom/android/systemui/statusbar/phone/PhoneStatusBarTransitions$PhoneStatusBarBackgroundDrawable.smali
Code:
const v1, 0x7f07000a #type="color" name="status_bar_background_opaque"
const v3, 0x7f07000b #type="color" name="status_bar_background_semi_transparent"
const v4, 0x7f0201dd #type="drawable" name="status_background"
Lcom/android/systemui/statusbar/phone/BarTransitions$BarBackgroundDrawable.smali
Code:
const v1, 0x7f090015 #type="integer" name="dsb_transition_duration"
Navbar
open
Lcom/android/systemui/statusbar/phone/NavigationBarTransitions;
find code
Code:
# instance fields
.field private final mBarService:Lcom/android/internal/statusbar/IStatusBarService;
add above
Code:
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/systemui/statusbar/phone/NavigationBarTransitions$GradientObserver;,
Lcom/android/systemui/statusbar/phone/NavigationBarTransitions$NavigationBarBackgroundDrawable;
}
.end annotation
find
Code:
.method public constructor
change like it
Code:
# direct methods
.method public constructor <init>(Lcom/android/systemui/statusbar/phone/NavigationBarView;)V
.locals 3
.parameter "view"
.prologue
.line 50
new-instance v0, Lcom/android/systemui/statusbar/phone/NavigationBarTransitions$NavigationBarBackgroundDrawable;
invoke-virtual {p1}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->getContext()Landroid/content/Context;
move-result-object v1
invoke-direct {v0, v1}, Lcom/android/systemui/statusbar/phone/NavigationBarTransitions$NavigationBarBackgroundDrawable;-><init>(Landroid/content/Context;)V
invoke-direct {p0, p1, v0}, Lcom/android/systemui/statusbar/phone/BarTransitions;-><init>(Landroid/view/View;Lcom/android/systemui/statusbar/phone/BarTransitions$BarBackgroundDrawable;)V
.line 242
new-instance v0, Lcom/android/systemui/statusbar/phone/NavigationBarTransitions$2;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/phone/NavigationBarTransitions$2;-><init>(Lcom/android/systemui/statusbar/phone/NavigationBarTransitions;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/NavigationBarTransitions;->mLightsOutListener:Landroid/view/View$OnTouchListener;
.line 52
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarTransitions;->mView:Lcom/android/systemui/statusbar/phone/NavigationBarView;
.line 53
const-string v0, "statusbar"
invoke-static {v0}, Landroid/os/ServiceManager;->getService(Ljava/lang/String;)Landroid/os/IBinder;
move-result-object v0
invoke-static {v0}, Lcom/android/internal/statusbar/IStatusBarService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/statusbar/IStatusBarService;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/NavigationBarTransitions;->mBarService:Lcom/android/internal/statusbar/IStatusBarService;
.line 55
return-void
.end method
save
open
Lcom/android/systemui/statusbar/phone/NavigationBarView$StatusBarBlockerTransitions;
find
Code:
.method public constructor
change to
Code:
# direct methods
.method public constructor <init>(Landroid/view/View;)V
.locals 5
.parameter "statusBarBlocker"
.prologue
.line 1268
new-instance v0, Lcom/android/systemui/statusbar/phone/BarTransitions$BarBackgroundDrawable;
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v1
const v2, 0x7f07000a #type="color" name="status_bar_background_opaque"
const v3, 0x7f07000b #type="color" name="status_bar_background_semi_transparent"
const v4, 0x7f0201dd #type="drawable" name="status_background"
invoke-direct {v0, v1, v2, v3, v4}, Lcom/android/systemui/statusbar/phone/BarTransitions$BarBackgroundDrawable;-><init>(Landroid/content/Context;III)V
invoke-direct {p0, p1, v0}, Lcom/android/systemui/statusbar/phone/BarTransitions;-><init>(Landroid/view/View;Lcom/android/systemui/statusbar/phone/BarTransitions$BarBackgroundDrawable;)V
.line 1273
return-void
.end method
and matched all id
Code:
const v2, 0x7f07000a #type="color" name="status_bar_background_opaque"
const v3, 0x7f07000b #type="color" name="status_bar_background_semi_transparent"
const v4, 0x7f0201dd #type="drawable" name="status_background"
do enabling navigation bar via build.prop
add this code at ADDITIONAL_BUILD_PROPERTIES
Code:
qemu.hw.mainkeys=0
push
Settings.apk /system/priv-app/here
SystemUI.apk /system/priv-app/here
systemui.so /system/lib/here
or other way, u can try methode flasahble.zip,adb,or other
Hi will it work in gingerbread phones? coz my systemui does not have phone folder under com/android/systemui/statusbar/
RESERVED !!!
nice share omm...
Jedz77 said:
Hi will it work in gingerbread phones? coz my systemui does not have phone folder under com/android/systemui/statusbar/
Click to expand...
Click to collapse
cm11 only.....
stock kk adjust
dugeriss said:
cm11 only.....
stock kk adjust
Click to expand...
Click to collapse
oh my bad. sorry. i really like it though. anyways thanks maan nice mod btw
dugeriss said:
what is Dinamic statusbar??
can you see here
or here my original facebook post​
i comparing from another rom include this feature to pure CM11 base
big thanks to
Allah swt
my family
CyanogenMod
@ocoot
@bamzzz
@qoejohn
prabu siliwangi
anggi muhammad
syaeful anwar
deddy kitul
you
REQUIREMENT:
- BRAIN
- Patient
- experience
- Know how to decompile/recompiling Apk and JAR file
- notepad++
- Tool for decompiling, : apkmanager/apktool/Virtous/apkmultitools/ or else ( i use apktool 1.5.2 )
download file recources below
Click to expand...
Click to collapse
Hey Great Guide!!Thank you for the willingness!Please could you make a guide on how to port Hover to cm11 ?Please it's so important for me and I've searched so many times on web but I haven't found nothing and I don't know how to do it,Please
ah..... great work sir :good: :fingers-crossed:
kitul..!!
Nice :good:
Ahmm .. Sir... I tried This one on cm11 ... but it doesnt force closes .. rather it gets black screen? i tried your guide twice .. but the same thing happens.. Please Help... BTw this guide is good
Thanks...
my Stock Kitkat 4.4.2 :good:
Can someone help me to upload cm 11 r26 statusbar without sim number indicator ??, my pc Hard disk got broken , lost all data, thanks
Thank you sir ,,
Micky99 said:
Hey Great Guide!!Thank you for the willingness!Please could you make a guide on how to port Hover to cm11 ?Please it's so important for me and I've searched so many times on web but I haven't found nothing and I don't know how to do it,Please
Click to expand...
Click to collapse
Hover is not easy because it gas so many commits with many additions and a lot of files changed
srisurya95 said:
Hover is not easy because it gas so many commits with many additions and a lot of files changed
Click to expand...
Click to collapse
Should I see your answer as a "no I won't help you",or do you mean you want to help me but it won't be easy?What's the problem?Do you think the hover related commits are too much for only two persons?
Micky99 said:
Should I see your answer as a "no I won't help you",or do you mean you want to help me but it won't be easy?What's the problem?Do you think the hover related commits are too much for only two persons?
Click to expand...
Click to collapse
I say its not possible/not so easy
srisurya95 said:
I say its not possible/not so easy
Click to expand...
Click to collapse
Dont you absolutely know some of the hover related commits?

[SOLVED] How to successfully mod Sony Music app (9.1.7.A.1.0)?

Hello guys,
I need some help from expert modders or themers, as I am just a n00b user.
My device is a Sony Ericsson WT19i running LegacyXperia CM13.0 and I'm using this Walkman port.
I'm trying to mod the latest Sony Music app (9.1.7.A.1.0) downloaded from APKMirror. This app works fine if I sign it with test keys and push it in system or install it as normal app.
I can do simple modifications (like changing the icons, the background picture, removing the red text and changing the name in AndroidManifest.xml). But, I want to change the name from "Music" to "Walkman", not only in launcher and drawer, but also, inside the app in the action bar. So, I assume that I have to edit two values in the res/values/strings.xml.
Code:
<string name="music_app_action_bar_title_txt">Music</string>
<string name="music_app_name_txt">Music</string>
I'm using apktool_2.1.0 for decompiling and recompiling. I have tried with framework-res.apk from my ROM and with framework-res.apk and SemcGenericUxpRes.apk extracted from stock MM Sony Z5 firmware (E6653_32.1.A.1.163_TH.ftf) and deoxeded.
From what I have read in several quides here in XDA, the obvious is to extract resources.arsc from the new compiled apk and add it in the orinigal apk (without compression, just store), replacing the orinigal file. In this case, when I push is system and reboot the app does not appearing in drawer (like it's not installed) and if I try to install it from the phone or ADB, I'm getting parse error (even if I resign it).
ADB shows:
adb install music.apk
Code:
4298 KB/s (13552346 bytes in 3.078s)
pkg: /data/local/tmp/music.apk
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]
and logcat shows:
Code:
04-05 21:34:50.198 971 1058 W PackageManager: Failed parse during installPackageLI
04-05 21:34:50.198 971 1058 W PackageManager: android.content.pm.PackageParser$PackageParserException: /data/app/vmdl1428133414.tmp/base.apk (at Binary XML file line #499): <provider> does not include authorities attribute
04-05 21:34:50.198 971 1058 W PackageManager: at android.content.pm.PackageParser.parseBaseApk(PackageParser.java:924)
04-05 21:34:50.198 971 1058 W PackageManager: at android.content.pm.PackageParser.parseClusterPackage(PackageParser.java:822)
04-05 21:34:50.198 971 1058 W PackageManager: at android.content.pm.PackageParser.parsePackage(PackageParser.java:786)
04-05 21:34:50.198 971 1058 W PackageManager: at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:12995)
04-05 21:34:50.198 971 1058 W PackageManager: at com.android.server.pm.PackageManagerService.-wrap26(PackageManagerService.java)
04-05 21:34:50.198 971 1058 W PackageManager: at com.android.server.pm.PackageManagerService$8.run(PackageManagerService.java:10907)
04-05 21:34:50.198 971 1058 W PackageManager: at android.os.Handler.handleCallback(Handler.java:739)
04-05 21:34:50.198 971 1058 W PackageManager: at android.os.Handler.dispatchMessage(Handler.java:95)
04-05 21:34:50.198 971 1058 W PackageManager: at android.os.Looper.loop(Looper.java:148)
04-05 21:34:50.198 971 1058 W PackageManager: at android.os.HandlerThread.run(HandlerThread.java:61)
04-05 21:34:50.198 971 1058 W PackageManager: at com.android.server.ServiceThread.run(ServiceThread.java:46)
So, I was pointed here, but this is an over 2-years old issue in apktool and probably is resolved.
If I sign the new compiled apk and push it to system or install it as normal app, then it's force closing.
Even, if I recompile the apk without any changes I'm getting the same results with both procedures.
I have tried and other ways and combinations, like compiling with original keys, or copying META-INF and AndroidManifest.xml from the original apk to the new one, but the results are always the same (parse error or FC).
I can't configure what I'm doing wrong. Do I need some specific framework-res.apk and SemcGenericUxpRes.apk? Is it indeed apktool's problem? Or anything...
So, I ask for help from the community.
Any ideas and advices are appreciated.
Thanks for reading.
@azakosath Have you tried it without replacing resources.arsc file?
I never replace this file after modding apps, and then too they work great....
Moreover are you using apktool by the command prompt? If this is the case try using advance apktool.
BTW can you please provide me those two framework files?
I have to replace resources.arsc, because I'm edititng strings.xml. I have tried several automated tools, but the outcome is the same.
Here are the files.
azakosath said:
I have to replace resources.arsc, because I'm edititng strings.xml. I have tried several automated tools, but the outcome is the same.
Here are the files.
Click to expand...
Click to collapse
Thanks for the files, and I will try that myself and see if I could get it to work:fingers-crossed:
And i just remembered, have you tried it with superuser mod?
did you resign the apk file that you build?
and your phone must have super user mode which disable signature verification,or it will not work on your phone
---------------------------------------------
i use framework files that you provide and download music from apkmirror
and i successfully edit the strings
>apktool_2.1.0
>Music 9.1.7.A.1.0
>Z3 on stock MM beta,signature verification disabled
{
"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"
}
Ok, guys, thanks a lot for your answers. I'll give Superuser Mod a try and report back. I thought that was only for stock Sony apps pulled from original firmware.
azakosath said:
Ok, guys, thanks a lot for your answers. I'll give Superuser Mod a try and report back. I thought that was only for stock Sony apps pulled from original firmware.
Click to expand...
Click to collapse
just give it a try
http://forum.xda-developers.com/chef-central/android/tut-disable-signature-verification-t3273657
So, I deodexed my services.jar, replaced the original plus services.odex and the phone booted. Then I followed the tutorial for disabling signature verification and ended with a bootloop. Now I'm flashing back my rom, cause unfortunately CM recovery doesn't support backup. I guess this mod doesn't work with CyanogenMod ROMs.
azakosath said:
So, I deodexed my services.jar, replaced the original plus services.odex and the phone booted. Then I followed the tutorial for disabling signature verification and ended with a bootloop. Now I'm flashing back my rom, cause unfortunately CM recovery doesn't support backup. I guess this mod doesn't work with CyanogenMod ROMs.
Click to expand...
Click to collapse
It works with cm but only for deodexed, I I had to request my rom developer to build a deodexed build just to have these perks.. .....
azakosath said:
So, I deodexed my services.jar, replaced the original plus services.odex and the phone booted. Then I followed the tutorial for disabling signature verification and ended with a bootloop. Now I'm flashing back my rom, cause unfortunately CM recovery doesn't support backup. I guess this mod doesn't work with CyanogenMod ROMs.
Click to expand...
Click to collapse
did you successfully recompile the services.jar?
or you can paste the file in attachment,i can try to help you
mayank22 said:
It works with cm but only for deodexed, I I had to request my rom developer to build a deodexed build just to have these perks.. .....
Click to expand...
Click to collapse
I gave it a try and with the whole rom deoxed, still the same...
slsamg7112 said:
did you successfully recompile the services.jar?
or you can paste the file in attachment,i can try to help you
Click to expand...
Click to collapse
I don't think that is a problem with recompilation, the only thing bothers me is that after the line
Code:
.method static compareSignatures
in PackageManagerService.Smali I have
Code:
.registers
instead of
Code:
.locals
which was in all the guides I found.
The original method started like this
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.registers 10
.param p0, "s1" # [Landroid/content/pm/Signature;
.param p1, "s2" # [Landroid/content/pm/Signature;
.prologue
const/4 v3, 0x1
const/4 v5, -0x3
const/4 v4, 0x0
.line 4115
if-nez p0, :cond_a
.line 4116
if-nez p1, :cond_8
:goto_7
return v3
.line 4118
:cond_8
const/4 v3, -0x1
goto :goto_7
And I edited to this
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.registers 10
const/4 v0, 0x0
return v0
.end method
Anyway, I really appreciate your help.
I tried with LP and MM framework-res from stock build and it decompile well but not recompiled well , it broke after recompile .... without editing any file ...
Whats the prob. ? I also signed file with platform cert. of CM... but didn't get any luck
azakosath said:
I gave it a try and with the whole rom deoxed, still the same...
I don't think that is a problem with recompilation, the only thing bothers me is that after the line
Code:
.method static compareSignatures
in PackageManagerService.Smali I have
Code:
.registers
instead of
Code:
.locals
which was in all the guides I found.
The original method started like this
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.registers 10
.param p0, "s1" # [Landroid/content/pm/Signature;
.param p1, "s2" # [Landroid/content/pm/Signature;
.prologue
const/4 v3, 0x1
const/4 v5, -0x3
const/4 v4, 0x0
.line 4115
if-nez p0, :cond_a
.line 4116
if-nez p1, :cond_8
:goto_7
return v3
.line 4118
:cond_8
const/4 v3, -0x1
goto :goto_7
And I edited to this
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.registers 10
const/4 v0, 0x0
return v0
.end method
Anyway, I really appreciate your help.
Click to expand...
Click to collapse
Have you deodexed it with some tool?
That never worked for me.....
I used Superr's kitchen to deoxed the whole Rom.
azakosath said:
I used Superr's kitchen to deoxed the whole Rom.
Click to expand...
Click to collapse
Well my rom didn't even boot after deodexing it with any tool......
azakosath said:
I gave it a try and with the whole rom deoxed, still the same...
I don't think that is a problem with recompilation, the only thing bothers me is that after the line
Code:
.method static compareSignatures
in PackageManagerService.Smali I have
Code:
.registers
instead of
Code:
.locals
which was in all the guides I found.
The original method started like this
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.registers 10
.param p0, "s1" # [Landroid/content/pm/Signature;
.param p1, "s2" # [Landroid/content/pm/Signature;
.prologue
const/4 v3, 0x1
const/4 v5, -0x3
const/4 v4, 0x0
.line 4115
if-nez p0, :cond_a
.line 4116
if-nez p1, :cond_8
:goto_7
return v3
.line 4118
:cond_8
const/4 v3, -0x1
goto :goto_7
And I edited to this
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.registers 10
const/4 v0, 0x0
return v0
.end method
Anyway, I really appreciate your help.
Click to expand...
Click to collapse
then,i really have no idea about it cus it works on sony stock android MM
maybe CM has something different on it
azakosath said:
I gave it a try and with the whole rom deoxed, still the same...
I don't think that is a problem with recompilation, the only thing bothers me is that after the line
Code:
.method static compareSignatures
in PackageManagerService.Smali I have
Code:
.registers
instead of
Code:
.locals
which was in all the guides I found.
The original method started like this
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.registers 10
.param p0, "s1" # [Landroid/content/pm/Signature;
.param p1, "s2" # [Landroid/content/pm/Signature;
.prologue
const/4 v3, 0x1
const/4 v5, -0x3
const/4 v4, 0x0
.line 4115
if-nez p0, :cond_a
.line 4116
if-nez p1, :cond_8
:goto_7
return v3
.line 4118
:cond_8
const/4 v3, -0x1
goto :goto_7
And I edited to this
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.registers 10
const/4 v0, 0x0
return v0
.end method
Anyway, I really appreciate your help.
Click to expand...
Click to collapse
Is't Work for you after you enter your editing?
awadh730 said:
Is't Work for you after you enter your editing?
Click to expand...
Click to collapse
Nope, Superuser Mod never worked for me in CM13.0, or any other signature verification disabling method, or Lucky Patcher.
Sent from my WT19i using XDA Labs
azakosath said:
...
But, I want to change the name from "Music" to "Walkman", not only in launcher and drawer, but also, inside the app in the action bar. So, I assume that I have to edit two values in the res/values/srings.xml.
Code:
<string name="music_app_action_bar_title_txt">Music</string>
<string name="music_app_name_txt">Music</string>
...
Click to expand...
Click to collapse
Are you still having trouble doing this mod? If so I'm happy to give it a try if you want. If you can share your two framework files and the APK you're trying to mod, I can see if I can do this mod for you.
Ticklefish said:
Are you still having trouble doing this mod? If so I'm happy to give it a try if you want. If you can share your two framework files and the APK you're trying to mod, I can see if I can do this mod for you.
Click to expand...
Click to collapse
Thnx mate, but I gave up trying...
You're welcome to try though, the files are in the attachment of the third post and you can find the latest Sony Music apk at APKMirror.
Now I'm running CM14.1, but I think the outcome would be the same. The modded app will not install and if I try Superuser Mod, I'll end up with bootloops after first boot.
Cheers...
Edit: I guess the modded app should be working fine in a Sony stock ROM with signature verification disabled, the problem is with signature verification in CyanogenMod ROMs.
Sent from my WT19i using XDA Labs

Categories

Resources