[MOD] [GUIDE] SplitWindow for G2 stock KK roms - G2 Android Development

Sorry it took so long for me to write this up.
Following these steps will allow you to add the full split window implementation from the GPro2 and G3 KK roms that for whatever reason LG decided to leave (mostly) out of the stock G2 4.4.x roms. This guide is geared more towards rom devs or people that are familiar with using smali/baksmali and doing minor dalvik/smali edits.
Prerequisites:
Get smali/baksmali v2.0.3
Get a copy of the framework directory for the rom you're implementing this on
Download the source files/zip linked below
Quick notes on smali/baksmali usage:
If you're running baksmali on an odex your basic command to use for this guide is baksmali -a 19 -b -d <path/to/framework/dir> -o <path/to/baksmali/outdir> - x filename.odex
If you're working with an extracted classes.dex (i.e. from from roms that support art) it's just baksmali -a 19 -b -o <path/to/baksmali/outdir> classes.dex
The basic smali command to use for these purposes is smali -a 19 -o classes.dex <path/to/baksmali/outdir>
Step 1:
Baksmali telephony-common (from your framework dir) and find the following line in generated/ConfigBuildBase.smali:
Code:
sput-boolean v0, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z
and change the boolean to true like so:
Code:
sput-boolean v1, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z
Step 2:
Smali that file back to a new classes.dex and zip it back into telephony-common.jar
Step 3:
Baksmali com.lge.frameworks and find the same line in generated/ConfigBuildBase.smali:
Code:
sput-boolean v0, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z
and change the boolean to true like so:
Code:
sput-boolean v1, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z
Step 4:
Open up com/lge/loader/splitwindow/SplitWindowCreatorHelper.smali and add the following to your static fields declarations:
Code:
.field private static TAG:Ljava/lang/String;
so that it will now appear as:
Code:
# static fields
.field private static SPLITWINDOW_INSTANCE:Lcom/lge/loader/splitwindow/ISplitWindow;
.field private static TAG:Ljava/lang/String;
Step 5:
In the same smali file a few lines down, you'll need to add the following to your direct methods:
Code:
const-string v0, "SplitWindowCreatorHelper"
sput-object v0, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;
so that it will now apprear as:
Code:
sput-object v0, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->SPLITWINDOW_INSTANCE:Lcom/lge/loader/splitwindow/ISplitWindow;
const-string v0, "SplitWindowCreatorHelper"
sput-object v0, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;
return-void
.end method
Step 6:
Again, in the same smali scroll all the way down as you'll need to add the following public method at the end of the file:
* keep in mind you'll need to keep a blank line between the .end method above and this new method below
Code:
.method public static recoverService()Lcom/lge/loader/splitwindow/ISplitWindow$ISplitWindowPolicy;
.registers 4
const/4 v3, 0x0
sget-object v1, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;
const-string v2, "recoverService"
invoke-static {v1, v2}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;)I
sget-object v1, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->SPLITWINDOW_INSTANCE:Lcom/lge/loader/splitwindow/ISplitWindow;
if-eqz v1, :cond_20
sget-object v1, Lcom/lge/loader/RuntimeLibraryLoader;->SPLIT_WINDOW:Ljava/lang/String;
invoke-static {v1}, Lcom/lge/loader/RuntimeLibraryLoader;->getCreator(Ljava/lang/String;)Lcom/lge/loader/InstanceCreator;
move-result-object v0
if-eqz v0, :cond_1e
invoke-virtual {v0, v3}, Lcom/lge/loader/InstanceCreator;->setDefaultInstance(Ljava/lang/Object;)V
sget-object v1, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;
const-string v2, "Set default InstanceCreator as null to make NEW instance"
invoke-static {v1, v2}, Landroid/util/Slog;->v(Ljava/lang/String;Ljava/lang/String;)I
:cond_1e
sput-object v3, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->SPLITWINDOW_INSTANCE:Lcom/lge/loader/splitwindow/ISplitWindow;
:cond_20
invoke-static {}, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->getPolicyService()Lcom/lge/loader/splitwindow/ISplitWindow$ISplitWindowPolicy;
move-result-object v1
return-object v1
.end method
Step 7:
Open up com/lge/loader/splitwindow/ISplitWindow$ISplitWindowPolicy.smali and add the following public method after the getMinimumScreenSize public method (again, minding your blank lines)
Code:
.method public abstract getRecentStackBoxes()Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/List",
"<",
"Landroid/app/ActivityManager$StackBoxInfo;",
">;"
}
.end annotation
.end method
Step 8:
Smali all of that to a new classes.dex and zip it back into com.lge.frameworks.jar
Step 9:
Put your newly modified com.lge.frameworks.jar and telephony-common.jar into place (I also re-odex them and copy the original signatures over)
Step 10:
Put all of the files contained in the download provided below into their respective directories with the proper permissions (644 all around)
Step 11:
Add the following two lines to your build.prop
Code:
ro.lge.capp_splitwindow=true
persist.splitwindow.support_all=true
* if you don't want all apps showing up in the selection window, change support_all to false
That's it...you should be good to go. There's always the possibility that your framework will be slightly different, but that's the general idea and you should be able to make small changes to adjust to your particular variant
Feel free to include this in your roms (that's why I posted it). Just give credit in your OP.
Downloads:
SplitWindow Files - G Pro 2
SplitWindow Files - G3
The only real difference between them is the color of the outline box

wow. definitely not for noobs.
thanks for sharing though. I'll try messing with it soon.

good job. thanks

if i will modify my installed pardus rom in my phone with that guide,
is it will work after xposed installer or it will cause trouble to use them both..
xposed and your guide..
should i disable xposed, modify by your guide and ten install xposed again or no need for that?
+If you could, post here a 1 or 2 screenshots..

Hope someone will make an apk installer ( like your camera) to make it working easily on stock roms!

Good job m8

Thanks mate ?
Sent from my LG-D802 using Tapatalk

Awesome sauce man, going to learn some smali now

@xdabbeb and @bender_007 brothers, please help us with either a flashable version or an apk please
Press thanks button if I was of any help / assistance to you

Apk and i make a statue in your honor
I got still stock recovery on 20b.. only rooted

rastigo said:
@xdabbeb and @bender_007 brothers, please help us with either a flashable version or an apk please
Press thanks button if I was of any help / assistance to you
Click to expand...
Click to collapse
will look into it. - but getting "your" framework directory is hard
Can't create installer for all versions. It's possible to provide for most common or these I do own. CloudyG3 for example.

bender_007 said:
will look into it. - but getting "your" framework directory is hard
Can't create installer for all versions. It's possible to provide for most common or these I do own. CloudyG3 for example.
Click to expand...
Click to collapse
Apk for stock rom 80220d and/or for cloudystock, please ? thank you
Inviato dal mio LG-D802 utilizzando Tapatalk

Dont work for me, and MagixRom
https://www.dropbox.com/s/28zrjwr1gj3ci8r/MagixWindon.zip
Enviado desde mi LG-D802 mediante Tapatalk

There would not be a feasible way to make this mod work via an apk installer without serious risk as it requires direct replacement of core framework files. This is a pretty low-level mod so if you want it, you'll have to be rooted with a custom recovery. I do not want people to put their phones into an unusable state by attempting to do this without a recovery. It's just too risky.
As for making flashable zips: this requires modification of framework that is variant/firmware specific and would need to be odexed in most situations (as there are few if any deodexed stock LG roms). This means one would need to create a large number of zips to cover every possible variant/firmware combination. A few devs had asked me to write up a guide detailing how I accomplished this so that they could incorporate it into their own roms. I had already responded to one of rastigo's PMs regarding making flashable zips. I may consider making a couple for the more popular bases (F320K21p & D80220D), but this really should be handled by your individual variant/rom devs. If they run into problems they can get in touch with me and I will help them as soon as I am able to.
I realize that this is a fairly involved guide/mod with multiple chances to make small mistakes, but when followed exactly it does work. There has even been an individual with a LG GPad who followed the guide and got it working.

xdabbeb said:
There would not be a feasible way to make this mod work via an apk installer without serious risk as it requires direct replacement of core framework files. This is a pretty low-level mod so if you want it, you'll have to be rooted with a custom recovery. I do not want people to put their phones into an unusable state by attempting to do this without a recovery. It's just too risky.
As for making flashable zips: this requires modification of framework that is variant/firmware specific and would need to be odexed in most situations (as there are few if any deodexed stock LG roms). This means one would need to create a large number of zips to cover every possible variant/firmware combination. A few devs had asked me to write up a guide detailing how I accomplished this so that they could incorporate it into their own roms. I had already responded to one of rastigo's PMs regarding making flashable zips. I may consider making a couple for the more popular bases (F320K21p & D80220D), but this really should be handled by your individual variant/rom devs. If they run into problems they can get in touch with me and I will help them as soon as I am able to.
I realize that this is a fairly involved guide/mod with multiple chances to make small mistakes, but when followed exactly it does work. There has even been an individual with a LG GPad who followed the guide and got it working.
Click to expand...
Click to collapse
Totally agree.
I will help in any way on that....
Thank you for your efforts..

how can i open the splitwindow by lmt or tasker, can you @xdabbeb make us an launcher apk for open the splitwindow and not only from the recent activity..
like that one for jb:
3rd party navigation bar support (Provided BY BlackDino) Simply point to this app
SplitViewLauncher.apk
Click to expand...
Click to collapse
source @bigfau http://forum.xda-developers.com/showthread.php?t=2544206

xdabbeb said:
There would not be a feasible way to make this mod work via an apk installer without serious risk as it requires direct replacement of core framework files. This is a pretty low-level mod so if you want it, you'll have to be rooted with a custom recovery. I do not want people to put their phones into an unusable state by attempting to do this without a recovery. It's just too risky.
As for making flashable zips: this requires modification of framework that is variant/firmware specific and would need to be odexed in most situations (as there are few if any deodexed stock LG roms). This means one would need to create a large number of zips to cover every possible variant/firmware combination. A few devs had asked me to write up a guide detailing how I accomplished this so that they could incorporate it into their own roms. I had already responded to one of rastigo's PMs regarding making flashable zips. I may consider making a couple for the more popular bases (F320K21p & D80220D), but this really should be handled by your individual variant/rom devs. If they run into problems they can get in touch with me and I will help them as soon as I am able to.
I realize that this is a fairly involved guide/mod with multiple chances to make small mistakes, but when followed exactly it does work. There has even been an individual with a LG GPad who followed the guide and got it working.
Click to expand...
Click to collapse
When I try to launch splitview I see dualwindows fc ?
Inviato dal mio LG-D802 utilizzando Tapatalk

Matt927 said:
When I try to launch splitview I see dualwindows fc ?
Inviato dal mio LG-D802 utilizzando Tapatalk
Click to expand...
Click to collapse
provide a logcat ..

can someone make an apk shortcut for the dualwindows operation, i have LMT launcher and i want to open dualwindows from the lmt..
thanks!

As said above.
Without framework core files no.
Its not so dangerous mod after all.
Just 2 jars to modify and one more to add.
If i find some time i will make a flashable zip for it tonight and a flashable revert if anything goes wrong
) ) ) G2 On Air ( ( (

Related

[FIX] StartingAlertService Wakelock (TouchWizCalendar.apk)

Hi
This is the solution to fix the StartingAlertService Wakelock
To reproduce the problem (or the fix) modify calendar settings to notify events in status bar, create a an event and add a reminder inmediatly, so a notificantion is triggered and you can see it in status bar, open BetterBatteryStats and you can check in partial wakelocks if you have the StartingAlertService Wakelock. You will see that the wakelock is always working, you only need to refresh data and the wakelock time is increased, the wakelock is not released until you close to notification.
The problem is in TouchWizCalendar.apk not releasing the wakelock properly in class ServiceHandler inside class AlertService
The actual code is:
Code:
private final class ServiceHandler extends Handler {
public ServiceHandler(Looper looper) {
super(looper);
}
@Override
public void handleMessage(Message msg) {
processMessage(msg);
AlertService.this.stopSelf();
}
}
If you check the new android sources you can see the next code:
Code:
private final class ServiceHandler extends Handler {
public ServiceHandler(Looper looper) {
super(looper);
}
@Override
public void handleMessage(Message msg) {
processMessage(msg);
// NOTE: We MUST not call stopSelf() directly, since we need to
// make sure the wake lock acquired by AlertReceiver is released.
AlertReceiver.finishStartingService(AlertService.this, msg.arg1);
}
}
So the next change will fix the problem. You have to decompile TouchWizCalendar.apk locate com/android/calendar/AlertService$ServiceHandler.smali and search & replace next code.
Search (the last method):
Code:
# virtual methods
.method public handleMessage(Landroid/os/Message;)V
.registers 3
.parameter "msg"
.prologue
.line 594
iget-object v0, p0, Lcom/android/calendar/AlertService$ServiceHandler;->this$0:Lcom/android/calendar/AlertService;
invoke-virtual {v0, p1}, Lcom/android/calendar/AlertService;->processMessage(Landroid/os/Message;)V
.line 598
iget-object v0, p0, Lcom/android/calendar/AlertService$ServiceHandler;->this$0:Lcom/android/calendar/AlertService;
invoke-virtual {v0}, Lcom/android/calendar/AlertService;->stopSelf()V
.line 601
return-void
.end method
Replace by:
Code:
# virtual methods
.method public handleMessage(Landroid/os/Message;)V
.registers 4
.parameter "msg"
.prologue
iget-object v0, p0, Lcom/android/calendar/AlertService$ServiceHandler;->this$0:Lcom/android/calendar/AlertService;
invoke-virtual {v0, p1}, Lcom/android/calendar/AlertService;->processMessage(Landroid/os/Message;)V
iget-object v0, p0, Lcom/android/calendar/AlertService$ServiceHandler;->this$0:Lcom/android/calendar/AlertService;
iget v1, p1, Landroid/os/Message;->arg1:I
invoke-static {v0, v1}, Lcom/android/calendar/AlertReceiver;->finishStartingService(Landroid/app/Service;I)V
return-void
.end method
Now recompile TouchWizCalendar.apk and replace it.
I've attached a cwm zip file to create a backup (TouchWizCalendar.apk.bak), replace the apk, and clear battery stats to reset wakelocks counters (reset battery stats doesn't affect to SGS2 battery, the battery chip doesn't need that info). The apk is based on kk5 rom.
If you don't want to use the cwm file you can extract TouchWizCalendar.apk from the zip and use root explorer (or similar) to replace the file, don't forget to make a backup of your original apk.
Edit:
If you get:
Code:
# virtual methods
.method public handleMessage(Landroid/os/Message;)V
.locals 1
.parameter "msg"
...
...
...
when decompile then replace with
Code:
# virtual methods
.method public handleMessage(Landroid/os/Message;)V
.locals 2
.parameter "msg"
...
...
...
Edit2:
If you use odexed rom delete or rename the odex file (maybe com.android.calendar.odex or TouchWizCalendar.odex, I'm not sure) to be sure classes.dex is used from deodexed apk
Edit3:
I've updated the zip to be sure odex file is not used in odexed roms
hi
it will work on xwkk5 stock rom odexed?
Hi,
this works fine on CheckRom v4, StartingAlertService now 0,3%.
with friendly greet
starbase64
pissyhun said:
hi
it will work on xwkk5 stock rom odexed?
Click to expand...
Click to collapse
I think so, but I'm not sure. To be sure that you can revert the changes make a backup (or rename) of the apk(TouchWizCalendar.apk.bak) and the odex calendar files, then delete the odex (I think the odex will be com.android.calendar.odex) and install the zip.
You can always to reodex (http://forum.xda-developers.com/showthread.php?t=1208320)
hi
thx for the answer but i am not a developer or an expert in android commands. i read the post u link but gave me headache)))
i will save the file and use it with a deodexed rom.
pissyhun said:
hi
thx for the answer but i am not a developer or an expert in android commands. i read the post u link but gave me headache)))
i will save the file and use it with a deodexed rom.
Click to expand...
Click to collapse
Wise decision
Great. Will implement this in my Note ROM
Love your fix
Yesterday I've installed your fix, and my wake locks for startingalertservice are gone. For your information I'm running a rooted version of the standard i9100XWKK2. Thanks again for your work, my battery time increased quit a bit.
hugoxboss said:
Yesterday I've installed your fix, and my wake locks for startingalertservice are gone. For your information I'm running a rooted version of the standard i9100XWKK2. Thanks again for your work, my battery time increased quit a bit.
Click to expand...
Click to collapse
Glad to hear it
just to make sure, if my wakelocks are in seconds in betterbatterystats, i'm good right?
ATN24 said:
just to make sure, if my wakelocks are in seconds in betterbatterystats, i'm good right?
Click to expand...
Click to collapse
that's right
Thanks for the instructions!
However, my calendar apk file has a bit of a difference in the code.
For example, it starts with:
# virtual methods
.method public handleMessage(Landroid/os/MessageV
.locals 1
.parameter "msg"
Can I use the same instructions?
Excellent job,thanks very much for by apk
Does anyone know if this APK will work for UCKK6?
Thanks a bunch rodries, this is awesome. Instead of ".registers 3", my AlertService$ServiceHandler.smali had ".locals 1". So, I went ahead and changed that to ".registers 4" as well.
Just revised KK5 TouchWizCalendar.apk, working well.
itaykoren said:
Thanks for the instructions!
However, my calendar apk file has a bit of a difference in the code.
For example, it starts with:
# virtual methods
.method public handleMessage(Landroid/os/MessageV
.locals 1
.parameter "msg"
Can I use the same instructions?
Click to expand...
Click to collapse
I think it's safe use same instructions. I'm using last smali and kk5 apk.
Hello rodies,
i am sorry but i can`t get it to work with my GingerMod v0.7 Rom.
http://forum.xda-developers.com/showthread.php?t=1220283
Neither the cwm-file nor the copy direct option works.
I have the Wakelock also. I am not a programmer. So things like compile decompile are chinese to me.
Is it somehowe possible that you can contact the Developer of GingerMod that he can apply this patch for his Rom.
Many thanks in advanced.
Would this issue be fixed if I just deleted the apk entirely?
crossover37 said:
Would this issue be fixed if I just deleted the apk entirely?
Click to expand...
Click to collapse
Lol, did you think this through... are you serious? You do realize it's required to use your calendar, not to mention it might cause your phone to crash continuously given all the other items that call on the calendar.
TheMatrix2000 said:
Hello rodies,
i am sorry but i can`t get it to work with my GingerMod v0.7 Rom.
http://forum.xda-developers.com/showthread.php?t=1220283
Neither the cwm-file nor the copy direct option works.
I have the Wakelock also. I am not a programmer. So things like compile decompile are chinese to me.
Is it somehowe possible that you can contact the Developer of GingerMod that he can apply this patch for his Rom.
Many thanks in advanced.
Click to expand...
Click to collapse
Upload your original TouchWizCalendar.apk, I'll create a cwm file for you

[INFO][REF][MON 18 FEB '13] Jelly Bean Porting thread | Vision Keyboard Fixes

I'm starting this thread as a result of trying to port Paranoid Android 2.51 from the saga. Long story short, turns out previous known ways to fix keyboard problems in ICS ports no longer work for Jelly Bean.
Please PM me and post useful info in this thread.... I absolutely do not want this to turn into a "how do I do this" thread.... This is for exchanging knowledges and discussion.
Progress so far: Thanks to strapped365, who has successfully ported PA 2.xx WITH working keyboard for the myTouch 4G Slide, We now know how to enable the soft keyboard. strapped365's instructions were off the top of his head, so here I have written a revised version with detailed instructions.
If you want to help out but are a n00b at editing .apk files, please follow this simple guide for de/ recompiling with APKTool.
SOFT KEYBOARD FIX
Using apktool, decompile framework-res.apk, then open res/values/bools.XML . Look for
Code:
<bool name="config_forceDisableHardwareKeyboard">[COLOR="Red"]false[/COLOR]</bool>
Change it to
Code:
<bool name="config_forceDisableHardwareKeyboard">[COLOR="Red"]true[/COLOR]</bool>
Before I go any further, I'm not convinced this is the best way to fix the problem because this boolean suggests we are saying that we should force the hardware keyboard to not be used just to get the soft keyboard up instead, although at least the hardware keyboard is still recognised. We need to look more into android.policy.jar stuff.
Anyway, now go into res/values/integers.XML and find
Code:
<integer name="config_lidOpenRotation">[COLOR="red"]-1[/COLOR]</integer>
Change it to
Code:
<integer name="config_lidOpenRotation">[COLOR="red"]90[/COLOR]</integer>
Still in integers.XML, look for
Code:
<integer name="config_lidNavigationAccessibility">[COLOR="red"]0[/COLOR]</integer>
and change it to
Code:
<integer name="config_lidNavigationAccessibility">[COLOR="Red"]1[/COLOR]</integer>
DO NOT change
Code:
<integer name="config_lidKeyboardAccessibility">[COLOR="red"]0[/COLOR]</integer>
When I did, I got bootloops.
Click to expand...
Click to collapse
PHYSICAL KEYBOARD BUTTON BACKLIGHT
I've tried lms24's fix for ICS (scroll down to the bottom of the post) but unfortunately this does not work, which I'm slightly surprised at being as other framework tweaks (for soft keyboard) work, and comparing JB's values for this stuff to ICS's does not show much difference.
Click to expand...
Click to collapse
PHYSICAL KEYBOARD OPEN / LID OPEN STATE (SCREEN ROTATION UPON OPENING KEYBOARD)
I've had a look in android.policy.jar and in PhoneWindowManager.smali there is an interesting method, it is in the original Jelly Belly ROM (which is what, if you're porting, you should be using because the other JB ROMs are test builds) but is not in the PA ROM I'm porting (nor will it be in any other non-Vision ROM, I guess). Take a look. Simply putting the method into the ported ROM's PhineWindowManager.smali file doesn't work, there must be something deeper at work here.
Code:
.method private applyLidSwitchState()V
.registers 4
.prologue
.line 5042
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPowerManager:Landroid/os/LocalPowerManager;
invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isBuiltInKeyboardVisible()Z
move-result v1
invoke-interface {v0, v1}, Landroid/os/LocalPowerManager;->setKeyboardVisibility(Z)V
.line 5044
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLidState:I
if-nez v0, :cond_1a
iget-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLidControlsSleep:Z
if-eqz v0, :cond_1a
.line 5045
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPowerManager:Landroid/os/LocalPowerManager;
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
invoke-interface {v0, v1, v2}, Landroid/os/LocalPowerManager;->goToSleep(J)V
.line 5047
:cond_1a
return-void
.end method
Click to expand...
Click to collapse
TO FINISH OFF
Here's how strapped365 told me to finish it off (I used Ubuntu's built in archive manager to do this, it should work fine, if you're not using 7zip just extract the right files from the original, delete the respective files in the new one and pack the old stuff):
Once the apk is compiled open the newly compiled apk with 7zip on one window and then open the original untouched apk in another 7zip window and drag the META_inf and manifest XML from the original apk into the new apk ( the new apk NEEDS these ) once that's done your good to go. Just note that this still leaves an onscreen keyboard in landscape when then keyboard is open, but its better than what your dealing with.
Click to expand...
Click to collapse
Obviously make sure the new file is renamed to to framework-res.apk.
THANKS TO...
ajhavery
lms24
strapped365
For helping me out with all this... so far this is not spawned in any way from my own knowledge (although I have been doing my own investigating) but has been from help and advice from the above.
Click to expand...
Click to collapse
RESERVED
RESERVED
AW: [INFO][REF][MON 18 FEB '13] Jelly Bean Porting thread | Vision Keyboard Fixes
Good job man! This will be appreciated by many g2 devs, when it comes to in porting. Thanks for sharing.
Sent from my HTC One X using xda app-developers app

[MOD][GUIDE] Removing SysScope - Permanent "Official" Device Status [update 8-12-13]

[MOD][GUIDE] Removing SysScope - Permanent "Official" Device Status [update 8-12-13]
Notice (4/16/14): I'm no longer here. I've said "goodbye" to AT&T and their locked bootloader schemes. I'm voting with my wallet - I've sold my I337 and switched to T-Mobile. My apologies to the community, but you're now on your own here.
First and foremost, most of the credit goes to [email protected] and dwitherell for their hard work in this thread, and all the help they provided me to get this to work on the S4. Also some thanks to sicopat, with his instructions in this thread for deodexing APKs.
This guide will show you how to delete SysScope, and permanently alter your "Device Status" (Settings -> More -> About device -> Status -> Device Status) to be "Official". Futher, it will keep your boot logo to be the original "Galaxy S4" logo, and not the "Custom"/padlock logo. Before you begin, you will need to be sure that your device does not already show "Custom" - otherwise your boot logo will permanently be stuck showing the "Custom"/padlock. [Update 6-26-13: I've posted a method below that will allow you to restore your custom status temporarily before removing SysScope.] A couple more details about SysScope and how it works and what it is scanning for are in my old thread here.
Important Notes:
This mod will make changes to your SecSettings.apk, so there is risk of borking your device. I am not responsible if you mess anything up on your device!
This mod was performed on the AT&T Galaxy S4 (SGH-I337) with the latest OTA Update available at this time (I337UCUAMDL).
This mod was performed on the STOCK UCUAMDL ROM. You might be able to make these same changes to other TW-based roms. Good luck.
You must be rooted.
It is highly advised to make a nandroid backup of your entire system/data before continuing. Seriously - go do it now.
Your device must be in debugging mode (of course) and your ADB should be readily available (set in path, or dumped into your working folder). If you don't know what I'm talking about, you should probably stop now.
Click to expand...
Click to collapse
Prerequisites:
You need java installed and working at the command prompt.
You need smali and baksmali in your working directory. I used v1.4.2 of each. Here's some links: baksmali and smali.
Basic ADB skills
A good text editor, such as Notepad++. Even better, and good text comparison tool would be great to check your work (get a trial of Beyond Compare 3 maybe?). Originally, I used a comparison tool, but in the end found myself just making the edits in Notepad++.
7zip or some other compressing/deompressing tool that can add a file into an .apk file.
Zip-Align (available in the SDK tools and other places around XDA) - technically optional, but probably a good idea
Get all these things into a working folder, open your command prompt in that folder, test ADB, and then begin.
Click to expand...
Click to collapse
Added 6-26-13 - How to get "Official" status back before making it permanent:
If for some reason you already have a "custom" status, you can perform this lengthy, yet sure-fire method to get it back...
Install your favorite recovery by whatever means.
Personally, I like TWRP, and I install it using an ADB Shell:
http://www.teamw.in/project/twrp2/174 said:
$ su
# dd if=/sdcard/recoveryfilename.img of=/dev/block/mmcblk0p21
Click to expand...
Click to collapse
Make a nandroid backup of your device as it is now, just as a precaution.
Perform all the steps below to remove SysScope from your device (including the reboot at the end!). Note that this will not fix your "Custom"/padlock boot logo at this time.
Check to be sure SysScope gone by looking at Settings -> More -> About device -> Status -> Device status. It should say "Official".
Make another nandroid backup - this time you're making a backup of your system without SysScope inside of it.
Odin back to MDL stock. Personally, I recommend that you also backup your internal SD card to your computer before using the Odin-to-Stock. You might need to wipe your data to get the odin-to-stock to work correctly, which if done improperly, will wipe your SD card also.
After device boots fully, manually restart the phone again.
Watch to be sure boot logo is not the "custom"/padlock. If you'd like to be extra-sure your status is "Official", you can boot into Download/Odin mode again, and check the status there.
Run Motochopper, but DO NOT allow motochopper to restart the device!
Make sure motochopper reads "Success!". If it fails, just CLOSE the program and start it again. Do not press any key to reboot!
When motochopper says, "Exploit complete. Press enter to reboot and exit" - just close motochopper without pressing any keys!
Motochopper available here.
Install your favorite recovery again. Do not restart your phone at this time!
In the instructions to remove SysScope, repeat step #10 (the final step with all the shell commands) again to remove SysScope again.
Technically this step is optional, but it is needed if your facorite recovery doesn't format/restore the System partition when it restores nandroid backups. Better safe than sorry.
Regardless, we don't ever want to allow the phone to reboot into the normal System while SysScope still exists.
Restore the second nandroid backup you took, and reboot into System.
Click to expand...
Click to collapse
Main Instructions:
Pull a copy of entire contents of /system/framework folder "framework" in your current working folder.
Code:
adb pull /system/framework/ ./framework/
Pull a copy of the SecSettings.apk and its .odex file
Code:
adb pull /system/app/SecSettings.apk
adb pull /system/app/SecSettings.odex
Deodex SecSettings.apk
Code:
java -jar baksmali-1.4.2.jar -a 17 -x SecSettings.odex -d framework
java -jar smali-1.4.2.jar ./out -o classes.dex
Decompile classes.dex
Code:
java -jar baksmali-1.4.2.jar -a 17 -o .\classes_out classes.dex
Edit classes_out\com\android\settings\deviceinfo\Status.smali manually (using Notepad++). "Remove:" means to delete a line or remove a section entirely. "Change:" means to look at the original code, and make it look like the "to" part.
Remove:
Code:
.field private isSysScopeStatus:I
Remove:
Code:
.field private mSysScopeReceiver:Landroid/content/BroadcastReceiver;
Remove:
Code:
.line 264
new-instance v0, Lcom/android/settings/deviceinfo/Status$2;
invoke-direct {v0, p0}, Lcom/android/settings/deviceinfo/Status$2;-><init>(Lcom/android/settings/deviceinfo/Status;)V
iput-object v0, p0, Lcom/android/settings/deviceinfo/Status;->mSysScopeReceiver:Landroid/content/BroadcastReceiver;
Remove:
Code:
.line 216
const/4 v0, -0x1
iput v0, p0, Lcom/android/settings/deviceinfo/Status;->isSysScopeStatus:I
Remove:
Code:
.method static synthetic access$402(Lcom/android/settings/deviceinfo/Status;I)I
.registers 2
.parameter "x0"
.parameter "x1"
.prologue
.line 102
iput p1, p0, Lcom/android/settings/deviceinfo/Status;->isSysScopeStatus:I
return p1
.end method
.method static synthetic access$500(Lcom/android/settings/deviceinfo/Status;)V
.registers 1
.parameter "x0"
.prologue
.line 102
invoke-direct {p0}, Lcom/android/settings/deviceinfo/Status;->changeSysScopeStatus()V
return-void
.end method
Remove:
Code:
.line 687
iget-object v0, p0, Lcom/android/settings/deviceinfo/Status;->mSysScopeReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {p0, v0}, Lcom/android/settings/deviceinfo/Status;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V
Remove:
Code:
.line 657
iget-object v1, p0, Lcom/android/settings/deviceinfo/Status;->mSysScopeReceiver:Landroid/content/BroadcastReceiver;
new-instance v2, Landroid/content/IntentFilter;
const-string v3, "com.sec.intent.action.SYSSCOPESTATUS"
invoke-direct {v2, v3}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, v1, v2}, Lcom/android/settings/deviceinfo/Status;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
Change:
Code:
.line 952
const v1, 0x7f09013f
to
Code:
.line 952
const v1, 0x7f09013d
Change:
Code:
.method private changeSysScopeStatus()V
.registers 8
.prologue
const-wide/16 v3, 0x3e8
const v6, 0x7f09013e
const/4 v5, -0x1
.line 956
const-string v0, "sysscope_status"
invoke-virtual {p0, v0}, Lcom/android/settings/deviceinfo/Status;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
.line 958
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v0
div-long/2addr v0, v3
.line 959
invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J
move-result-wide v0
div-long/2addr v0, v3
.line 961
const-wide/16 v3, 0x0
cmp-long v3, v0, v3
if-nez v3, :cond_1e
.line 962
const-wide/16 v0, 0x1
.line 965
:cond_1e
iget v3, p0, Lcom/android/settings/deviceinfo/Status;->isSysScopeStatus:I
if-ne v3, v5, :cond_30
const-wide/16 v3, 0x78
cmp-long v0, v0, v3
if-lez v0, :cond_30
.line 966
invoke-virtual {p0, v6}, Lcom/android/settings/deviceinfo/Status;->getString(I)Ljava/lang/String;
move-result-object v0
.line 977
:goto_2c
invoke-virtual {v2, v0}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
.line 978
return-void
.line 968
:cond_30
iget v0, p0, Lcom/android/settings/deviceinfo/Status;->isSysScopeStatus:I
const/4 v1, 0x2
if-ne v0, v1, :cond_3a
.line 969
invoke-virtual {p0, v6}, Lcom/android/settings/deviceinfo/Status;->getString(I)Ljava/lang/String;
move-result-object v0
goto :goto_2c
.line 970
:cond_3a
iget v0, p0, Lcom/android/settings/deviceinfo/Status;->isSysScopeStatus:I
if-ne v0, v5, :cond_46
.line 971
const v0, 0x7f09013f
invoke-virtual {p0, v0}, Lcom/android/settings/deviceinfo/Status;->getString(I)Ljava/lang/String;
move-result-object v0
goto :goto_2c
.line 973
:cond_46
const v0, 0x7f09013d
invoke-virtual {p0, v0}, Lcom/android/settings/deviceinfo/Status;->getString(I)Ljava/lang/String;
move-result-object v0
goto :goto_2c
.end method
to
Code:
.method private changeSysScopeStatus()V
.registers 4
.prologue
const v1, 0x7f09013d
.line 956
const-string v0, "sysscope_status"
invoke-virtual {p0, v0}, Lcom/android/settings/deviceinfo/Status;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
.line 966
invoke-virtual {p0, v1}, Lcom/android/settings/deviceinfo/Status;->getString(I)Ljava/lang/String;
move-result-object v0
.line 977
invoke-virtual {v2, v0}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
.line 978
return-void
.end method
Recompile classes.dex
Code:
java -jar smali-1.4.2.jar -a 17 .\classes_out -o classes.dex
Put classes.dex into SecSettings.apk. To do this, open SecSettings.apk in 7Zip, and drag/drop your new classes.dex into the root of SecSettings.apk. Save and close.
ZipAlign SecSettings.apk (optional, but advised)
Code:
zipalign -v 4 SecSettings.apk zip_SecSettings.apk
Push it to the sdcard
Code:
adb push zip_SecSettings.apk /sdcard/
Install! Use "adb shell" to begin, and use the following commands, one at a time:
Code:
su
mount -o rw,remount /system
stop
mv /system/app/SecSettings.apk /system/app/SecSettings.bak
mv /system/app/SecSettings.odex /system/app/SecSettings.odexbak
mv /system/app/SysScope.apk /system/app/SysScope.bak
mv /system/app/EdmSysScopeService.apk /system/app/EdmSysScopeService.bak
mv /system/app/EdmSysScopeService.odex /system/app/EdmSysScopeService.odexbak
cp /sdcard/zip_SecSettings.apk /system/app/SecSettings.apk
rm -r /data/dalvik-cache/*
reboot
Click to expand...
Click to collapse
Added 8-12-13 - Flashable zips!
I've uploaded CWM/TWRP flashable zips for the SysScope mod for both MDL and MF3 firmware for the I337. Here are the download links:
mdl-remove-SysScope.zip (mirror)
mf3-remove-SysScope.zip (mirror)
The zip will do the following:
Mount /system and /data
Remove the following files (note that it doesn't make any backups):
/system/app/SecSettings.apk
/system/app/SecSettings.odex
/system/app/SysScope.apk
/system/app/EdmSysScopeService.apk
/system/app/EdmSysScopeService.odex
Extracts the new SecSettings.apk into place
Updates permissions on /system/app/SecSettings.apk to 0644
Wipes dalvik cache
Unmounts /system and /data
Click to expand...
Click to collapse
I'm not a Dev. Just a fellow XDA member, sharing some hard work with the rest of you. If this helped you out in any way, just hit the Thanks button.
To Devs: If you use this mod in your stock-based ROMs (if needed), it would be appreciated if you at least mention my name and/or [email protected] and dwitherell somewhere. Thanks. ^_^
Attached, you'll find a text copy of my I337UCUAMDL's Status.smali (rename to Status.smali if you want to use it directly). Good to compare against, or you can just skip to step 7 and place the attached classes.dex into your SecSettings.apk. Remember, these are for STOCK I337UCUAMDL only.
Update 8-13-13: I've also attached the Status.smali for MGA. Thanks to @Dean1650 for providing the original and testing it on his device.
OP i hope you dont mind i added your method to my thread that talks about this issue http://forum.xda-developers.com/showthread.php?t=2296014
Keep me posted if you have a problem with that and i'll take it down
P.S. i hotlinked to this thread, i didnt include instructions in mine
Nice write up! One small note - and the below quote is just an example snippet of the OP:
Aou said:
...
Deodex SecSettings.apk
Code:
java -jar baksmali-1.4.2.jar -a [b][i][u][color="red"]15[/b][/u][/i][/color] -x SecSettings.odex -d framework
java -jar smali-1.4.2.jar ./out -o classes.dex
Decompile classes.dex
Code:
java -jar baksmali-1.4.2.jar -a [b][i][u][color="red"]16[/b][/u][/i][/color] -o .\classes_out classes.dex
...
Click to expand...
Click to collapse
The values highlighted above are used to indicate the sdk version of whatever it is you are de/recompiling. Seeing as the stock S4 rom is android version 4.2.2 (at least I think it is, right?), this flag should actually be 17. Not sure it matters all that much in this case, but I just thought I'd point that out
Aou said:
Attached, you'll find a text copy of my Status.smali (rename to Status.smali if you want to use it directly). Good to compare against, or you can just skip to step 7 and place the attached classes.dex into your SecSettings.apk. Remember, these are only for STOCK I337UCUAMDL only.
Click to expand...
Click to collapse
Great! How long until you get it into a flashable zip ? :laugh:
edit..
woops .. thanks for the guide and hard work guys!!
polish_pat said:
OP i hope you dont mind i added your method to my thread that talks about this issue http://forum.xda-developers.com/showthread.php?t=2296014
Keep me posted if you have a problem with that and i'll take it down
P.S. i hotlinked to this thread, i didnt include instructions in mine
Click to expand...
Click to collapse
Not a problem at all! I'm not 100% sure that this will remove an existing custom boot screen. I'll look into this a bit more and get back to you.
dwitherell said:
Nice write up! One small note - and the below quote is just an example snippet of the OP:
The values highlighted above are used to indicate the sdk version of whatever it is you are de/recompiling. Seeing as the stock S4 rom is android version 4.2.2 (at least I think it is, right?), this flag should actually be 17. Not sure it matters all that much in this case, but I just thought I'd point that out
Click to expand...
Click to collapse
I will certainly look into this! It didn't seem to matter while compiling/decompiling in this case, but just in case there are side-effects, it's probably worth looking at.
scott14719 said:
Great! How long until you get it into a flashable zip ? :laugh:
Click to expand...
Click to collapse
Once I hear of enough positive reports, I'll look into this.
iB4STiD said:
tried this on mdob.. didn't work.. thanks for the guide tho!!
Click to expand...
Click to collapse
It would be greatly helpful to me if you elaborated on what part didn't work? Also, it's possible that SecSettings.apk is different in MDOB.
Aou said:
Not a problem at all! I'm not 100% sure that this will remove an existing custom boot screen. I'll look into this a bit more and get back to you.
Click to expand...
Click to collapse
awesome, i've specified this in my thread, hopefully my thread will give you enough visibility people will try it out and report back to you
Aou said:
Not a problem at all! I'm not 100% sure that this will remove an existing custom boot screen. I'll look into this a bit more and get back to you.
I will certainly look into this! It didn't seem to matter while compiling/decompiling in this case, but just in case there are side-effects, it's probably worth looking at.
Once I hear of enough positive reports, I'll look into this.
It would be greatly helpful to me if you elaborated on what part didn't work? Also, it's possible that SecSettings.apk is different in MDOB.
Click to expand...
Click to collapse
edit
my error.. nm!!
iB4STiD said:
Padlock on boot up was still there after r reboots, I edited secsettings from my ROM which is stock based off amdl
Sent from my SAMSUNG-SGH-I337 using Tapatalk 2
Click to expand...
Click to collapse
Didn't you read the op? It clearly states that if you already have the custom splash screen it won't work. This mod is to circumvent getting the custom screen. So you would have to go back to stock then use this.
This is my understanding of the op.
Sent from my SAMSUNG-SGH-I337 using Tapatalk 4 Beta
shoman94 said:
Didn't you read the op? It clearly states that if you already have the custom splash screen it won't work. This mod is to circumvent getting the custom screen. So you would have to go back to stock then use this.
This is my understanding of the op.
Sent from my SAMSUNG-SGH-I337 using Tapatalk 4 Beta
Click to expand...
Click to collapse
did read it, but read it wrong i see.. :cyclops:
Nice job.
I've added a method to restore your "Official" status temporarily while you remove SysScope. Check it out in the OP.
Also, I did check on MDOB. Status.smali seems to be identical to stock, so this method in its entirety should work on MDOB.
dwitherell said:
Nice write up! One small note - and the below quote is just an example snippet of the OP:
The values highlighted above are used to indicate the sdk version of whatever it is you are de/recompiling. Seeing as the stock S4 rom is android version 4.2.2 (at least I think it is, right?), this flag should actually be 17. Not sure it matters all that much in this case, but I just thought I'd point that out
Click to expand...
Click to collapse
I've updated the OP to include API Level 17. It appears it doesn't really matter either way, but I've made the changes just to be safe. Thanks again for pointing these out. ^_^
has anybody just tried freezing sysscope with titanium backup?
polish_pat said:
has anybody just tried freezing sysscope with titanium backup?
Click to expand...
Click to collapse
Yup. If SysScope is missing or frozen, then SecSettings will automatically report that the system is Custom.
Maybe it's just me...but The point of all this is to have the phone show Official, and not have a open padlock pop up upon reboot right?
Well, if you have a custom, rooted ROM, with lets say a custom boot animation, then it doesn't matter if the lock shows up or if your phone says custom..........but if this is for people that just want a straight stock rom with nothing added then I can see the point. On my stock rooted rom nandroid i had official, on my SHOstock ROM my phone now says custom. But i guess if I had a warranty issue I'd just odin it.
igotroot said:
Maybe it's just me...but The point of all this is to have the phone show Official, and not have a open padlock pop up upon reboot right?
Well, if you have a custom, rooted ROM, with lets say a custom boot animation, then it doesn't matter if the lock shows up or if your phone says custom..........but if this is for people that just want a straight stock rom with nothing added then I can see the point. On my stock rooted rom nandroid i had official, on my SHOstock ROM my phone now says custom. But i guess if I had a warranty issue I'd just odin it.
Click to expand...
Click to collapse
Everyone has their own reason, some just for looks, some for functionality (updates, warranty, and what-not), and others for other reasons. I just think it's none of Samsung's business what I decide to put on my phone or not.
scott14719 said:
Everyone has their own reason, some just for looks, some for functionality (updates, warranty, and what-not), and others for other reasons. I just think it's none of Samsung's business what I decide to put on my phone or not.
Click to expand...
Click to collapse
Agreed.
Samsung must have read this thread. I didn't look at MF3, but the newer international releases they made major changes to status.smali.
sent using xda Premium

Emoji Keyboard for Galaxy Nexus Stock..Work together!

Hi to all! I'm new here but I read xda forum from several months!
So.. my mission is modify a bit the new Google Keyboard KitKat Edition with Emoji and make it compatible for devices with under Android SDK.
I decompiled the APK (v 2.0.19003.893803a) and I found this class:
Code:
..\smali\com\android\inputmethod\keyboard\EmojiPalettesView$EmojiCategory.smali
Then, converted in .java class and detected this code:
Code:
addShownCategoryId(0x0);
if((Build.VERSION.SDK_INT > 0x12) || (Build.VERSION.CODENAME.equalsIgnoreCase("KeyLimePie")) || (Build.VERSION.CODENAME.equalsIgnoreCase("KitKat"))) {
addShownCategoryId(0x1);
addShownCategoryId(0x2);
addShownCategoryId(0x3);
addShownCategoryId(0x4);
mCurrentCategoryId = Settings.readLastShownEmojiCategoryId(mPrefs, 0x1);
} else {
mCurrentCategoryId = Settings.readLastShownEmojiCategoryId(mPrefs, 0x5);
}
addShownCategoryId(0x5);
addShownCategoryId(0x6);
I know that new GK have 7 fragments for Emoji (checked on tablet with 4.4) and the code is pretty clear.
They make a control, if SDK>12 or the version name is "KitKat", then we hide the fragments 1,2,3,4.
As you can see on official Android Developer Page, SDK>12 is equal to say SDK>JELLY_BEAN_MR2, then starts with KITKAT (13).
Let's try to change this value? For example "10 (JELLY_BEAN, 4.1)" ?
I don't know what could be happens, but...i will have to try!
Let's go to smali file, I found my interested code:
Code:
.line 158
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v2, [COLOR="Red"][B]0x12[/B][/COLOR] ---> we change it with [COLOR="Black"][B][I]0x10[/I][/B][/COLOR]
if-gt v1, v2, :cond_1
sget-object v1, Landroid/os/Build$VERSION;->CODENAME:Ljava/lang/String;
const-string v2, "KeyLimePie"
So now, i rebuild all with keytool and additionally i make a bit of modifications:
Android Manifest
Code:
changed
<provider android:authorities="@string/authority"
TO
<provider android:authorities="com.google.android.inputmethod.dictionarypack"
Renamed package name with apktool.yml
Code:
rename-manifest-package: com.google.android.inputmethod.latin
Then, opened the built APK and drop in it with WinRar original lib folder and WEB-INF from original APK.
Then, I signed APK with cmd:
Code:
C:\apk\apktool>java -jar SignApk.jar testkey.x509.pem testkey.pk8 c:\apk\apktool
\keyboard\dist\keyboard.apk keyboard_signed.apk
So now..let's try to install the update.....
Code:
[COLOR="Red"][B]New package has a different signature: com.google.android.inputmethod.latin[/B][/COLOR]
How to solve? My experience is focused to write my apps but not modifying the others..
Hope that my work helps other and please help me to fix that problem :good:
is there any possibility to import the key signature from the original APK to modified APK?
I tried to create another APK, with another package name, but Android says that Dictionary Provider is actually used from the original Google Keyboard, it can't continue with installation.
I don't want to remove the original system keyboard app because i want give modified APK to community and i suppose that not all users have phone with root enabled.

[Guide] SuperuserMod for all 6.x Devices/Roms

Updated the SuperUser mode .. Click here
Firstly thanks to sagitt67 from 4PDA ( he did it )
I grabbed it and tested and working
Hope this should help all others
Requirements :-
* core-libart.jar
* services.jar
* Apktool/tickle my android
and patience
1. Decompile core-libart.jar
2. open core-libart/smali/java/security/Signature.smali
look for this method
Code:
.method public final verify([B)Z
in that method find this line
Code:
invoke-virtual {p0, p1}, Ljava/security/Signature;->engineVerify([B)Z
[COLOR="Red"]move-result v0[/COLOR]
Replace the red code with this
Code:
const/4 v0, 0x1
now find this method
Code:
.method public final verify([BII)Z
in that method find this line
Code:
invoke-virtual {p0, p1, p2, p3}, Ljava/security/Signature;->engineVerify([BII)Z
[COLOR="red"]move-result v0[/COLOR]
replace the red line with this
Code:
const/4 v0, 0x1
save and close
3. Now open this core-libart/smali/java/security/MessageDigest.smali
find this method
Code:
.method public static isEqual([B[B)Z
.registers 7
[COLOR="red"]const/4 v2, 0x0 [/COLOR]
Change the red line to this
Code:
const/4 v2, 0x1
save and close
Compile it and Replace
and Continued in next post
Continued
Now decompile services.jar
1. open services/smali/com/android/server/accounts/AccountManagerService.smali
Find this method
Code:
.method private isAccountPresentForCaller(Ljava/lang/String;Ljava/lang/String;)Z
look for this lines
Code:
iget-object v4, v0, Landroid/accounts/Account;->name:Ljava/lang/String;
invoke-virtual {v4, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
[COLOR="Red"] move-result v4
if-eqz v4, :cond_2c[/COLOR]
cond_2c may vary with your code
in that 2 lines do the changes like this
Code:
[COLOR="red"]move-result v4 [/COLOR] to const/4 v4, 0x0
if-[COLOR="red"]eqz[/COLOR] v4, :cond_2c to if-[COLOR="Red"]nez[/COLOR] v4, :cond_2c
save and Close
3. Now open this services/smali/com/android/server/pm/PackageManagerService$InstallParams.smali
look for this method
Code:
.method private installLocationPolicy(Landroid/content/pm/PackageInfoLite;)I
find these lines
Code:
iget v8, p0, Lcom/android/server/pm/PackageManagerService$InstallParams;->installFlags:I
:try_end_22
.catchall {:try_start_10 .. :try_end_22} :catchall_5f
[COLOR="red"]and[/COLOR]-int/lit16 v8, v8, 0x80
Change the red to this
Code:
[COLOR="red"]or[/COLOR]-int/lit16 v8, v8, 0x80
save and Close
4. Now open this services/smali/com/android/server/pm/PackageManagerService.smali
in that look for this method
Code:
.method private checkUpgradeKeySetLP(Lcom/android/server/pm/PackageSetting;Landroid/content/pm/PackageParser$Package;)Z
in that look for these lines
Code:
iget-object v4, p2, Landroid/content/pm/PackageParser$Package;->mSigningKeys:Landroid/util/ArraySet;
invoke-virtual {v4, v3}, Landroid/util/ArraySet;->containsAll(Ljava/util/Collection;)Z
[COLOR="red"]move-result v4
if-eqz v4, :cond_20[/COLOR]
cond_20 may be different with your code
Change re lines to these
Code:
[COLOR="red"]move-result v4[/COLOR] to this const/4 v4, 0x0
if-[COLOR="red"]eqz[/COLOR] v4, :cond_20 to this if-[COLOR="red"]nez[/COLOR] v4, :cond_20
Now look for this method
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
and replace with this
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.locals 11
const/4 v7, 0x0
return v7
.end method
and look for this method
Code:
.method private packageIsBrowser(Ljava/lang/String;I)Z
in that find these lines
Code:
iget-object v4, v4, Landroid/content/pm/ActivityInfo;->packageName:Ljava/lang/String;
invoke-virtual {p1, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
[COLOR="red"]move-result v4
if-eqz v4, :cond_22[/COLOR]
cond_22 may be different with your code
Change re lines to these
Code:
[COLOR="red"]move-result v4[/COLOR] to this const/4 v4, 0x0
if-[COLOR="red"]eqz[/COLOR] v4, :cond_22 to this if-[COLOR="red"]nez[/COLOR] v4, :cond_22
Now save all and compile
replace both and Reboot
Tada
SuperUserMod Done....
#YourWish for this
Additional for Unlocked Bootloaders click here (complete mod)
Have Fun guys
Dont forget to mention me If you use my work
Thanks alot Buddy, really useful, I've been looking for this on some old thread.
Sent from my E6683 using Tapatalk
@venkat kamesh bro thanks for your tut
i do this but get error in service.jar
after edit , i want to recompile it but get this error:
Code:
Recompiling "services.jar" With Original Signature,
in work area "_WorkArea1", using "apktool_2.2.1.jar"
With Tickle My Android 14.2.0.0.
(tinyurl.com\ticklemyandroid)
----------------
I: Using Apktool 2.2.1
I: Smaling smali folder into classes.dex...
..\_WorkArea1\_working\services.jar\smali\com\android\server\pm\PackageManagerService.smali[7670,4] missing EOF at '.locals'
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/server/pm/PackageManagerService.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:77)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:61)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:38)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:405)
at brut.androlib.Androlib.buildSources(Androlib.java:336)
at brut.androlib.Androlib.build(Androlib.java:292)
at brut.androlib.Androlib.build(Androlib.java:264)
at brut.apktool.Main.cmdBuild(Main.java:227)
at brut.apktool.Main.main(Main.java:84)
----------------
Recompile Not Successful!
how can i solve that?
Hamidreza2010 said:
@venkat kamesh bro thanks for your tut
i do this but get error in service.jar
after edit , i want to recompile it but get this error:
Code:
Recompiling "services.jar" With Original Signature,
in work area "_WorkArea1", using "apktool_2.2.1.jar"
With Tickle My Android 14.2.0.0.
(tinyurl.com\ticklemyandroid)
----------------
I: Using Apktool 2.2.1
I: Smaling smali folder into classes.dex...
..\_WorkArea1\_working\services.jar\smali\com\android\server\pm\PackageManagerService.smali[7670,4] missing EOF at '.locals'
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/server/pm/PackageManagerService.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:77)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:61)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:38)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:405)
at brut.androlib.Androlib.buildSources(Androlib.java:336)
at brut.androlib.Androlib.build(Androlib.java:292)
at brut.androlib.Androlib.build(Androlib.java:264)
at brut.apktool.Main.cmdBuild(Main.java:227)
at brut.apktool.Main.main(Main.java:84)
----------------
Recompile Not Successful!
how can i solve that?
Click to expand...
Click to collapse
bro seems you deleted '.locals'
please recheck it
nothing more
Goodluck bro
what´s the diferencce with the davidMKD´s tutorial disable signature verification http://forum.xda-developers.com/showthread.php?t=2458144
I ve been using this method since kit kat and its working fine, and you only modified slightly services.jar nothing else. cheers
juanpirulo said:
what´s the diferencce with the davidMKD´s tutorial disable signature verification http://forum.xda-developers.com/showthread.php?t=2458144
I ve been using this method since kit kat and its working fine, and you only modified slightly services.jar nothing else. cheers
Click to expand...
Click to collapse
haha well said bro
but structure of signature verification is not same since 4.4 to till date
there are lot of modification in structure and security level of api developed in their best
seems you just seen the services.jar changes hmm
had you looked to core-libart.jar ?
and you just see lines bro ?
why don't you look the code back to java ( i meant from smali to java ) so you can know the changes what i did
read the java imports
https://github.com/frohoff/jdk8u-dev-jdk/tree/master/src/share/classes/java/security
read it get it
i had those changes too
the old guide is just allowing to install temporary ( if you already had old install and data is present)
but not a complete SuperUserMod
just for you to prove ( try only with marshmallow and this guide is from marshmallow )
for example add new settings.apk with new signatures replace it
clear data from recovery and check if your settings are there or not
Before commenting of comparison please go through the google, and try to read what changes are done ( analyze them in java )
then come to thread and give a comment
we are not ready to post something which is already persist/Working
Do tests and get back to here bro
Good luck bro
First, this is not superuser mod, this is three android patches from LuckyPatcher.apk
First two makes your phone very vulnerable, because you makes signature verification always true and disable .apk signature verification. (core-libart.jar)
Superusermod is just
Code:
comparesignatures
const/4 v7, 0x0
bla bla
All other just give you access for downgrade your installed apk (services.jar)
I think you must add this info (about core-libart.jar) to first post. Thanks.
Did it.all good!
Thanks bro!
@venkat kamesh bro is this need to do after these steps?
http://forum.xda-developers.com/showpost.php?p=68965462&postcount=1264
i mean we should to do it or steps of this page is enough ? ( i have unlocked bootloader )
venkat kamesh said:
haha well said bro
but structure of signature verification is not same since 4.4 to till date
there are lot of modification in structure and security level of api developed in their best
seems you just seen the services.jar changes hmm
had you looked to core-libart.jar ?
and you just see lines bro ?
why don't you look the code back to java ( i meant from smali to java ) so you can know the changes what i did
read the java imports
https://github.com/frohoff/jdk8u-dev-jdk/tree/master/src/share/classes/java/security
read it get it
i had those changes too
the old guide is just allowing to install temporary ( if you already had old install and data is present)
but not a complete SuperUserMod
just for you to prove ( try only with marshmallow and this guide is from marshmallow )
for example add new settings.apk with new signatures replace it
clear data from recovery and check if your settings are there or not
Before commenting of comparison please go through the google, and try to read what changes are done ( analyze them in java )
then come to thread and give a comment
we are not ready to post something which is already persist/Working
Do tests and get back to here bro
Good luck bro
Click to expand...
Click to collapse
sorry bro when i said "you just modified slightly the services.jar" I didnt meant yourself i meant in the david tutorial no your tutorial. i just wanted your explanation about yours because i didnt know the difference. Now its ok
juanpirulo said:
sorry bro when i said "you just modified slightly the services.jar" I didnt meant yourself i meant in the david tutorial no your tutorial. i just wanted your explanation about yours because i didnt know the difference. Now its ok
Click to expand...
Click to collapse
haha no worries bro
happy to explain
Good luck bro
Hamidreza2010 said:
@venkat kamesh bro is this need to do after these steps?
http://forum.xda-developers.com/showpost.php?p=68965462&postcount=1264
i mean we should to do it or steps of this page is enough ? ( i have unlocked bootloader )
i need to do both of them?
Click to expand...
Click to collapse
@venkat kamesh would you please clear me here?
thanks bro
As always venkat kamesh! Great guide bro!
venkat kamesh said:
haha no worries bro
happy to explain
Good luck bro
Click to expand...
Click to collapse
i dont know why Xperia M4 Services.jar and other file not have Smali Folder
Hello! Does this work on stock marshmallow .291 for sony devices? Also, does this work on locked bootloaders? Great tutorial BTW!
Can I do this if my services.jar is from another systemUI. I have a z3c and I flashed Xperia X sysui and it replaced my stock systemUi and services.jar
thank you bro
but after edit
any app not installed.
russel5 said:
First, this is not superuser mod, this is three android patches from LuckyPatcher.apk
First two makes your phone very vulnerable, because you makes signature verification always true and disable .apk signature verification. (core-libart.jar)
Superusermod is just
Code:
comparesignatures
const/4 v7, 0x0
bla bla
All other just give you access for downgrade your installed apk (services.jar)
I think you must add this info (about core-libart.jar) to first post. Thanks.
Click to expand...
Click to collapse
@russel5,
I am not familiar with how to decompile services.jar, and I am not sure I understand what this is. Do you know of any more basic of a guide on services.jar, deodexing and what it achieves?
Thanks a lot in advance,
MW
I have been served this guide to enable superuser mod in my xperia x
music widget particles requires superuser mod but my xperia x has it

Categories

Resources