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

Search This thread

t-ryder

Senior Member
Feb 23, 2011
1,569
1,256
www.t-ryder.de
Google Pixel 6
OP, this made my day. Thanks a bunch, now I can manage that stuff on my MiPad and do not need an extra app.

But I realized that app ops does not work for system apps. They turn on permissions again if turned off. Sucks kind of.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 30
    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, 0x2[COLOR="Red"]c[/COLOR]
    
        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, 0x2[COLOR="red"]d[/COLOR]
    
        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
    
        [B][COLOR="green"]const/16 v1, 0x[COLOR="red"]2c[/COLOR]
    
        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[/COLOR][/B]
    
        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" />

    d5av.png
    3
    here it is
    4.4.3 settings for nexus 5 with app ops enabled
    its only the apk in a rar file so extract it and rename and manually replace Settings.apk under system/priv-app/
    this is NOT a flashable zip!

    sha1:ec526b50082edf0564364253c1b8aee4a8438a2d
    https://www.mediafire.com/?m8edtkj9kx59s70
    2
    I used App Ops Starter app from playstore as a work around. But it'd be great if you shared your method so I could avoid using 3rd party apps for it and have it more as an "native" rom feature.

    Sent from my GT-I9505G using Tapatalk


    Here's what I did

    Added this line to Strings.xml
    Code:
        <string name="app_ops_settings_summary">Manage app permissions</string>

    Added this line to security_settings_misc.xml under the device admin label
    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" />

    d5av.png
    1
    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...
    1
    I've never done this before! I followed this guide, but I cant find Settings.apk in /system/app. Halp? Thanks!

    /system/priv-app/

    You will always need /system/framework/framework-res.apk. Install this as a framework.

    Once you rebuild, take just the classes.dex from the build/apk/ folder and jam it back in the original apk. Repush that to your device with adb and chmod 644 it.

    Also, if you're on a ROM with custom settings already, the values in this guide might not be suitable. Mine were offset by +2.