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

shell@android:/ $ pm list packages

shell@android:/ $ pm path <Package_Name>

shell@android:/ $ pm install /path/to/apk

shell@android:/ $ pm uninstall <Package_Name>

shell@android:/ $ pm disable <Package_Name>

shell@android:/ $ logcat

shell@android:/ $ logcat -s <tag>

shell@android:/ $ getprop

shell@android:/ $ dumpsys

shell@android:/ $ 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
@avicoder