Android

From HyperSecurity Wiki
Jump to: navigation, search

SDK Setup

http://xmodulo.com/how-to-run-android-emulator-on-ubuntu-or-debian.html

CID

CID would appear to stand for 'Country ID' - but LTE users have found flashing a different number CID firmware (than their original) broke network support. More here.
CID6 = XT1031 - CDMA (Republic Wireless US)
CID7 = XT1032 - European Global GSM (Single-SIM) or XT1033 - Retail Asia (Dual-SIM) 
CID9 = XT1031 - CDMA (Boost US) or XT1032 - Retail US Global GSM or XT1034 - Retail US AWS
CID12 = XT1032 - Latin America / Brazil Global GSM (Single-SIM) or XT1033 - Latin America / Brazil Global GSM (Dual-SIM) 
CID14 = XT1034 - Retail Canada AWS or XT1034 - Bell Canada AWS

IMEI

IMEI=$(cat /proc/config/imei/ascii)
echo 'AT+EGMR=1,14,'"$IMEI" > /dev/pttycmd1

Commands

List all files:

ls -lRa

Remount file system as read/write:

mount -o remount,rw /system

Symbolic Link:

ln -sf /system/efs

Change modes:

chmod 0555 filename

Busybox:

/system/xbin/busybox

Diag Mode:

setprop sys.usb.config diag,adb


Find all mount points:

cd /dev/block/platform/msm_sdcc.1/by-name/
ls -las



Back up of the whole memory block (via adb)

Source: http://forum.xda-developers.com/showthread.php?t=1818321

Connect the phone in ADB mode and unlock the screen. Open one Cygwin Terminal and enter (replace mmcblk0 if needed): Code:

adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0

You will see the cursor blinking at the left. Now the phone is waiting to send the block over the network.

Open another Cygwin terminal and type: Code:

adb forward tcp:5555 tcp:5555
cd /path/to/store/the/backup
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw

You will see how the image size is growing until it finishes. Now you have the whole phone backed up in raw format. You can see the contents of the GPT partition with gptfdisk tool, available for windows, linux and such. See official website and sourceforge to get it. You can do it the same from ClockWorkMod Recovery but you have to mount first the /system partition since the busybox included with clockworkmod does not come with netcat and you have to use the one from the system partition. With further linux tools you could edit or extract single partitions from the whole block.

Engineer Code for Moto G

*#*#4636#*#* Display information about Phone, Battery and Usage statistics
*#*#7780#*#* Resetting your phone to factory state-Only deletes application data and applications
*2767*3855# It's a complete wiping of your mobile also it reinstalls the phones firmware
*#*#34971539#*#* Shows completes information about the camera
*#*#7594#*#* Changing the power button behavior-Enables direct poweroff once the code enabled
*#*#273283*255*663282*#*#* For a quick backup to all your media files
*#*#197328640#*#* Enabling test mode for service activity
*#*#232339#*#* OR *#*#526#*#* Wireless Lan Tests
*#*#232338#*#* Displays Wi-Fi Mac-address
*#*#1472365#*#* For a quick GPS test
*#*#1575#*#* A Different type GPS test
*#*#0283#*#* Packet Loopback test
*#*#0*#*#* LCD display test
*#*#0673#*#* OR *#*#0289#*#* Audio test
*#*#0842#*#* Vibration and Backlight test
*#*#2663#*#* Displays touch-screen version
*#*#2664#*#* Touch-Screen test
*#*#0588#*#* Proximity sensor test
*#*#3264#*#* Ram version
*#*#232331#*#* Bluetooth test
*#*#7262626#*#* Field test
*#*#232337#*#* Displays bluetooth device address
*#*#8255#*#* For Google Talk service monitoring
*#*#4986*2650468#*#* PDA, Phone, Hardware, RF Call Date firmware info
*#*#1234#*#* PDA and Phone firmware info
*#*#1111#*#* FTA Software version
*#*#2222#*#* FTA Hardware verion
*#*#44336#*#* Displays Build time and change list number

Useful Motorola Moto G Secret Codes

Phone Testing Secret Code:

*#*#4636#*#*

Find IMEI Number:

*#06#

Moto G Hard Reset:

*#*#786#*#*

Open Superuser App:

*#*#1234#*#* or *#*#7873778#*#*

Manual Check Update:

*#*#2432546#*#*

Motorola Service Menu:

*#*#2486#*#*