Hi!
The QA team in my company regularly used Stetho in internal dogfood builds distributed through the play store. But we have tried to replicate the setup with Flipper and we weren't able: the library would work fine, but the desktop app would refuse to communicate with an app not in debuggable mode.
04-28 11:10:38.763 17157 17292 I flipper : flipper: Desktop failed to provide certificates. Error from flipper desktop:
04-28 11:10:38.763 17157 17292 I flipper : Android app com.myapp is not debuggable. To use it with Flipper, add android:debuggable="true" to the application section of AndroidManifest.xml
By being distributed internally through the play store, we cannot use debuggable builds. Is there any way that check could be disabled so that we can run Flipper for our internal dogfood release builds?
Thanks!
Hey Nacho!
We do not support Flipper in any form of non-debug builds. We do not support Flipper in any non-debug builds and see this as a pretty immovable line on our end. What I don't know of the top of my head is what we use the debuggable flag for. I think this could be the run-as command, but I could be wrong here. I'll ask someone.
Hi @mrmans0n,
passy is right, it's a requirement for the adb run-as command which we use to secure the connection. This prevents other apps or websites from being able to connect to your app.
If you don't want to root, an option would be to manage your own server and client certificates, instead of letting flipper manage them for you automatically. Right now flipper desktop creates self-signed certs in ~/.flipper/certs, and it also writes a client cert into files/sonar within the mobile apps data partition.
If you deployed the contents of those files to desktops before flipper runs, and also into your mobile app (it could write them on startup before starting the flipper client) then that would work, but bear in mind that anyone in possession of the app files (~/.flipper/certs) will be able to connect to your app.
There's one more option, if you can test on rooted devices or emulators. It should be possible to make Flipper work even on non-debuggable apps, because we could use su instead of run-as, like was done for non-application use cases in f4b0898de540c95457abe783f03e866c5d846468 but this would require some more involved changes in the desktop app code.
Thanks a lot for your answers, Pascal and John!
If we were to do something with the certificates, as @jknoxville suggested, would this bypass the "app is not debuggable" error, or would that also require desktop app changes?
Provided I'm not forgetting anything, it would just work and you wouldn't need to change any desktop code.
You could test this fairly easily by doing the following:
com.facebook.flipper.sample with your apps package):./scripts/debugging/android_sonar_dir.sh ls com.facebook.flipper.sample will list the files you need. Do this while the app is successfully connected to flipper to ensure you're copying a working set of files../scripts/debugging/android_sonar_dir.sh pull com.facebook.flipper.sample app.csr app.csr will pull a single file. Do this for each file listed by the previous command.files/sonar/ before it starts the flipper client, then it should bypass the certificate exchange (and thus bypass the need to be debuggable) and connect straight to your desktop app.Things you need to know:
~/.flipper/certs/) will all need to accept that client, so you'll have to take care of securely deploying them to your testers computers, rather than letting flipper generate them itself.Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
Most helpful comment
Provided I'm not forgetting anything, it would just work and you wouldn't need to change any desktop code.
You could test this fairly easily by doing the following:
com.facebook.flipper.samplewith your apps package):./scripts/debugging/android_sonar_dir.sh ls com.facebook.flipper.samplewill list the files you need. Do this while the app is successfully connected to flipper to ensure you're copying a working set of files../scripts/debugging/android_sonar_dir.sh pull com.facebook.flipper.sample app.csr app.csrwill pull a single file. Do this for each file listed by the previous command.files/sonar/before it starts the flipper client, then it should bypass the certificate exchange (and thus bypass the need to be debuggable) and connect straight to your desktop app.Things you need to know:
~/.flipper/certs/) will all need to accept that client, so you'll have to take care of securely deploying them to your testers computers, rather than letting flipper generate them itself.