flipper: Flipper doesn't work with apps originally installed on the system partition

🐛 Bug Report

@passy I set up Flipper in our app. It worked on a (non-64 bit) emulator but when I run in on our kiosk-like hardware, Flipper shows a bar that says: Client setup error: No matching device for app: PACKAGE_NAME image

Flipper can see it for its generic features like logs and CPU info. However, it doesn’t connect to the FlipperClient.

EDIT I did some debugging and found that the run-as command here is failing with PACKAGE_NAME is not an application. I tracked that down to here which is the case when the app is a system application. In our case, I have installed a debuggable version of the app over the one on the system partition and that is the setup that 100% of people here will be using when working.

To Reproduce

You can push an APK to the system partition by booting an AVD with -writeable-system (StackOverflow link). Then push your own apk to the system partition and optionally install it again in the user partition.

Expected Behavior

Flipper connects to the FlipperClient.

Environment

Our Kiosk-like hardware runs Marshmallow.

Thanks for working on Flipper. It looks really awesome and we have some ideas for useful plugins that we can build already.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 18
  • Comments: 18 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Please leave this open. It is still an issue.

This still requires attention.

We have the same issue with React Native 0.62.0 and Flipper 0.35.0.

Our company devices are managed by Kaspersky Endpoint Security which checks the app and does something with it (but apparently not copying it to /system/app). That results in two app versions: the normal one and the managed/secure one.

Flipper can connect to the normal app but not to the managed one with the same error message as @gpeal has.

Is there some workaround for this issue or maybe pointers where I could investigate more?

Thanks!

@jknoxville Our app also has android:sharedUserId="android.uid.system". That may be the difference here.

Thanks for the report @gpeal

I’ve played a little with a system app to investigate this, and have got it working with a file permission change that I’ll ship asap.

However I didn’t run into this run-as problem you mention, so I expect it won’t fix your issue. In my tests, I had no problem executing run-as as the system app.

I tried first installing a user app and then moving it into /system/app and rebooting. I also tried placing an apk directly into /system/app on a fresh AVD. Both tests using marshmallow.

Could it be due to a variation in the OS running on your hardware? I was using an emulator for this so it might be more permissive. Or perhaps I’m not installing the app as a system app correctly?

As for the run-as problem, I expect we can execute the shell as root using su, instead of the app, to get around it. Something like this - but note that that isn’t tested at all because I haven’t reproduced the issue.