• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[MODULE] Privileged Permission Whitelist (Oreo)

Search This thread

yochananmarqos

Recognized Contributor
**** This module is now obsolete as privapp permissions are now granted automatically when systemizing apps with Terminal App Systemizer. Please use that from now on. ****

In Android 8.0 Oreo, permissions are not automatically granted to system privileged apps. This is automatically done by apps where the root method allows system modifications, but with systemless root that has to be done in a different way.

Therefore, apps systemized into /system/priv-app using App Systemizer or Terminal App Systemizer will not be granted some permissions. All privileged apps must be whitelisted in system configuration files in the /etc/permissions directory.

Entries can either be appended to /etc/permissions/privapp-permissions-platform.xml or separate files can be created for each package; i.e., /etc/permissions/privapp-permisisons-com.package.name.xml. The latter is easier and more modular (pun intended :laugh: ).

This module is more of a template. I've included XML files for BetterBatteryStats, Cerberus, F-Droid Privileged Extension, Greenify and Wakelock Detector Free. Before flashing it, you will want to add or remove XML files according to your needs.

Example XML file:

/etc/permissions/privapp-permisisons-com.package.name.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<permissions>
  <privapp-permissions package="com.package.name">
	<permission name="android.permission.WRITE_A_SETTING" />
	<permission name="android.permission.WRITE_ANOTHER_SETTING" />
  </privapp-permissions>
</permissions>

In order to determine what permissions are missing from your systemized app, you can compare the requested permissions and install permissions by running:

Code:
adb shell dumpsys package com.package.name

However, not every permission missing from the install permissions section needs to be granted in this manner. If you're not sure, contact the app developer for clarification.

A better version of this module would generate the permissions configuration XML file without having to get your hands dirty. However, that would require including aapt and I haven't figured out how to do it yet. Perhaps @stangri or @veez21 could help with that. :cool:

Download:
Module removed, please use Terminal App Systemizer
 
Last edited:

resarfekim

Senior Member
Jan 26, 2011
501
105


Hi, I'm trying to get FakeGPS to work on Oreo. I think I've done everything correctly, but the app freezes when I try to engage the location.
Below is the output from ADB. Does this looks correct, or do I need further action? Thanks!

Activity Resolver Table:
Full MIME Types:
text/plain:
361e3e2 com.incorporateapps.fakegps/.Maps filter 67f598b
Action: "android.intent.action.SEND"
Category: "android.intent.category.DEFAULT"
Type: "text/plain"

Base MIME Types:
text:
361e3e2 com.incorporateapps.fakegps/.Maps filter 67f598b
Action: "android.intent.action.SEND"
Category: "android.intent.category.DEFAULT"
Type: "text/plain"

Schemes:
geo:
361e3e2 com.incorporateapps.fakegps/.Maps filter 35b935a
Action: "android.intent.action.VIEW"
Category: "android.intent.category.DEFAULT"
Category: "android.intent.category.BROWSABLE"
Scheme: "geo"

Non-Data Actions:
com.htc.laputa.map.action.REVERSE_ADDR_ON_MAP:
361e3e2 com.incorporateapps.fakegps/.Maps filter 7e66705
Action: "com.htc.laputa.map.action.REVERSE_ADDR_ON_MAP"
Category: "android.intent.category.DEFAULT"
android.intent.action.MAIN:
361e3e2 com.incorporateapps.fakegps/.Maps filter 38ce27c
Action: "android.intent.action.MAIN"
Category: "android.intent.category.LAUNCHER"

MIME Typed Actions:
android.intent.action.SEND:
361e3e2 com.incorporateapps.fakegps/.Maps filter 67f598b
Action: "android.intent.action.SEND"
Category: "android.intent.category.DEFAULT"
Type: "text/plain"

Receiver Resolver Table:
Non-Data Actions:
android.intent.action.BOOT_COMPLETED:
6e91373 com.incorporateapps.fakegps/.BootServiceReceiver filter abfc04e
Action: "android.intent.action.BOOT_COMPLETED"
mPriority=999, mHasPartialTypes=false
com.incorporateapps.fakegps.ACTION_STOP:
31c8230 com.incorporateapps.fakegps/.StopButtonListener filter a90d56f
Action: "com.incorporateapps.fakegps.ACTION_STOP"

Service Resolver Table:
Non-Data Actions:
com.incorporateapps.fakegps.STOP:
3ee3ea9 com.incorporateapps.fakegps/.Tasker filter c041f49
Action: "com.incorporateapps.fakegps.STOP"
com.incorporateapps.fakegps.ENGAGE:
3ee3ea9 com.incorporateapps.fakegps/.Tasker filter c910150
Action: "com.incorporateapps.fakegps.ENGAGE"

Key Set Manager:
[com.incorporateapps.fakegps]
Signing KeySets: 67

Packages:
Package [com.incorporateapps.fakegps] (33e5c2e):
userId=10091
pkg=Package{b3773cf com.incorporateapps.fakegps}
codePath=/data/app/com.incorporateapps.fakegps-7O6AqP-HQQ0wLXWBTXyOLw==
resourcePath=/data/app/com.incorporateapps.fakegps-7O6AqP-HQQ0wLXWBTXyOLw==
legacyNativeLibraryDir=/data/app/com.incorporateapps.fakegps-7O6AqP-HQQ0wLXWBTXyOLw==/lib
primaryCpuAbi=null
secondaryCpuAbi=null
versionCode=67 minSdk=8 targetSdk=20
versionName=4.9.6
splits=[base]
apkSigningVersion=1
applicationInfo=ApplicationInfo{cff915c com.incorporateapps.fakegps}
flags=[ SYSTEM HAS_CODE ALLOW_CLEAR_USER_DATA UPDATED_SYSTEM_APP ALLOW_BACKUP ]
privateFlags=[ PRIVILEGED ]
dataDir=/data/user/0/com.incorporateapps.fakegps
supportsScreens=[small, medium, large, xlarge, resizeable, anyDensity]
usesLibraries:
com.google.android.maps
usesLibraryFiles:
/system/framework/com.google.android.maps.jar
timeStamp=2017-09-26 08:41:14
firstInstallTime=2017-09-26 08:41:15
lastUpdateTime=1970-08-29 17:38:13
installerPackageName=com.android.vending
signatures=PackageSignatures{431c65 [15a9c792]}
installPermissionsFixed=true installStatus=1
pkgFlags=[ SYSTEM HAS_CODE ALLOW_CLEAR_USER_DATA UPDATED_SYSTEM_APP ALLOW_BACKUP ]
requested permissions:
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_COARSE_LOCATION
android.permission.INTERNET
android.permission.ACCESS_MOCK_LOCATION
android.permission.WRITE_SETTINGS
com.android.vending.CHECK_LICENSE
android.permission.INSTALL_LOCATION_PROVIDER
android.permission.WRITE_SECURE_SETTINGS
android.permission.RECEIVE_BOOT_COMPLETED
android.permission.UPDATE_APP_OPS_STATS
install permissions:
android.permission.WRITE_SETTINGS: granted=true
android.permission.ACCESS_FINE_LOCATION: granted=true
android.permission.INSTALL_LOCATION_PROVIDER: granted=true
android.permission.RECEIVE_BOOT_COMPLETED: granted=true
android.permission.INTERNET: granted=true
com.android.vending.CHECK_LICENSE: granted=true
android.permission.WRITE_SECURE_SETTINGS: granted=true
android.permission.ACCESS_COARSE_LOCATION: granted=true
android.permission.UPDATE_APP_OPS_STATS: granted=true
User 0: ceDataInode=1736796 installed=true hidden=false suspended=false stopped=false notLaunched=false enabled=0 instant=false
gids=[3003]
runtime permissions:

Hidden system packages:
Package [com.incorporateapps.fakegps] (a580d3a):
userId=10091
pkg=Package{617deb com.incorporateapps.fakegps}
codePath=/system/priv-app/FakeGPS
resourcePath=/system/priv-app/FakeGPS
legacyNativeLibraryDir=/system/priv-app/FakeGPS/lib
primaryCpuAbi=null
secondaryCpuAbi=null
versionCode=67 minSdk=8 targetSdk=20
versionName=4.9.6
splits=[base]
apkSigningVersion=1
applicationInfo=ApplicationInfo{ca26748 com.incorporateapps.fakegps}
flags=[ HAS_CODE ALLOW_CLEAR_USER_DATA ALLOW_BACKUP ]
dataDir=null
supportsScreens=[small, medium, large, xlarge, resizeable, anyDensity]
usesLibraries:
com.google.android.maps
timeStamp=1970-08-29 17:38:13
firstInstallTime=2017-09-26 08:41:15
lastUpdateTime=1970-08-29 17:38:13
signatures=PackageSignatures{64e19e1 []}
installPermissionsFixed=false installStatus=1
pkgFlags=[ SYSTEM ]
requested permissions:
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_COARSE_LOCATION
android.permission.INTERNET
android.permission.ACCESS_MOCK_LOCATION
android.permission.WRITE_SETTINGS
com.android.vending.CHECK_LICENSE
android.permission.INSTALL_LOCATION_PROVIDER
android.permission.WRITE_SECURE_SETTINGS
android.permission.RECEIVE_BOOT_COMPLETED
android.permission.UPDATE_APP_OPS_STATS
install permissions:
android.permission.WRITE_SETTINGS: granted=true
android.permission.ACCESS_FINE_LOCATION: granted=true
android.permission.RECEIVE_BOOT_COMPLETED: granted=true
android.permission.INTERNET: granted=true
com.android.vending.CHECK_LICENSE: granted=true
android.permission.ACCESS_COARSE_LOCATION: granted=true
User 0: ceDataInode=0 installed=true hidden=false suspended=false stopped=false notLaunched=false enabled=0 instant=false
gids=[3003]
runtime permissions:

Package Changes:
Sequence number=6
User 0:
seq=0, package=com.google.android.talk
seq=4, package=com.google.android.gms
seq=5, package=com.android.terminal


Dexopt state:
[com.incorporateapps.fakegps]
Instruction Set: arm64
path: /data/app/com.incorporateapps.fakegps-7O6AqP-HQQ0wLXWBTXyOLw==/base.apk
status: /data/app/com.incorporateapps.fakegps-7O6AqP-HQQ0wLXWBTXyOLw==/oat/arm64/base.odex[status=kOatUpToDate, co
mpilation_filter=quicken]


Compiler stats:
[com.incorporateapps.fakegps]
base.apk - 728
com.incorporateapps.fakegps.apk - 533
 

yochananmarqos

Recognized Contributor
Hi, I'm trying to get FakeGPS to work on Oreo. I think I've done everything correctly, but the app freezes when I try to engage the location.
Below is the output from ADB. Does this looks correct, or do I need further action? Thanks!

pkgFlags=[ SYSTEM ]
requested permissions:
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_COARSE_LOCATION
android.permission.INTERNET
android.permission.ACCESS_MOCK_LOCATION
android.permission.WRITE_SETTINGS
com.android.vending.CHECK_LICENSE
android.permission.INSTALL_LOCATION_PROVIDER
android.permission.WRITE_SECURE_SETTINGS
android.permission.RECEIVE_BOOT_COMPLETED
android.permission.UPDATE_APP_OPS_STATS
install permissions:
android.permission.WRITE_SETTINGS: granted=true
android.permission.ACCESS_FINE_LOCATION: granted=true
android.permission.RECEIVE_BOOT_COMPLETED: granted=true
android.permission.INTERNET: granted=true
com.android.vending.CHECK_LICENSE: granted=true
android.permission.ACCESS_COARSE_LOCATION: granted=true

Notice the bit from the dump I left in the quote. These permissions are not granted:

Code:
android.permission.ACCESS_MOCK_LOCATION
android.permission.INSTALL_LOCATION_PROVIDER
android.permission.WRITE_SECURE_SETTINGS
android.permission.UPDATE_APP_OPS_STATS

What have you done so far?
 

yochananmarqos

Recognized Contributor
Would you believe I didn't notice BetterBatteryStats was missing permissions? :silly: I thought it was no longer necessary as the How-to & FAQ in the main BBS thread states it does not require the system app anymore.

However, it turns out (at least on Oreo) it is still necessary. I noticed these required permissions are not being granted:

android.permission.DUMP
android.permission.READ_LOGS
android.permission.DEVICE_POWER

You can verify the permissions are granted (or not) by going to BBS Settings > Advanced > Install as system app.

I updated the module to support the Play Store version and the XDA Edition. Download in the OP.

@chamonix The above permissions will also need to be granted via adb for those running BBS on a non-rooted device.

Thanks to @kd- for figuring this out :good:
 
Last edited:

chamonix

Recognized Contributor
Nov 7, 2008
4,978
19,238
Berlin
Would you believe I didn't notice BetterBatteryStats was missing permissions? :silly: I thought it was no longer necessary as the How-to & FAQ in the main BBS thread states it does not require the system app anymore.

However, it turns out (at least on Oreo) it is still necessary. I noticed these required permissions are not being granted:

android.permission.DUMP
android.permission.READ_LOGS
android.permission.DEVICE_POWER

You can verify the permissions are granted (or not) by going to BBS Settings > Advanced > Install as system app.

I updated the module to support the Play Store version and the XDA Edition. Download in the OP.

@chamonix The above permissions will also need to be granted via adb for those running BBS on a non-rooted device.

Thanks to @kd- for figuring this out :good:

what version are you using and are there features not working when these perms are missing?
 

yochananmarqos

Recognized Contributor
what version are you using and are there features not working when these perms are missing?

I'm using the 2.2.2 XDA Edition. I see a lot more stats with those permissions than without. They are automatically granted when BBS is a system app on Nougat and below, however they are not on Oreo. See the link in the OP to the documentation. Also, @kd- was not able to see Partial Wakelocks until he enabled those permissions with my module. I don't know if he tried forcing the API method or not.

Seeing how this isn't the best place to troubleshoot BBS, shall we continue in the BBS thread? Mention me there if you want to do that.
 

robbieas

Senior Member
Jun 20, 2011
130
9
Atlanta
How do you install this module? I downloaded the zip. Unzipped, edited the xml files as needed, rezipped and tried to install through Magisk app as a module. It said it's not a valid Magisk module.

I'm a little new to Magisk, so I'm sure this is a me issue... any guidance you can provide is appreciated.
 

yochananmarqos

Recognized Contributor
How do you install this module? I downloaded the zip. Unzipped, edited the xml files as needed, rezipped and tried to install through Magisk app as a module. It said it's not a valid Magisk module.

I'm a little new to Magisk, so I'm sure this is a me issue... any guidance you can provide is appreciated.
It installed fine in Magisk Manager for me. Try flashing it in recovery.

Sent from my Nexus 5X using XDA Labs
 

robbieas

Senior Member
Jun 20, 2011
130
9
Atlanta
It installed fine in Magisk Manager for me. Try flashing it in recovery.

Sent from my Nexus 5X using XDA Labs

As suspected, user error.... When I rezipped things I zipped the folder not the files, so everything was buried a level too deep.

This worked like a charm and got Tasker Tether working on stock rooted Oreo on a 6p. Thanks!
 

Spikelangelo

Senior Member
Apr 20, 2010
291
49
Philadelphia
Google Pixel 6 Pro
As suspected, user error.... When I rezipped things I zipped the folder not the files, so everything was buried a level too deep.

This worked like a charm and got Tasker Tether working on stock rooted Oreo on a 6p. Thanks!
Do you mind sharing how you got tether working with tasker and Oreo? I'm struggling to get it working on my Pixel 2.

I've tried just tasker alone, securetask, and nougat+ taker tether control and I just can't get it to work. (Manually toggling via the navigation tile works fine, just not programmatically.)

Sent from my Pixel 2 using Tapatalk
 

robbieas

Senior Member
Jun 20, 2011
130
9
Atlanta
I fought with this forever, especially after 7.1 it became a real hassle. I feel your pain. But I think I've gotten it figured out at this point and happy to help. My use case is for my in-dash Nexus 7 tablet. I leave BT on, and anytime I get in my car it connects to my car stereo, and Tasker turns on my hotspot when it sees I connect to that BT device.

Start with the Tasker plugin "Nougat+ Tasker Tethering Control". This will show up in Tasker under plugins. First time you add it to a task, when you go to configuration you'll see a request to install it to system - do that and reboot.

Now go back to Tasker and and test run the task. If you get an error about "android.permission.TETHER_PRIVILEGED", then flash the attached module in Magisk and reboot. This should give Tasker Tether the permissions it needs to turn hotspot on/off. It worked perfectly for me.

Let me know if you have any issues and I'll help if at all possible. Also this assumes that you can turn on hotspot manually and it works.... this is not a way to get hotspot working if your carrier is blocking it, this just allows Tasker to automate the process.
 

Attachments

  • magisk-privapp-permissions-v1.3.zip
    5.7 KB · Views: 165

Kéno40

Senior Member
Nov 1, 2010
2,288
572
Cool, I'll try to use it for Mi Fit app that seems to be kicked by Oreo. But right now, ADB seems broken on my device.
If someone kind enought could help me for the list of autorisation to give, I'd be very gratefull !
 

yochananmarqos

Recognized Contributor
Cool, I'll try to use it for Mi Fit app that seems to be kicked by Oreo. But right now, ADB seems broken on my device.
If someone kind enought could help me for the list of autorisation to give, I'd be very gratefull !
How would Mi Fit benefit from being a system app? I used it with my Mi Band 2 (before I lost it) on Oreo with no issues.

Sent from my LG G5 using XDA Labs
 
  • Like
Reactions: Kéno40

Kéno40

Senior Member
Nov 1, 2010
2,288
572
How would Mi Fit benefit from being a system app? I used it with my Mi Band 2 (before I lost it) on Oreo with no issues.
Sent from my LG G5 using XDA Labs
I suspect that doze "hibernate" MiFit while my watch is to far from my Phone. I've tried some things but still the same. I thought that systemize it would help.
If your experience is verified, it lets me 2 options :
- It's software, but rom related
- it's my watch...
 

Top Liked Posts

  • There are no posts matching your filters.
  • 25
    **** This module is now obsolete as privapp permissions are now granted automatically when systemizing apps with Terminal App Systemizer. Please use that from now on. ****

    In Android 8.0 Oreo, permissions are not automatically granted to system privileged apps. This is automatically done by apps where the root method allows system modifications, but with systemless root that has to be done in a different way.

    Therefore, apps systemized into /system/priv-app using App Systemizer or Terminal App Systemizer will not be granted some permissions. All privileged apps must be whitelisted in system configuration files in the /etc/permissions directory.

    Entries can either be appended to /etc/permissions/privapp-permissions-platform.xml or separate files can be created for each package; i.e., /etc/permissions/privapp-permisisons-com.package.name.xml. The latter is easier and more modular (pun intended :laugh: ).

    This module is more of a template. I've included XML files for BetterBatteryStats, Cerberus, F-Droid Privileged Extension, Greenify and Wakelock Detector Free. Before flashing it, you will want to add or remove XML files according to your needs.

    Example XML file:

    /etc/permissions/privapp-permisisons-com.package.name.xml
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <permissions>
      <privapp-permissions package="com.package.name">
    	<permission name="android.permission.WRITE_A_SETTING" />
    	<permission name="android.permission.WRITE_ANOTHER_SETTING" />
      </privapp-permissions>
    </permissions>

    In order to determine what permissions are missing from your systemized app, you can compare the requested permissions and install permissions by running:

    Code:
    adb shell dumpsys package com.package.name

    However, not every permission missing from the install permissions section needs to be granted in this manner. If you're not sure, contact the app developer for clarification.

    A better version of this module would generate the permissions configuration XML file without having to get your hands dirty. However, that would require including aapt and I haven't figured out how to do it yet. Perhaps @stangri or @veez21 could help with that. :cool:

    Download:
    Module removed, please use Terminal App Systemizer
    4
    Would you believe I didn't notice BetterBatteryStats was missing permissions? :silly: I thought it was no longer necessary as the How-to & FAQ in the main BBS thread states it does not require the system app anymore.

    However, it turns out (at least on Oreo) it is still necessary. I noticed these required permissions are not being granted:

    android.permission.DUMP
    android.permission.READ_LOGS
    android.permission.DEVICE_POWER

    You can verify the permissions are granted (or not) by going to BBS Settings > Advanced > Install as system app.

    I updated the module to support the Play Store version and the XDA Edition. Download in the OP.

    @chamonix The above permissions will also need to be granted via adb for those running BBS on a non-rooted device.

    Thanks to @kd- for figuring this out :good:
    2
    I fought with this forever, especially after 7.1 it became a real hassle. I feel your pain. But I think I've gotten it figured out at this point and happy to help. My use case is for my in-dash Nexus 7 tablet. I leave BT on, and anytime I get in my car it connects to my car stereo, and Tasker turns on my hotspot when it sees I connect to that BT device.

    Start with the Tasker plugin "Nougat+ Tasker Tethering Control". This will show up in Tasker under plugins. First time you add it to a task, when you go to configuration you'll see a request to install it to system - do that and reboot.

    Now go back to Tasker and and test run the task. If you get an error about "android.permission.TETHER_PRIVILEGED", then flash the attached module in Magisk and reboot. This should give Tasker Tether the permissions it needs to turn hotspot on/off. It worked perfectly for me.

    Let me know if you have any issues and I'll help if at all possible. Also this assumes that you can turn on hotspot manually and it works.... this is not a way to get hotspot working if your carrier is blocking it, this just allows Tasker to automate the process.
    2
    Dis you have the new one with the new template? 15.3?

    Hello guys. First, sorry for my english.. I'm learning...
    My real objetive is give to Cerberus app all functionalities that the root can give.
    I read that it would be necessary to install the "Terminal" and "App systemizer", and from what I understand, I need to grant permissions to them, following this topic. Was that right? How do I give permissions to the App systemizer ??? Or am I wrong and do not need it?
    (My device is a Xiaomi Mi A1 running Oreo)
    Thank you very much!

    This module is now obsolete as privapp permissions are now granted automatically when systemizing apps with Terminal App Systemizer. Please use that from now on.
    1
    Cool, I'll try to use it for Mi Fit app that seems to be kicked by Oreo. But right now, ADB seems broken on my device.
    If someone kind enought could help me for the list of autorisation to give, I'd be very gratefull !
    How would Mi Fit benefit from being a system app? I used it with my Mi Band 2 (before I lost it) on Oreo with no issues.

    Sent from my LG G5 using XDA Labs