Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP cstayton

9th August 2014, 02:32 AM   |  #11  
Senior Member
Phoenix Metro
Thanks Meter: 45
 
104 posts
Join Date:Joined: Oct 2010
More
Hey, followed your CIQ removal guide and everything went perfectly. I've checked for any CIQ threads or network traffic and there is none. Job very well done.

However, with this guide, I am finding I have /system/app/SysScope.apk but no SecSettings.apk. I have a bunch of other APKs that begin with the Sec prefix but no SecSettings.apk. Any ideas?

EDIT: Found it under /system/priv-app/SecSettings.apk. You should update the pull command in the guide.

EDIT2: Can't find /res/values/public.xml file that contains any mention of sysscope, checked framework-res.apk and twframework-res.apk as well as SecSettings.apk. No luck. Is the definition somewhere else perhaps?

EDIT3: Perhaps this is tied to the fact that I can only open SecSettings.apk for editing if I chose "basic editing" in the import. If I try for advanced editing, I get a slew of decompilation errors, regardless of which FrameworkTag I pick.

Decompilation errors that occur if I try to decomp with aapt are the same as the ones I see if I try to do "advanced editing". I've tried both framework tags when importing and I always get these errors during unpack. I have a feeling that "basic editing" doesn't fully unpack the res directory as needed and advanced is having trouble with the XML parse.

decomp errors
Last edited by deduction; 9th August 2014 at 04:05 AM.
9th August 2014, 07:08 PM   |  #12  
elliwigy's Avatar
Senior Member
Flag California
Thanks Meter: 1,187
 
2,694 posts
Join Date:Joined: Mar 2011
Donate to Me
More
Quote:
Originally Posted by deduction

Hey, followed your CIQ removal guide and everything went perfectly. I've checked for any CIQ threads or network traffic and there is none. Job very well done.

However, with this guide, I am finding I have /system/app/SysScope.apk but no SecSettings.apk. I have a bunch of other APKs that begin with the Sec prefix but no SecSettings.apk. Any ideas?

EDIT: Found it under /system/priv-app/SecSettings.apk. You should update the pull command in the guide.

EDIT2: Can't find /res/values/public.xml file that contains any mention of sysscope, checked framework-res.apk and twframework-res.apk as well as SecSettings.apk. No luck. Is the definition somewhere else perhaps?

EDIT3: Perhaps this is tied to the fact that I can only open SecSettings.apk for editing if I chose "basic editing" in the import. If I try for advanced editing, I get a slew of decompilation errors, regardless of which FrameworkTag I pick.

Decompilation errors that occur if I try to decomp with aapt are the same as the ones I see if I try to do "advanced editing". I've tried both framework tags when importing and I always get these errors during unpack. I have a feeling that "basic editing" doesn't fully unpack the res directory as needed and advanced is having trouble with the XML parse.

decomp errors

try tickle my android on here.. its mainly for theming but i had success with de/recompiling apks and you can edit the files needed for any mod before recompiling

Sent from my SM-G900V using XDA Free mobile app

---------- Post added at 10:08 AM ---------- Previous post was at 10:04 AM ----------

Quote:
Originally Posted by cstayton

How to permenantly remove SysScope from your Samsung Touchwiz ROM


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








NOTICE:


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/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:

hey.. had question bout install method.. i assume it to be ok to just remove syscope.apk from rom and then add modded secsettings.apk to priv-app folder in rom base and flashing rom will work?

Sent from my SM-G900V using XDA Free mobile app
10th August 2014, 09:54 PM   |  #13  
cstayton's Avatar
OP Recognized Developer
Flag Waite Park, MN.
Thanks Meter: 3,625
 
2,320 posts
Join Date:Joined: Mar 2011
Donate to Me
More
Quote:
Originally Posted by elliwigy

try tickle my android on here.. its mainly for theming but i had success with de/recompiling apks and you can edit the files needed for any mod before recompiling

Sent from my SM-G900V using XDA Free mobile app

---------- Post added at 10:08 AM ---------- Previous post was at 10:04 AM ----------



hey.. had question bout install method.. i assume it to be ok to just remove syscope.apk from rom and then add modded secsettings.apk to priv-app folder in rom base and flashing rom will work?

Sent from my SM-G900V using XDA Free mobile app

from the error looks as if you are trying to decompile with the wrong frameworks youll need to make sure the framework-res.apk and twframework-res.apk are the ones unmodded stock ones from your rom base
The Following User Says Thank You to cstayton For This Useful Post: [ View ]
21st August 2014, 09:03 PM   |  #14  
cstayton's Avatar
OP Recognized Developer
Flag Waite Park, MN.
Thanks Meter: 3,625
 
2,320 posts
Join Date:Joined: Mar 2011
Donate to Me
More
Quote:
Originally Posted by elliwigy

try tickle my android on here.. its mainly for theming but i had success with de/recompiling apks and you can edit the files needed for any mod before recompiling

Sent from my SM-G900V using XDA Free mobile app

---------- Post added at 10:08 AM ---------- Previous post was at 10:04 AM ----------



hey.. had question bout install method.. i assume it to be ok to just remove syscope.apk from rom and then add modded secsettings.apk to priv-app folder in rom base and flashing rom will work?

Sent from my SM-G900V using XDA Free mobile app

once you have the mod completed yes, remove sysscope.apk and place modded secsettings in rom base and flash
The Following User Says Thank You to cstayton For This Useful Post: [ View ]
15th September 2014, 12:01 AM   |  #15  
Nickovtyme's Avatar
Senior Member
Thanks Meter: 234
 
830 posts
Join Date:Joined: Jan 2011
More
ok...can you take a look at these? I get about half way through your guide and then it gets lost. I don't know if the info just isnt there or what?

Thanks!
Attached Files
File Type: zip Codes.zip - [Click for QR Code] (116.0 KB, 7 views)
15th September 2014, 12:43 AM   |  #16  
cstayton's Avatar
OP Recognized Developer
Flag Waite Park, MN.
Thanks Meter: 3,625
 
2,320 posts
Join Date:Joined: Mar 2011
Donate to Me
More
Quote:
Originally Posted by deduction

Hey, followed your CIQ removal guide and everything went perfectly. I've checked for any CIQ threads or network traffic and there is none. Job very well done.

However, with this guide, I am finding I have /system/app/SysScope.apk but no SecSettings.apk. I have a bunch of other APKs that begin with the Sec prefix but no SecSettings.apk. Any ideas?

EDIT: Found it under /system/priv-app/SecSettings.apk. You should update the pull command in the guide.

EDIT2: Can't find /res/values/public.xml file that contains any mention of sysscope, checked framework-res.apk and twframework-res.apk as well as SecSettings.apk. No luck. Is the definition somewhere else perhaps?

EDIT3: Perhaps this is tied to the fact that I can only open SecSettings.apk for editing if I chose "basic editing" in the import. If I try for advanced editing, I get a slew of decompilation errors, regardless of which FrameworkTag I pick.

Decompilation errors that occur if I try to decomp with aapt are the same as the ones I see if I try to do "advanced editing". I've tried both framework tags when importing and I always get these errors during unpack. I have a feeling that "basic editing" doesn't fully unpack the res directory as needed and advanced is having trouble with the XML parse.

decomp errors

your not looking sysscope your actually looking for " <public type="string" name="sysscope_normal" you have to be specific in the search
The Following User Says Thank You to cstayton For This Useful Post: [ View ]
15th September 2014, 01:36 AM   |  #17  
Nickovtyme's Avatar
Senior Member
Thanks Meter: 234
 
830 posts
Join Date:Joined: Jan 2011
More
am having trouble getting dropbox or anywhere to work. Here is the untouched status.smali.

Thanks very much...I keep getting stumped because the edits I need to make just don't seem to be there when I decompile the apk. Not sure why.
Attached Files
File Type: zip Untouchedsmali.zip - [Click for QR Code] (13.7 KB, 7 views)
2nd November 2014, 04:03 PM   |  #18  
cstayton's Avatar
OP Recognized Developer
Flag Waite Park, MN.
Thanks Meter: 3,625
 
2,320 posts
Join Date:Joined: Mar 2011
Donate to Me
More
small change in OP
small change in OP

Delete: /smali/com/android/settings/deviceinfo/status$2.smali

re-compile SecSettings.apk

The Following 2 Users Say Thank You to cstayton For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes