FORUMS
Remove All Ads from XDA

[MODULE] Privileged Permission Whitelist (Oreo)

3,283 posts
Thanks Meter: 2,405
 
Post Reply Email Thread
**** 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 ).

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.

Download:
Module removed, please use Terminal App Systemizer
The Following 24 Users Say Thank You to yochananmarqos For This Useful Post: [ View ] Gift yochananmarqos Ad-Free
 
 
9th September 2017, 11:55 PM |#2  
yochananmarqos's Avatar
OP Recognized Contributor
Thanks Meter: 2,405
 
Donate to Me
More
RESERVED
26th September 2017, 05:42 PM |#3  
Senior Member
Thanks Meter: 106
 
More
Quote:
Originally Posted by yochananmarqos

In [URL="https://source.android.com/devices/tech/config/perms-whitelist"]

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

Code:
adb shell dumpsys package com.package.name

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
27th September 2017, 01:46 AM |#4  
yochananmarqos's Avatar
OP Recognized Contributor
Thanks Meter: 2,405
 
Donate to Me
More
Quote:
Originally Posted by resarfekim

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?
28th September 2017, 05:50 PM |#5  
Member
Thanks Meter: 8
 
Donate to Me
More
Maybe make a companion app that helps with this? Not sure how one would do that though.
29th October 2017, 12:56 AM |#6  
yochananmarqos's Avatar
OP Recognized Contributor
Thanks Meter: 2,405
 
Donate to Me
More
Would you believe I didn't notice BetterBatteryStats was missing permissions? 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
The Following 4 Users Say Thank You to yochananmarqos For This Useful Post: [ View ] Gift yochananmarqos Ad-Free
31st October 2017, 01:20 PM |#7  
chamonix's Avatar
Recognized Contributor
Berlin
Thanks Meter: 18,958
 
10101010
More
Quote:
Originally Posted by yochananmarqos

Would you believe I didn't notice BetterBatteryStats was missing permissions? 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

what version are you using and are there features not working when these perms are missing?
1st November 2017, 01:07 AM |#8  
yochananmarqos's Avatar
OP Recognized Contributor
Thanks Meter: 2,405
 
Donate to Me
More
Quote:
Originally Posted by chamonix

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.
7th November 2017, 05:49 PM |#9  
Senior Member
Flag Atlanta
Thanks Meter: 9
 
More
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.
7th November 2017, 06:23 PM |#10  
yochananmarqos's Avatar
OP Recognized Contributor
Thanks Meter: 2,405
 
Donate to Me
More
Quote:
Originally Posted by robbieas

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
7th November 2017, 11:25 PM |#11  
Senior Member
Flag Atlanta
Thanks Meter: 9
 
More
Quote:
Originally Posted by yochananmarqos

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!
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread