Android Access/data/app/under File method

Source: Internet
Author: User

All the people of the Earth know:
A)/data/app/directory itself to Su's access rights, so can not new File ("/data/app");
Maybe you don't know.Of
B)When the initial installation, the file is guaranteed to exist:Data/app + [package name].apkAfter overwriting the installation n times, the file name is:Data/app + [package name]-n.apk

Enter the/data/app/directory with ADB shell


Impressively found that even if the/data/app directory itself is inaccessible, but the directory of files actually have Read permission!. It is certain that there must be a way to access the files in this directory.
after one hours of Android source search, found the following methods:

[Java]View Plaincopy
  1. file = new file (Getpackagemanager (). Getapplicationinfo ("  Com.uc.addon.qrcodegenerator ", 0). SourceDir);

Here Getpackagemanager is the method under the context, do not need to be discussed, SourceDir returned the full apk path, including the nasty things like-N.
and direct access to the file under this path, there is no permission problem.
Reprint: http://blog.csdn.net/zys871228/article/details/12746831

Android Access/data/app/under File method

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.