Android - nimrody/knowledgebase GitHub Wiki
also see here
-
Screen shot
adb shell screencap -p > screen.png
- Clear package data
adb shell pm clear <package name>
- Get the Android Device ID:
shell@cancro:/ $ settings get secure android_id
50543e327b1d31f7
smali -o classes.dex frameworkSmaliDirectory
zip framework.jar classes.dex
adb shell mount -o rw,remount /system
adb push framework.jar /system/framework/
-
ART Quick Compiler Information about ART and AARCH64 (64 bit ARM port)
-
remount system as read/write
mount -o remount,rw /system
- Extract APK from device:
- Get the package name
pm list packages yala
- Get the package path
pm path <package-name>
- Pull the APK:
adb pull <package-path>
- Get the package name
-
Enable TLS 1.2 on Android 4.4 API 19 using Google Play Services
-
[Litho - programmatic layout (facebook)[http://fblitho.com/]
-
NetworkStatsManager
seems to be the new official api -
System services tags
https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/net/TrafficStats.java
acct_tag_hex is a socket tag
Lines with cnt_set==0 are for background data
Lines with cnt_set==1 are for foreground data
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name
If the APK is already signed you need to unzip it, remove the META_INF/ directory and its contents and zip the result to a new APK before signing it.
(If the APK has not been zip-aligned, it may be necessary to use zipalign
. Something like zipalign -v 4 yourapk.apk signedapk.apk
)
- Windows ADB (USB drivers not needed)
On windows go to
c://Users/{your-username}/.android
On Linux~/.android
open the file adb-usb.ini
on a text editor and add the lines from https://raw.githubusercontent.com/apkudo/adbusbini/master/adb_usb.ini
Save the file, open a CMD (or terminal) and type:
adb kill-server (enter)
adb start-server (enter)
reconnect the device, now it should be recognized.
- copy files from android device
run-as com.your.packagename cat databases/database.db > /sdcard/database.db