Skip to content

Instantly share code, notes, and snippets.

View chinalwb's full-sized avatar
:octocat:

Wenbin Liu chinalwb

:octocat:
View GitHub Profile
@chinalwb
chinalwb / ColorTextViewHandles.java
Created February 19, 2024 06:58 — forked from jaredrummler/ColorTextViewHandles.java
Set the color of the handles shown when you select text in a TextView on Android
// Tested on Android Nougat. Should work on previous versions of Android.
// It's ugly but should get the job done
/**
* Set the color of the handles when you select text in a
* {@link android.widget.EditText} or other view that extends {@link TextView}.
*
* @param view
* The {@link TextView} or a {@link View} that extends {@link TextView}.
* @param color
@chinalwb
chinalwb / git-hist
Created January 4, 2022 10:26 — forked from isaldin/git-hist
git hist alias
git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short"
@chinalwb
chinalwb / androidcertificate_fingerprint.java
Last active December 8, 2021 15:06 — forked from williamdes/androidcertificate_fingerprint.java
Android get App SHA256 fingerprint
/**
* Get SHA256 from PackageManager / PackageInfo / Signatures
*/
fun printSignature() {
val packageManager: PackageManager = CONTEXT.getPackageManager()
val signature: Array<Signature> = packageManager.getPackageInfo("YOUR PACKAGE_NAME, LIKE com.xx.yy.zz", PackageManager.GET_SIGNATURES).signatures
signature.asIterable().forEach {
Log.i("SHA256", getFingerprint(it))
}