[Android] use the run-as command to read data under data without root

Source: Internet
Author: User

 

Preface

During this period of time, the skin swap function has encountered many problems and there are new problems after the solution. Here we will share with you that you want to achieve multi-APK Resource Sharing without using your userid, we recommend that you use your userid with caution. StatementWelcome to repost, but please keep the original source of the article :) blog Park: http://www.cnblogs.com farmer UNCLE: http://over140.cnblogs.com

Body

1. Key Steps

Mainly run-as command: over @ over-ThinkPad-R52 :~ $ Adb shell
$ Run-as com. package
$ Cd/data/com. package
$ Ls
Databases
Lib
$ Cd databases
$ Ls
Preferences. db
$ Cat preferences. db>/mnt/sdcard/preferences1.db

Code Description:

Note that to replace com. package with your complete package name, the key is the run-as command. Finally, use the cat command to copy the database to the SD card.

 

Ii. Supplement

The/data/package/lib directory shared by colleagues can be accessed directly. That is to say, although the/data directory cannot be read after the adb shell, the files under this directory can be accessed directly, the preceding run-as command shows that its permissions are different from those of other directories and are system permissions. This facilitates sharing so for multiple apk files, this is also the method used by Vitamio.

2012-6-14

If the android: debuggable = "false" is set with the signature specified, this command cannot be used.

2012-7-13

Thanks for sharing this article (see the comments). Do not run the adb shell and run-as command together, for example, adb shell run-as com. pack.

 

Iii. References
Use the mobile machine to run adb to access data resources on android [blogspot]
Why do I get access denied to data folder when using adb?

 

End

For more information about shared data, see/data/package/files. Use the second parameter of openFileOutput to specify the access permission. There is always one-sidedness in things. This article encourages you to peat apk and share the methods with you. It is also a kind of hacker spirit that I can't manage as to what you use to do, remind everyone not to store important data in plain text when developing applications.

Related Article

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.