Android4.4 changes to sdcard permissions and compatibility issues

Source: Internet
Author: User

In the course of upgrading 4.4, we discovered that some third-party applications were not available. Check out the following requirements:


1 "API 19 or higher now requires Android.permission.READ_EXTERNAL_STORAGE and Android.permission.WRITE_EXTERNAL_STORAGE permissions.


2 "If you find that you can still read the contents of SDcard without permission on the real machine. Check to see if the phone is root.


The reasons are as follows:

This problem can be seen/storage/emulated/0 on NEXUS5 with root, but I

They can't see them on their phones. This is because we get root permission on NEXUS5, which can be obtained by Super Su,

And on our phone is directly able to adb root (because we are on the Userdebug version). Let's see.

To the additional/storage/emulated/0 node is the Supersu Daemonsu program mount out.


If we put the user version of our phone in prison, under Su, the result is exactly the same as N5.


To verify, we killed the Supersu daemon on the N5 (Killall daemonsu) and then re-used

Strace follow:


Strace-s 200-f/system/xbin/daemonsu--auto-daemon


When performing ADB Shell->su->mount in another terminal, you can still see

/storage/emulated/0, and then look at the output of Strace, which performs the/storage/emulated/0

Mount operation. The output of the strace is shown in the attachment.


Another very interesting point, using Su's shell, with PS $$ to see the process, will find its

The parent process is daemonsu.


3 Note: When the android:minsdkversion and android:targetsdkversion defined in your manifest are 3 or below, this permission is in the API (Android 4.4.2) on the machine will force you to attach this read-write SDcard permission, if you are sure that your application does not need to read and write SDcard permissions, you need to declare targetsdkversion greater than or equal to 4 ....



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.