Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,806,858 Members 36,552 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE][DEVS][SMALI]Enable "Device Status Official" - Remove SysScope[GUIDE][DEVS]

Tip us?
 
cstayton
Old
(Last edited by cstayton; 21st August 2014 at 08:19 PM.)
#1  
cstayton's Avatar
Recognized Developer - OP
Thanks Meter 2,911
Posts: 2,038
Join Date: Mar 2011
Location: Waite Park, MN.

 
DONATE TO ME
Default [GUIDE][DEVS][SMALI]Enable "Device Status Official" - Remove SysScope[GUIDE][DEVS]

How to permenantly remove SysScope from your Samsung Touchwiz ROM


Tired of the constant custom padlock on startup? Want permenant device status "Official"?


Quote:
Team Blackout and KoolKit ROMs are not responsible if you blow up your house, your dog eats your homework,
the zombie apacolypse, your wife/husband divorcing you or if your device turns into an unrecognizable
smoldering pile of plastic. by reading this you agree to take all responsibility for any damage you do to the
universe, your device, your marriage or your failing grades in school or college.
Quote:
This guide and mod originated in the Galaxy S4 threads and was created by @Aou who has since left the AT&T world so development
stopped at that point, I have taken the code and modded it slightly to work for our S5 devices (All variants even the Active)
Quote:
All devs are free to use this MOD with proper recognition in your OP make sure you provide a mention to "Aou" for the
original code found here Removing SysScope - Permanent "Official" Device Status
and myself for the re-write of the instructions and changes to make this work for our devices.
NOTICE:
Quote:
This MOD is not for the squeamish or novice modder it requires patience and a good amount of time to complete.
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.

Main Instructions:


1. Make sure you have an unmodded copy of your framework files (twframework-res.apk and framework-res.apk)
you need have these available locally for your chosen method to decompile (I'm not going to describe how
to decompile in this thread, If you don't know how then this MOD is not for you)

2. Pull a copy of the SecSettings.apk

adb pull /system/priv-app/SecSettings.apk

3. Decompile SecSettings.apk (using your favorite tools I recomend Virtuous Ten Studio)


4. 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.
NOTE depending on your ethod of decompiling you may not see the line numbers
however, if you do delete from the appropriate code section as well.

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: Take note at this part you will need to locate some specific values from within /res/values/public.xml
Open /res/values/public.xml and search for "<public type="string" name="sysscope_tampered" id="0x7f0901a7" />"
and also for "<public type="string" name="sysscope_normal" id="0x7f0901a6" />" and also for
"<public type="string" name="sysscope_status" id="0x7f0901a5" />"
note the IDs you will need these values in the next section. (This is official NCE release your release
may have a different value.) Make sure you change the bolded values to match your own.

Code:
    .line 952
    const v1, 0x7f0901a7
TO:

Code:
    .line 952
    const v1, 0x7f0901a5
CHANGE:

Code:
.method private changeSysScopeStatus()V
    .registers 8

    .prologue
    const-wide/16 v3, 0x3e8

    const v6, 0x7f0901a7

    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, 0x7f0901a6

    .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
INSTALL:

Quote:
Install! Use "adb shell" to begin, and use the following commands, one at a time:


rm /system/app/SysScope.apk
rm -r /data/dalvik-cache/*
push SecSettings.apk /system/priv-app/SecSettings.apk
chmod 0644 /system/priv-app/SecSettings.apk
reboot

Devices:
HTC One X+ Retired
Samsung Galaxy S5 SM-G900A Root KoolKit ROM
Samsung Galaxy Tab3 7" JB4.2.2 SM-T217A Rooted S5 Tweaked

If you think my work is worthwhile feel free to donate
by clicking on the "Donate to me" button.
Thank you for your support.


The Following 3 Users Say Thank You to cstayton For This Useful Post: [ Click to Expand ]
 
cstayton
Old
#2  
cstayton's Avatar
Recognized Developer - OP
Thanks Meter 2,911
Posts: 2,038
Join Date: Mar 2011
Location: Waite Park, MN.

 
DONATE TO ME
Default reserved

reserved

Devices:
HTC One X+ Retired
Samsung Galaxy S5 SM-G900A Root KoolKit ROM
Samsung Galaxy Tab3 7" JB4.2.2 SM-T217A Rooted S5 Tweaked

If you think my work is worthwhile feel free to donate
by clicking on the "Donate to me" button.
Thank you for your support.


 
GDofWR420
Old
#3  
GDofWR420's Avatar
Senior Member
Thanks Meter 209
Posts: 1,244
Join Date: May 2011
Nice. People with o.c.d. are gonna love this. Nice work.

The Gods Approve This Post, From The Ghost Of Sparta's S5 active.
 
cstayton
Old
#4  
cstayton's Avatar
Recognized Developer - OP
Thanks Meter 2,911
Posts: 2,038
Join Date: Mar 2011
Location: Waite Park, MN.

 
DONATE TO ME
Quote:
Originally Posted by GDofWR420 View Post
Nice. People with o.c.d. are gonna love this. Nice work.

The Gods Approve This Post, From The Ghost Of Sparta's S5 active.
LOL. Yea it was my OCD that drove me to make Aou's mod work for us, of course now I'm half blind and hyped up on starbucks doubleshots but what the heck right?

Devices:
HTC One X+ Retired
Samsung Galaxy S5 SM-G900A Root KoolKit ROM
Samsung Galaxy Tab3 7" JB4.2.2 SM-T217A Rooted S5 Tweaked

If you think my work is worthwhile feel free to donate
by clicking on the "Donate to me" button.
Thank you for your support.


The Following 2 Users Say Thank You to cstayton For This Useful Post: [ Click to Expand ]
 
GDofWR420
Old
(Last edited by GDofWR420; 14th July 2014 at 08:11 PM.)
#5  
GDofWR420's Avatar
Senior Member
Thanks Meter 209
Posts: 1,244
Join Date: May 2011
Quote:
Originally Posted by cstayton View Post
LOL. Yea it was my OCD that drove me to make Aou's mod work for us, of course now I'm half blind and hyped up on starbucks doubleshots but what the heck right?
Lol. Yea no coffee this morning but I found an ice cold Sunkist that will do in a pinch. Country living make you to lazy to go to the store. OCD here to.

Would it be possible to get a tutorial on changing over scroll glowing or maybe you have a link you know of.:sly:

The Gods Approve This Post, From The Ghost Of Sparta's S5 active.
 
eric-filth
Old
(Last edited by eric-filth; 20th July 2014 at 05:01 AM.)
#6  
eric-filth's Avatar
Senior Member
Thanks Meter 974
Posts: 1,473
Join Date: Nov 2011
Location: Ponta Grossa - PR

 
DONATE TO ME
Here is not working

The last step are only to change the
Code:
const v6, 0x7f0901a7
for
Code:
const v1, 0x7f0901a6
?

or change this

Code:
.method private changeSysScopeStatus()V
    .registers 8

    .prologue
    const-wide/16 v3, 0x3e8

    const v6, 0x7f0901a7

    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
for this

Code:
.method private changeSysScopeStatus()V
    .registers 4

    .prologue
    const v1, 0x7f0901a6

    .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
?
 
cstayton
Old
#7  
cstayton's Avatar
Recognized Developer - OP
Thanks Meter 2,911
Posts: 2,038
Join Date: Mar 2011
Location: Waite Park, MN.

 
DONATE TO ME
Quote:
Originally Posted by eric-filth View Post
Here is not working

The last step are only to change the
Code:
const v6, 0x7f0901a7
for
Code:
const v1, 0x7f0901a6
?

or change this

Code:
.method private changeSysScopeStatus()V
    .registers 8

    .prologue
    const-wide/16 v3, 0x3e8

    const v6, 0x7f0901a7

    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
for this

Code:
.method private changeSysScopeStatus()V
    .registers 4

    .prologue
    const v1, 0x7f0901a6

    .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
?
you need to change the whole method out the lines with the ID are what you need to look up in your build to match to the appropriate status response.

Devices:
HTC One X+ Retired
Samsung Galaxy S5 SM-G900A Root KoolKit ROM
Samsung Galaxy Tab3 7" JB4.2.2 SM-T217A Rooted S5 Tweaked

If you think my work is worthwhile feel free to donate
by clicking on the "Donate to me" button.
Thank you for your support.


 
cstayton
Old
#8  
cstayton's Avatar
Recognized Developer - OP
Thanks Meter 2,911
Posts: 2,038
Join Date: Mar 2011
Location: Waite Park, MN.

 
DONATE TO ME
Quote:
Originally Posted by GDofWR420 View Post
Lol. Yea no coffee this morning but I found an ice cold Sunkist that will do in a pinch. Country living make you to lazy to go to the store. OCD here to.

Would it be possible to get a tutorial on changing over scroll glowing or maybe you have a link you know of.:sly:

The Gods Approve This Post, From The Ghost Of Sparta's S5 active.
I'll see if i can find one for overscroll, its a pretty common mod i used to use it in the days of CM7

Devices:
HTC One X+ Retired
Samsung Galaxy S5 SM-G900A Root KoolKit ROM
Samsung Galaxy Tab3 7" JB4.2.2 SM-T217A Rooted S5 Tweaked

If you think my work is worthwhile feel free to donate
by clicking on the "Donate to me" button.
Thank you for your support.


 
GDofWR420
Old
#9  
GDofWR420's Avatar
Senior Member
Thanks Meter 209
Posts: 1,244
Join Date: May 2011
Quote:
Originally Posted by cstayton View Post
I'll see if i can find one for overscroll, its a pretty common mod i used to use it in the days of CM7
Actually I found a module for xposed called xuimodule it allows for over scroll color change. Works OK on stock but with the koolkit.xml it's a little funky as I believe it was causing some lag so I removed it and lag is gone.

Sent from my SAMSUNG-SM-G870A using XDA Premium 4 mobile app
 
cstayton
Old
#10  
cstayton's Avatar
Recognized Developer - OP
Thanks Meter 2,911
Posts: 2,038
Join Date: Mar 2011
Location: Waite Park, MN.

 
DONATE TO ME
Quote:
Originally Posted by GDofWR420 View Post
Actually I found a module for xposed called xuimodule it allows for over scroll color change. Works OK on stock but with the koolkit.xml it's a little funky as I believe it was causing some lag so I removed it and lag is gone.

Sent from my SAMSUNG-SM-G870A using XDA Premium 4 mobile app
hmmmm, i wonder if it has an entry in csc that it couldnt handle because its locked down? I might have to re-think the whole "xPosed-Proof" feature mod.

Devices:
HTC One X+ Retired
Samsung Galaxy S5 SM-G900A Root KoolKit ROM
Samsung Galaxy Tab3 7" JB4.2.2 SM-T217A Rooted S5 Tweaked

If you think my work is worthwhile feel free to donate
by clicking on the "Donate to me" button.
Thank you for your support.



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes