Android RootTools framework is easy to use

Android RootTools framework is easy to use

Android Directory Structure

data

  • app: User-installed applications
  • data: application-specific folder
  • system: system configuration information, registry file
  • anr: anr abnormal record information

dev:devices abbreviation

  • Store files corresponding to the device

mnt: abbreviation of mount

  • Devices mounted on the system: sdcard, USB flash drive

proc: hardware configuration, status information

  • cpuinfo、meminfo

sbin: system bin

  • System-important binary executable files
  • adbd: server's adb process

system:

  • app: stores system applications, which cannot be deleted by default
  • bin: executable linux command file in Android
  • etc: host: mapping of host name and IP address
  • fonts: Android's own fonts
  • Framework: stores the Java API provided by Google
  • lib: class library of core functions, C/C++ files
  • media/audio: stores Android sound effect files
  • tts: speech engine, does not support Chinese by default
  • usr: configuration information of user equipment, mapping of keyboard encoding and key encoding
  • xbin: binary instructions for developers

Linux instructions under Android

su:superuser

  • Switch to superuser

rm: remove, delete files

  • rm filename

ls: List all files and folders in a directory cd: Switch to a directory

  • ls -l: View detailed information of a file
  • ls -a: View hidden files

cat: View file contents

  • cat filename
  • Do not cat binary executable files

mv: move changes the file name

  • mv original file name new file name

mkdir: create a folder

  • mkdir folder name

rmdir: delete a folder

  • rmdir folder name

touch: create a new file

  • touch filename

chmod: change mode, switch file access permissions

  • chmod 777 filename

echo: echo data; redirect data sleep: sleep for a few seconds

  • echo data> filename

df: Display the capacity of the specified directory

id: print the id of the current user ps: list all processes running in the system

  • uid=0:root
  • uid=1000:system
  • uid=2000:shell
  • uid=10000+: general application ID

kill: kill the process with the specified pid

  • kill pid

chown: change owner, modify the owner

  • chown 0.0 filename

mount: mount the file system

  • mount -o remount rw /: Mount the current directory with read and write permissions
  • mount -o remount rw /system: Remount the specified directory

Android-specific instructions

am: ActivityManager, which can perform operations related to activity

  • am start -n com.itheima.createfile/com.itheima.createfile.MainActivity: Start the specified Activity
  • am kill com.itheima.createfile: end the non-foreground process
  • am force-stop com.itheima.createfile: end the process

pm:PackageManagermonkey -p com.itheima.createfile 1000: Automatically click the specified application 1000 times

  • pm disable package name: freeze the specified application
  • pm enable package name: unfreeze the specified application

Flash the emulator, write rom files (su)

  • If you want a real phone to run these commands, the phone must have root permissions
  • Root flashing principle: copy the su binary file to /system/bin or /system/xbin
  • Android rooting software works by exploiting system vulnerabilities.
  • rom: can be understood as the installation file of the Android system
  • Write the su file and superuser.apk into the img file
  • Execute the su command

Runtime.getRuntime().exec("su");

Small case: freeze and thaw application

Freeze and unfreeze specified apps

  1. RootTools.sendShell( "pm disable " + package, 300000); RootTools.sendShell( "pm enable " + package, 300000);

Small case: Reading user privacy data with zero permissions

Directly modify the SMS database access permissions

  1. RootTools.sendShell( "chmod 777 data/data/com.android.providers.telephony/databases/mmssms.db" , 300000);
  2. SQLiteDatabase db = SQLiteDatabase.openDatabase( "data/data/com.android.providers.telephony/databases/mmssms.db" , null , SQLiteDatabase.OPEN_READONLY);
  3. Cursor   cursor = db.query( "sms" , new String[]{ "body" , "address" }, null , null , null , null , null );
  4. while( cursor .moveToNext()){ String body = cursor .getString(0);
  5. String address = cursor .getString(1); System. out .println(body + ";" + address); }
  6. RootTools.sendShell( "chmod 660 data/data/com.android.providers.telephony/databases/mmssms.db" , 300000);

Silent installation

Why is there a need for silent installation? Automatically download the application and then install it silently

  1. Official application. Electronic market, convenient for users to install silently
  2. Rogue software. Downloaded and installed secretly in the background.

  1. //Silent installation RootTools.sendShell( "pm install sdcard/flowstat.apk" , 30000);
  2. //Open RootTools.sendShell( "am start -n com.jijian.flowstat/com.jijian.flowstat.TrafficWidgetSetting" , 30000);
  3. //Uninstall application RootTools.sendShell( "pm uninstall com.jijian.flowstat" , 30000);
  4. //Delete the downloaded apk package RootTools.sendShell( "rm sdcard/flowstat.apk" , 30000);

Modify font

  • Brush the ttf file into img
  • The default Chinese font for Android system is DroidSansFallBack.ttf
  • Replace this file with the font ttf file you want to use.

Modify boot animation

  1. Get bootanimation.zip from the real machine
  2. Put bootanimation.zip into the system/media directory

Remove lock screen password

Delete the key file under data/system

  • The text password is password.key
  • The gesture password is gesture.key

<<:  JD X Robotics Challenge Concludes, BUPT Team's Intelligent Robot Wins the Championship

>>:  What processes does an APP go through from startup to main page display?

Recommend

Charging and battery swapping modes: who is reliable and who is cheating?

Even though it has suffered the double blow of th...

You may not think that these symptoms are related to lack of sleep →

Many people know that "you will yawn if you ...

Not everyone is suitable for new media operations

I believe that people who are active on the Inter...

Sago is not rice, it’s “coconut”!

How can we miss the icy cold desserts in the hot ...

South Korea plans to put self-driving cars on the road by 2020, ahead of Japan

According to Forbes, China has already tested sel...

How does Kuaishou Games do brand marketing?

As a top national mobile game, the total number o...

National Nutrition Week | These good dietary habits will help you eat healthily

May 15th to 21st is National Nutrition Week. How ...

Ctrip Air Ticket App KMM iOS Engineering Configuration Practice

About the Author Derek, senior R&D manager at...