1

readlink returns EACCES while trying to follow symbolic links present in the proc file system. This behaviour is observed only on Android applications built in release mode. The same isn't observed when the application is built in debug mode.

Additional Info:

  • The call is made from native code.
  • I have granted "android.permission.WRITE_EXTERNAL_STORAGE" to the application in AndroidManifest.xml.
  • The application is built with minSdkVersion=14 and targetSdkVersion=26
  • Behaviour is observed on all Android versions from Kitkat to Nougat.

Why does readlink exhibit this behaviour when the application is built in release mode? Are there any alternatives for readlink to trace symbolic links in /proc?

Thanks in advance.

  • are you requesting user to grant runtime permission(WRITE_EXTERNAL_STORAGE)? Can you check your app settings(for release app) if storage access permission is granted? – Amit Aug 09 '17 at 04:04
  • Yes, the permissions have been granted. I was able to verify this by printing the permissions that the application has as well as through GUI. – Kushal Ramkumar Aug 10 '17 at 07:53
  • Is magisk installed – Smart Manoj Jul 06 '19 at 08:51

1 Answers1

0

Sounds like it may be runtime permissions when in release mode.

Check out the answer on this SO question: https://stackoverflow.com/a/33031091/3645949

Shazbot
  • 1,444
  • 1
  • 11
  • 21