blili open app login
This commit is contained in:
parent
fb43482d51
commit
1861ca6b9d
|
|
@ -260,15 +260,27 @@ public class Bili extends Spider {
|
||||||
private void getQRCode() {
|
private void getQRCode() {
|
||||||
String json = OkHttp.string("https://passport.bilibili.com/x/passport-login/web/qrcode/generate?source=main-mini");
|
String json = OkHttp.string("https://passport.bilibili.com/x/passport-login/web/qrcode/generate?source=main-mini");
|
||||||
Data data = Resp.objectFrom(json).getData();
|
Data data = Resp.objectFrom(json).getData();
|
||||||
Init.run(() -> openApp(data));
|
Init.run(() -> openApp1(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openApp(Data data) {
|
private Intent getIntent(String pkgName, Data data) {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
intent.setClassName(pkgName, "tv.danmaku.bili.ui.intent.IntentHandlerActivity");
|
||||||
|
intent.setData(Uri.parse(data.getUrl()));
|
||||||
|
return intent;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openApp1(Data data) {
|
||||||
try {
|
try {
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
Init.getActivity().startActivity(getIntent("tv.danmaku.bili", data));
|
||||||
intent.setClassName("tv.danmaku.bili", "tv.danmaku.bili.ui.intent.IntentHandlerActivity");
|
} catch (Exception e) {
|
||||||
intent.setData(Uri.parse(data.getUrl()));
|
openApp2(data);
|
||||||
Init.getActivity().startActivity(intent);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openApp2(Data data) {
|
||||||
|
try {
|
||||||
|
Init.getActivity().startActivity(getIntent("com.bilibili.app.in", data));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
showQRCode(data);
|
showQRCode(data);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
b08f51800918ae5534efeb090f79fe28
|
5f4b100204cbb142c56abedc786f613e
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue