|
|
|
|
@ -260,12 +260,13 @@ public class Bili extends Spider { |
|
|
|
|
private void getQRCode() { |
|
|
|
|
String json = OkHttp.string("https://passport.bilibili.com/x/passport-login/web/qrcode/generate?source=main-mini"); |
|
|
|
|
Data data = Resp.objectFrom(json).getData(); |
|
|
|
|
Init.run(() -> showQRCode(data)); |
|
|
|
|
Init.run(() -> openApp(data)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void openApp(Data data) { |
|
|
|
|
try { |
|
|
|
|
Intent intent = new Intent(Intent.ACTION_VIEW); |
|
|
|
|
intent.setClassName("tv.danmaku.bili", "tv.danmaku.bili.ui.intent.IntentHandlerActivity"); |
|
|
|
|
intent.setData(Uri.parse(data.getUrl())); |
|
|
|
|
Init.getActivity().startActivity(intent); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
@ -287,7 +288,6 @@ public class Bili extends Spider { |
|
|
|
|
dialog = new AlertDialog.Builder(Init.getActivity()).setView(frame).setOnCancelListener(this::cancel).setOnDismissListener(this::dismiss).show(); |
|
|
|
|
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); |
|
|
|
|
Utils.notify("請使用 BiliBili App 掃描二維碼"); |
|
|
|
|
Init.execute(() -> startService(data)); |
|
|
|
|
} catch (Exception ignored) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|