"Original" Android device, how to root, execute adb shell, view the database information in the device, etc.

Source: Internet
Author: User
Tags file copy

(i) First step: root

Use Baidu one key root and other apps, a key can be root, step slightly

Two

1. Implementation

adb Shell su Get root Permission ls view current directory

CD data/datals

Selected Com.tencent.cm as an example

CD com.tencent.cm/databasels

See there are some. db database files

This time, the execution

Sqlite3 tes_db.db

If you have sqlite3 in your device, this sentence should be successful, then you can execute the SELECT statement,

There's no need to look at----------------------------------------------------------------below-------------------------------------------------- ------------

This article mainly describes some millet and other mobile phones without sqlite3, and like me, execution will find

Sqlite3:not found

Sqlite3 version corresponding to each version of Android:

Sqlite3.8.4.3: +-5.0-Lollipop --Android L Developer Preview
SQLite3.7. One: +-4.4-KitKat --4.3-Jelly Bean --4.2-Jelly Bean --4.1-Jelly Bean
SQLite3.7.4: the-4.0.3-Ice Cream Sandwich --4.0-Ice Cream Sandwich --3.2-Honeycomb A-3.1-Honeycomb One-3.0-Honeycomb
SQLite3.6. A:Ten-2.3.3-Gingerbread9-2.3.1-Gingerbread8-2.2-Froyo
SQLite3.5.9:7-2.1-Eclair4-1.6-Donut3-1.5-Cupcake
Note:android SDK level links show where the Android.database.sqlite package has changed. Where There is no link (e.g. SDK level -), indicates no changes to the.
Note:here is some anomalies (list by no means exhaustive): SQLite3.7. -(instead of3.7. One): LG Optimus L70 MS323 LGMS323| Kot49i. MS32310B ( +-4.4-KitKat) LG Optimus G E975 LG-e975| JZO54K ( --4.1-Jelly Bean) LG G2 D802 LG-d802| jdq39b ( --4.2-Jelly Bean)
SQLite3.7.6.3(instead of3.6. A): LG Optimus Sol E730/mytouch E739/mytouch Q C800 (Ten-2.3.3-Gingerbread, GRJ22) LG Optimus Vu f100s/f100l (Ten-2.3.3-Gingerbread, rk39f) LG Optimus LTE TAG f120k/F120L (Ten-2.3.3-Gingerbread, grk39f) LG Optimus LTE L-01D (Ten-2.3.3-Gingerbread, GRJ90) LG Optimus Net p690b (Ten-2.3.3-Gingerbread, gingerbread) LG Prada KU5400 (Ten-2.3.3-Gingerbread, GWK74) LG Prada P940 (Ten-2.3.3-Gingerbread, GWK74) LG LU6200/su640 (Ten-2.3.3-Gingerbread, GRJ90) s
SQLite3.7.5(instead of3.7.4): Samsung Galaxy Note ( the-gt-n7000|iml74k. ZSLPF) Samsung Galaxy SII ( the-sc-02c| iml74k. OMMP4 and gt-i9100|iml74k. DXLP7) Samsung Galaxy S Duos ( the-gt-s7562|imm76i. S7562XXBMD6) Samsung Galaxy Tab7.7( the-gt-p6810|imm76d. ZSLP8)
SQLite3.7.0.1(instead of3.6. A): LG esteem MS910 (Ten-2.3.3-gingerbread, Gse-_v. to) Androtab (8-2.2-froyo,1.0.7100.0385) GPLUS Musn M500 (8-2.2-Froyo, frg83g)
SQLite3.6.23.1(instead of3.5.9): Motorola backflip MB300 (7-2.1-Eclair, ERD79) Garmin-asus Nüvifone A10/a50/garminfone (7-2.1-Eclair, ERE27) NOTE:ADB command to get SQLite version for works on emulators and on devices with Sqlite3 available:http://stackoverflow.com/a/3645800/444761

A relatively simple way to get the corresponding version of SQLite:

1, check the Andorid version of your phone, like mine is4.32, open the corresponding version in Eclipse (very important, otherwise you will be prompted cannotLocate 'sqlite3_enable_load_extensions') (create if not) and start3, under the File Explorer panel in the Ddms window, expand System >XBin See the Sqlite3? Ok. Click the floppy icon in the top right corner (pull afilefrom the device) to save it to a different location4, then connect your phone, open the console, and enter the ADB shell. What Prompted the ADB command to be invalid? Then go to configure the environment variables.)5, and then look at the prompt if it is # then don't worry, if it is $, then you need to get root permission to do the following6, keep the phone screen without the lock screen is best normal light mode at the prompt to typesuOrsuroot, select Yes if the phone's bullet box prompts for root permission. Click to find $ into #. OK, you can do the following7, sqlite3 the previous saved location in the DDMS panel via the phone icon in the upper right corner (push afileonto the device) push the file into SDcard, exactly in/mnt/SDcard8, and then typing at the command lineCat/mnt/sdcard/sqlite3 >/system/xbin/sqlite3 Copying Files (why not MV?) I tried, but failed on.'/sdcard/test.mp3'-cross-Device link error)9, OK, check the phone/system/xbin a sqlite3 file, but it can't be executed yet. Ten, Continue typingchmod 4755/system/xbin/sqlite3 good to be done. You can try typing sqlite3. You can see that it works. 

-------------------------------------------------------------If you succeed, Don't look underneath-------------------------------------------------------------------------

First, there is no AVD on the machine that corresponds to Android 4.3, so refer to the Http://www.cnblogs.com/localhost/archive/2012/04/09/2439558.html method

Downloaded the Sqlite3 file package, the address is http://files.cnblogs.com/localhost/sqlite3_not_found.rar (it turns out he has this package version, I can not use, he this version is too old)

Under this: http://pan.baidu.com/share/link?shareid=534077&uk=839950715

Reported an exception, because the direct push into the/system/xbin directory, no permissions

Create a temporary folder

Push into this temp folder

And then the sqlite3 from

/mnt/sdcard/tmp

Copy to

/system/xbin directory, no error

Cp

Note: This step may be reported in two kinds of errors,

The first type: CP not found, change command to Cat/mnt/sdcard/tmp/sqlite3 >/system/xbin/sqlite3,

The second type: Permission denied, stating that/system is read-only, it needs to be re-mount, read-write, and then continue copying

Why in addition to Sqlite3, but also push into the libncurse.so, because the lack of reliance on the library, reported the following exception

I have a second permission error, perform mount operation

Mount -o Remount,rw/system

The interpretation of the Mount command is in http://blog.csdn.net/progbelief/article/details/6032518

Focus on explaining the effect of this statement mount-o Remount,rw-t Yaffs2/dev/block/mtdblock6/system simply means to mount the block device "/dev/block/mtdblock6" to the/system directory,  Mount format for YAFFS2, here is the main problem is "/dev/block/mtdblock6" is what stuff. Mtdblock is the phone's flash storage device, but this block number varies depending on the model, such as: The Droid's/system is mounted on the/DEV/BLOCK/MTDBLOCK4, the European version of the milestone in/dev/block/ On the Mtdblock7, the/DEV/BLOCK/MTDBLOCK6 on the Hong Kong version, the HTC series of machines seems to be on the/DEV/BLOCK/MTDBLOCK3.  And now some of the tutorials are written on different commands, there are also such written       Mount-o Remount,rw/dev/block/mtdblock3/system This is mostly from the HTC forum copied it. But some people might say, I did it with this order! (Well, actually I am also ...) Khan, really good risk), even with any block number Mtdblock3, Mtdblock4, mtdblock11 and so can be normal operation! So why does this kind of error command succeed? In fact, our command parameter "-o remount" actually automatically ignored the/dev/block/mtdblock? This section of the argument, just a simple/system to re-mount a bit.  This order of lazy don't know how many people to save the love machine Ah!  Well, here you should understand, although this command even if the error can be successful, but after all, you try to put a wrong block on the/system, Qiao has accidentally changed bricks. Therefore, we strongly recommend that you use     CAT/PROC/MTD to check your JJ specific parameters when you execute this command, or to use the commands, or to strongly suggest that beginners use      mount-o remount,rw/system as a simplified command instead of the above command!

With the above explanation, get your device mount information, execute

Mount

From the mount data listed on the screen, find the Mount information of/system, separated by spaces, the first column represents the device name, the second column represents the directory, the third column represents the file system, and the fourth column represents the permissions. Other tutorials on the web This step directly lists their commands, because the device name and file system are not the same, so the execution is unsuccessful

The Mount command is: Mount-o remount,rw-t third column information The first column of information/system

For example, pay attention to the place where the circle is red:


After the mount succeeds, the file copy procedure above is executed, and then it can be copied to the/system/xbin directory.

Need to change the permissions of the file, command:

chmod 4755 /system/xbin/sqlite3

Last run, Sqlite3, find it.

---------------------------------------------------------------you've done it again, I don't have----------------------------------------------------------.

Executed mount, the result is as follows (no system Ah, but the top of the Mount-o Remount,rw/system executed successfully, so it doesn't matter):

The illegal instruction error occurred while executing the sqlite3 command

This probably shows that my sqlite3 version is wrong, a relatively new one: http://pan.baidu.com/share/link?shareid=534077&uk=839950715

Copy in, change permissions, execute

Success

when the ...> state of SQLite is not back, is generally entered into the SQL data language mode, at this time enter a (semicolon) to return to the sqlite> state.

. Quit Quit Sqlite.help View Help
. Schema grabs all tables in the database
. Tables capture all tables and indexes in the database ( you can use like to match )

Report:

SQLite's official website

Http://www.sqlite.org/lang.html

"Original" Android device, how to root, execute adb shell, view the database information in the device, etc.

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.