From eb3b2883372e9cbb76d29205c10fb968b44d5628 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 2 Oct 2024 15:14:10 +0000 Subject: [PATCH] android readme: extend "access datadir on Android from desktop" - add commands to restrict unix permissions for pushed files - add notes for "multiple user profiles" case --- contrib/android/Readme.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/contrib/android/Readme.md b/contrib/android/Readme.md index ac5e2ce1b..9db10b312 100644 --- a/contrib/android/Readme.md +++ b/contrib/android/Readme.md @@ -145,11 +145,26 @@ $ adb push ~/wspace/tmp/my_wallet /data/local/tmp $ adb shell adb$ ls -la /data/local/tmp adb$ run-as org.electrum.testnet.electrum cp /data/local/tmp/my_wallet /data/data/org.electrum.testnet.electrum/files/data/testnet/wallets/ +adb$ run-as org.electrum.testnet.electrum chmod -R 700 /data/data/org.electrum.testnet.electrum/files/data/testnet/wallets +adb$ run-as org.electrum.testnet.electrum chmod -R u-x,u+X /data/data/org.electrum.testnet.electrum/files/data/testnet/wallets adb$ rm /data/local/tmp/my_wallet ``` Or use Android Studio: "Device File Explorer", which can download/upload data directly from device (via adb). +#### Device with multiple user profiles + +There are further complications if using an Android device +[with multiple user profiles](https://source.android.com/docs/devices/admin/multi-user-testing) +(typical for GrapheneOS/etc). + +Run `$ adb shell pm list users` to get a list of all existing users, and take note of the user ids. + +Instead of `/data/data/{app.path}`, private app data is stored at `/data/user/{userId}/{app.path}`. + +Further, instead of `adb$ run-as org.electrum.electrum`, +you need `adb$ run-as org.electrum.electrum --user {userId}`. + ### How to investigate diff between binaries if reproducibility fails? ``` cd dist/