Android Notes

Few commands which are useful while assessing android application.

Android Debug Bridge

$ adb devices

$ adb shell

$ adb shell <Command>

$ adb push /path/to/local/file /path/on/android/device

$ adb pull /path/on/android/device /path/to/local/file

$ adb forward tcp:<Local_Port> tcp:<Device_Port>

$ adb logcat


Commands runs inside device $hell

[email protected]:/ $ pm list packages

[email protected]:/ $ pm path <Package_Name>

[email protected]:/ $ pm install /path/to/apk

[email protected]:/ $ pm uninstall <Package_Name>

[email protected]:/ $ pm disable <Package_Name>

[email protected]:/ $ logcat

[email protected]:/ $ logcat -s <tag>

[email protected]:/ $ getprop

[email protected]:/ $ dumpsys

[email protected]:/ $ service list


Miscellaneous

keytool -genkey -v -keystore mykey. keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore mykey. keystore application. apk alias_name

$ openssl pkcs7 -inform DER -in CERT. RSA -text -print_certs

$ keytool -printcert -file CERT. RSA

Unzip <Application_Name>.apk java -jar AXMLPrinter2.jar AndroidManifest.xml

oatdump <Application_Name>.apk

oat2dex <Application_Name>.apk


Written by avicoder on 30 March 2016