Does a xamarin.android app have su permissions when deployed to a rooted device

661 views Asked by At

My HTC One (M8) phone is rooted and is running Android 6.0. The Root Check app verifies that the phone in rooted ok.

I have developed an Xamarin Android app in c# and the following permissions are included in the AndroidManifest.xml file

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_SUPERUSER" />

When I deploy my Xamarin Android App through Visual Studio 2017 several strange things happen which seem to be permission related...

  1. The app is re-installed each time - all files are removed and re-added
  2. Images saved to the external directory (sd card) via camera only have rw------ permissions
  3. Copying files in code from sd card to app local folder return empty file

So my question is does a xamarin.android app have su permissions when deployed to a rooted device?

1

There are 1 answers

0
Grace Feng On BEST ANSWER

ACCESS_SUPERUSER permission DEPRECATED since Android 5.0. Due to changes in Android 5.0 Lollipop, this permission has been deprecated and is completely ignored from SuperSU v2.30 onwards.

The app is re-installed each time - all files are removed and re-added

This issue may related to the location where your files are placed, for example, all files created in the data/data/your.app.package is deleted automatically upon install. And if you saved files that are app-private(by calling getExternalFilesDir()), when the user uninstalls your application, this directory and all its contents will be deleted. Please read the official document: Using the External Storage.

Images saved to the external directory (sd card) via camera only have rw------ permissions

Copying files in code from sd card to app local folder return empty file

It is possible that you only defined WRITE_EXTERNAL_STORAGE permission, if you want to read from external storage, please add the following permission too:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />