Skip to content

Instantly share code, notes, and snippets.

View chinalwb's full-sized avatar
:octocat:

Wenbin Liu chinalwb

:octocat:
View GitHub Profile
@Andrew0000
Andrew0000 / ComposeShadow.kt
Last active November 16, 2024 23:22
Jetpack Compose custom shadow with dx, dy and radius
import android.graphics.BlurMaskFilter
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.requiredSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
@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))
}
@williamdes
williamdes / androidcertificate_fingerprint.java
Created June 27, 2017 13:24
Get a fingerprint (String SHA-256) from a android.content.pm.Signature Object
/**
* Get fingerprint from a certificate in android.content.pm.Signature
* @return String fingerprint that contains the SHA-256 digest
*/
private static String getFingerprint(android.content.pm.Signature ce){
String certificate = "";
InputStream input = new ByteArrayInputStream(ce.toByteArray());
CertificateFactory cf = null;
try {
@smoll
smoll / USING-DIFFMERGE.md
Last active March 28, 2025 01:01
Using DiffMerge as your git mergetool (for Mac OS X / macOS)
@alphamu
alphamu / TextDrawable.java
Last active May 7, 2023 16:24
An TextDrawable that can be used to draw a String. This can be used anywhere you would normally use a drawable. You can watch the demo video here: https://youtu.be/l1HgpcJhIi0
/**
* Copyright 2016 Ali Muzaffar
* <p/>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
@isaldin
isaldin / git-hist
Created November 16, 2015 11:55
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"