E Zygote : java.lang.IllegalStateException: Signature|privileged permissions not in privapp-permissions whitelist

whitelist

More dreaded whitelist errors! Essentially, an app is trying to do something it should not be allowed to do. You can see the logs here:

E Zygote : java.lang.IllegalStateException: Signature|privileged permissions not in privapp-permissions whitelist: {com.android.systemui: android.permission.NAVIGATION_EDITOR, org.omnirom.omnistyle: android.permission.CHANGE_OVERLAY_PACKAGES, com.android.systemui: android.permission.PACKAGE_USAGE_STATS, com.android.settings: android.permission.ACCESS_FONT_MANAGER, com.android.settings: android.permission.NAVIGATION_EDITOR, com.android.systemui: android.permission.FORCE_STOP_PACKAGES, com.android.launcher3: android.permission.STATUS_BAR}

The funny part is, these apps are system apps, built in Resurrection Remix itself. That means that these errors are caused by the people who put RR together. Most likely, since it draws from LineageOS at it’s base, changes were made to LineageOS, and RR has not caught on yet. Either way, this is an easy fix, but will become a recurring problem.

In this RR rom, go to:

/frameworks/base/data/etc/privapp-permissions-platform.xml

and open it up. If you search in this file for com.android.launcher3, you will find it listed there, with a few “whitelisted” or pre-approved, permissions.

<privapp-permissions package=”com.android.launcher3″>
<permission name=”android.permission.BIND_APPWIDGET”/>
<permission name=”android.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS”/>
<permission name=”android.permission.GET_ACCOUNTS_PRIVILEGED”/>
</privapp-permissions>

Notice that the error said that the launcher needs “android.permission.STATUS_BAR” and it’s not on the list. So, you need to add it to the list, like so:

<privapp-permissions package=”com.android.launcher3″>
<permission name=”android.permission.BIND_APPWIDGET”/>
<permission name=”android.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS”/>
<permission name=”android.permission.GET_ACCOUNTS_PRIVILEGED”/><permission name=”android.permission.STATUS_BAR”/>
</privapp-permissions>

Now you will have solved your problem. However, this might not be the best place to fix this. Another place that is more likely to be useful is in this file:

/vendor/rr/config/permissions/privapp-permissions-lineage.xml

Or to make a privapp-permissions-rr.xml file.

In either case, the only issue with doing it this way is that every time you sync the repo, you will need to solve this issue again, and again, and again. So, you could take two alternative routes:

  1. Make an overlay file in your device tree and overlay these permissions.
  2. Make a pull request on the RR repo to fix the actual issue.

The second method is the best, because this helps everyone. It also clears up problems with overlay files when the original file does get fixed later. Either way, this will solve your problem.

Linux – keep it simple.

Getting permission to program the Bluefruit Feather board in Ubuntu

bf_f_1st program

I am learning more every day by simply trying to play with my new toy: a Bluefruit Feather board! As I mentioned before, my brother got this little gadget for me as a Christmas present, and it has been a lot of fun to play with!

I was having a bit of trouble uploading my program to it, though, until I figured out my problem. Since this took me a while, I thought I would share it with you, so perhaps you can save a little bit of time on this issue.

TL,DR: Make sure you add your username to the dialout group, so you will have permission to use the ttyUSB0 interface.

I was attempting to upload a little program (the default beginner program, slightly tweaked to change the blink time) to the board. I had the drivers installed, I could hook to the board and pull the boards data, but I couldn’t upload the new program to it.

I kept getting an error that suggested I needed to put the device in DFU mode, but that didn’t turn out to help me. The issue was simply one of permission. My username did not have permission to use the ttyUSB0 interface. So, usermod myself into the dialout group, and after logging out and back in, I was good to go!

Here is the little program that I uploaded to the board:

void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(5000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

It just causes the red led to flash for 5 seconds, turn off for 1 second, and repeat endlessly. It worked great! But, that wasn’t cool enough…. So I looked over some examples and made it fade in and out with this code:

 

int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by

void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
analogWrite(LED_BUILTIN, brightness);

// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade:
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
// wait for 30 milliseconds to see the dimming effect
delay(30);
}

Now I have my own mini Cylon with a glowing, fading red eye saying, “By your command!” (Okay, so I may be having way too much fun with this….)

Linux – keep it simple.