5,603,646 Members 36,881 Now Online
XDA Developers Android and Mobile Development Forum

[ How-to ] Enable App Ops again in 4.4.2 / KOT49H

Tip us?
 
Calkulin
Old
(Last edited by Calkulin; 28th December 2013 at 06:26 PM.)
#1  
Calkulin's Avatar
Recognized Developer - OP
Thanks Meter 6425
Posts: 1,393
Join Date: Sep 2008

 
DONATE TO ME
Default [ How-to ] Enable App Ops again in 4.4.2 / KOT49H

Here's a quick guide on how to enable App Ops in 4.4.2 / KOT49H. Decompile Settings.apk, open the Settings.smali and make these changes. Now if you want to keep ART working, don't deodex and just use the classes.dex that already included in the apk.

1.
Code:
.method static constructor <clinit>()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 126
    sput-boolean v2, Lcom/android/settings/Settings;->sShowNoHomeNotice:Z

    .line 309
    const/16 v0, 0x2c

    new-array v0, v0, [Ljava/lang/String;
Change to - +1

Code:
.method static constructor <clinit>()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 126
    sput-boolean v2, Lcom/android/settings/Settings;->sShowNoHomeNotice:Z

    .line 309
    const/16 v0, 0x2d

    new-array v0, v0, [Ljava/lang/String;
2.
Code:
    const/16 v1, 0x2b

    const-class v2, Lcom/android/settings/inputmethod/KeyboardLayoutPickerFragment;

    invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v2

    aput-object v2, v0, v1

    sput-object v0, Lcom/android/settings/Settings;->ENTRY_FRAGMENTS:[Ljava/lang/String;
Add this - What's marked in red should be 1 less than what you changed in the previous step (Or the previous number before adding 1)

Code:
    const/16 v1, 0x2b

    const-class v2, Lcom/android/settings/inputmethod/KeyboardLayoutPickerFragment;

    invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v2

    aput-object v2, v0, v1

    const/16 v1, 0x2c

    const-class v2, Lcom/android/settings/applications/AppOpsSummary;

    invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v2

    aput-object v2, v0, v1

    sput-object v0, Lcom/android/settings/Settings;->ENTRY_FRAGMENTS:[Ljava/lang/String;

EDIT: Here's how to add it to Settings/Security

Added this to values/strings.xml
Code:
    <string name="app_ops_settings_summary">Manage app permissions</string>
Add this to xml/security_settings_misc.xml under the device admin title
Code:
        <Preference android:title="@string/app_ops_settings" android:key="app_ops_summary" android:summary="@string/app_ops_settings_summary" android:fragment="com.android.settings.applications.AppOpsSummary" />
If you like my work, donate to buy me a beer or 2

The Following 23 Users Say Thank You to Calkulin For This Useful Post: [ Click to Expand ]
 
Fenny
Old
#2  
Recognized Developer
Thanks Meter 1409
Posts: 949
Join Date: Jun 2007

 
DONATE TO ME
Great tutorial, but you left out the line that makes the first change actually make sense. The one that initializes the collection to a certain size. I.E. 0x2d instead of 0x2c
Other than that, easy to follow, and useful. Thank you very much for this.
By popular demand: Klik to send me Beer Moneys
 
Calkulin
Old
#3  
Calkulin's Avatar
Recognized Developer - OP
Thanks Meter 6425
Posts: 1,393
Join Date: Sep 2008

 
DONATE TO ME
Quote:
Originally Posted by Fenny View Post
Great tutorial, but you left out the line that makes the first change actually make sense. The one that initializes the collection to a certain size. I.E. 0x2d instead of 0x2c
Other than that, easy to follow, and useful. Thank you very much for this.

That was actually the first step

Quote:
Originally Posted by Calkulin View Post
1.
Code:
.method static constructor <clinit>()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 126
    sput-boolean v2, Lcom/android/settings/Settings;->sShowNoHomeNotice:Z

    .line 309
    const/16 v0, 0x2c
Change to

Code:
.method static constructor <clinit>()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 126
    sput-boolean v2, Lcom/android/settings/Settings;->sShowNoHomeNotice:Z

    .line 309
    const/16 v0, 0x2d
If you like my work, donate to buy me a beer or 2

 
Fenny
Old
#4  
Recognized Developer
Thanks Meter 1409
Posts: 949
Join Date: Jun 2007

 
DONATE TO ME
Quote:
Originally Posted by Calkulin View Post
That was actually the first step
Right, but there is a line after the end of the code snippet that actually uses the constant /16 that is being defined to initialize the array. Without that, it's just changing an arbitrary constant.
By popular demand: Klik to send me Beer Moneys
 
XBlackChaosX
Old
#5  
XBlackChaosX's Avatar
Senior Member
Thanks Meter 19
Posts: 175
Join Date: Oct 2011
Location: New York
You can also just use AppOpsXposed module for xposed framework.

Sent from my Droid Razr Maxx HD (GSM)
 
Fenny
Old
#6  
Recognized Developer
Thanks Meter 1409
Posts: 949
Join Date: Jun 2007

 
DONATE TO ME
Quote:
Originally Posted by XBlackChaosX View Post
You can also just use AppOpsXposed module for xposed framework.

Sent from my Droid Razr Maxx HD (GSM)
That would break ART.
By popular demand: Klik to send me Beer Moneys
 
Calkulin
Old
#7  
Calkulin's Avatar
Recognized Developer - OP
Thanks Meter 6425
Posts: 1,393
Join Date: Sep 2008

 
DONATE TO ME
Quote:
Originally Posted by Fenny View Post
Right, but there is a line after the end of the code snippet that actually uses the constant /16 that is being defined to initialize the array. Without that, it's just changing an arbitrary constant.

Both the Nexus 4 and 5 builds that I did, did not have that, so post it and let me see it
If you like my work, donate to buy me a beer or 2

 
XBlackChaosX
Old
#8  
XBlackChaosX's Avatar
Senior Member
Thanks Meter 19
Posts: 175
Join Date: Oct 2011
Location: New York
True, I haven't gotten the chance to try ART, and I won't until xposed framework somehow starts working with ART. Does ART improve anything on your phone?

Sent from my Droid Razr Maxx HD (GSM)
 
nikodr
Old
#9  
Senior Member
Thanks Meter 53
Posts: 222
Join Date: Jul 2010
Quote:
Originally Posted by XBlackChaosX View Post
True, I haven't gotten the chance to try ART, and I won't until xposed framework somehow starts working with ART. Does ART improve anything on your phone?

Sent from my Droid Razr Maxx HD (GSM)
Less memory usage,faster loading of some applications,and phone had quicker response.
 
Fenny
Old
(Last edited by Fenny; 13th December 2013 at 09:25 PM.)
#10  
Recognized Developer
Thanks Meter 1409
Posts: 949
Join Date: Jun 2007

 
DONATE TO ME
Quote:
Originally Posted by Calkulin View Post
Both the Nexus 4 and 5 builds that I did, did not have that, so post it and let me see it
Code:
.method static constructor <clinit>()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 126
    sput-boolean v2, Lcom/android/settings/Settings;->sShowNoHomeNotice:Z

    .line 309
    const/16 v0, 0x2c

    new-array v0, v0, [Ljava/lang/String;
Quite literally, it is the line after it.
I am just suggesting that it should be included for context.

That way we know that this is referring to the array we defined as v0:

Code:
 aput-object v2, v0, v1
Don't mind me though. I just have this thing about people blindly following tutorials while not really knowing why they are doing what they are doing...
By popular demand: Klik to send me Beer Moneys

The Following User Says Thank You to Fenny For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes