新版的微信APP已经把微信功能的schema都禁掉了,意味着我们无法打开微信的扫一扫等功能,目前正常的只能先进入微信
public static void toWeChatScan(Context context)
{
try {
Uri uri = Uri.parse("weixin://");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
context.startActivity(intent);
} catch (Exception e) {
}
}
那么我们就没办法了吗,当然不会,偶然间看到一个应用竟然直接打开了微信扫一扫,纳尼 这是什么鬼, 反编译神器 jadx 破解,还好没加固,只是混淆了一下 ,
走你
public static void toWeChatScanDirect(Context context) { try { Intent intent = new Intent(); intent.setComponent(new ComponentName("com.tencent.mm", "com.tencent.mm.ui.LauncherUI")); intent.putExtra("LauncherUI.From.Scaner.Shortcut", true); intent.setFlags(335544320); intent.setAction("android.intent.action.VIEW"); context.startActivity(intent); } catch (Exception e) { } }
测试了下,完美