Last active
January 5, 2019 09:38
-
-
Save LouisShark/67683aae31a650eb0227b3ab13b83ec3 to your computer and use it in GitHub Desktop.
获取锁屏加密时和密码一起加密的salt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void getSalt() { | |
try { | |
Class<?> clazz = Class.forName("com.android.internal.widget.LockPatternUtils"); | |
Object lockUtils = clazz.getConstructor(Context.class).newInstance(this); | |
Class<?> lockUtilsClazz = lockUtils.getClass(); | |
Method getSaltM = lockUtilsClazz.getDeclaredMethod("getSalt", int.class); | |
getSaltM.setAccessible(true); | |
Object saltObj = getSaltM.invoke(lockUtils, 0); | |
Log.i("LouisShark", "Salt: " + saltObj); | |
} catch (Exception e) { | |
Log.i("LouisShark", "Err: " + Log.getStackTraceString(e)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment