Fix bilibili
This commit is contained in:
parent
206b5189b5
commit
fdcde40457
|
|
@ -535,7 +535,7 @@ public class API {
|
||||||
FrameLayout frame = new FrameLayout(Init.context());
|
FrameLayout frame = new FrameLayout(Init.context());
|
||||||
params.gravity = Gravity.CENTER;
|
params.gravity = Gravity.CENTER;
|
||||||
frame.addView(image, params);
|
frame.addView(image, params);
|
||||||
dialog = new AlertDialog.Builder(Init.getActivity()).setView(frame).setOnDismissListener(this::dismiss).show();
|
dialog = new AlertDialog.Builder(Init.getActivity()).setView(frame).setOnCancelListener(this::dismiss).setOnDismissListener(this::dismiss).show();
|
||||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
Init.show("請使用阿里雲盤 App 掃描二維碼");
|
Init.show("請使用阿里雲盤 App 掃描二維碼");
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
|
|
|
||||||
|
|
@ -270,7 +270,7 @@ public class Bili extends Spider {
|
||||||
FrameLayout frame = new FrameLayout(Init.context());
|
FrameLayout frame = new FrameLayout(Init.context());
|
||||||
params.gravity = Gravity.CENTER;
|
params.gravity = Gravity.CENTER;
|
||||||
frame.addView(image, params);
|
frame.addView(image, params);
|
||||||
dialog = new AlertDialog.Builder(Init.getActivity()).setView(frame).setOnDismissListener(this::dismiss).show();
|
dialog = new AlertDialog.Builder(Init.getActivity()).setView(frame).setOnCancelListener(this::cancel).setOnDismissListener(this::dismiss).show();
|
||||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
Init.show("請使用 BiliBili App 掃描二維碼");
|
Init.show("請使用 BiliBili App 掃描二維碼");
|
||||||
Init.execute(() -> startService(data));
|
Init.execute(() -> startService(data));
|
||||||
|
|
@ -288,6 +288,11 @@ public class Bili extends Spider {
|
||||||
}, 1, 1, TimeUnit.SECONDS);
|
}, 1, 1, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void stopService() {
|
||||||
|
if (service != null) service.shutdownNow();
|
||||||
|
Init.run(this::dismiss);
|
||||||
|
}
|
||||||
|
|
||||||
private void setCookie(String url) {
|
private void setCookie(String url) {
|
||||||
StringBuilder cookie = new StringBuilder();
|
StringBuilder cookie = new StringBuilder();
|
||||||
String[] splits = Uri.parse(url).getQuery().split("&");
|
String[] splits = Uri.parse(url).getQuery().split("&");
|
||||||
|
|
@ -297,13 +302,12 @@ public class Bili extends Spider {
|
||||||
stopService();
|
stopService();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopService() {
|
private void cancel(DialogInterface dialog) {
|
||||||
if (service != null) service.shutdownNow();
|
FileUtil.write(getUserCache(), COOKIE);
|
||||||
Init.run(this::dismiss);
|
stopService();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dismiss(DialogInterface dialog) {
|
private void dismiss(DialogInterface dialog) {
|
||||||
FileUtil.write(getUserCache(), COOKIE);
|
|
||||||
stopService();
|
stopService();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
cc4a1d56205fd4d1039b53ba3175b81f
|
226256cc8e7eb70afa2efb8adad9b8a5
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue