Spermatid v6.1.8版本的 MD5 值为:a375ce51a42d528ba6e2583c10478296
以下内容为反编译后的 s.java 源代码,内容仅作参考
package com.maoyanym.utils;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
import com.maoyanym.YmLoadManager;
import com.maoyanym.a.h0;
import com.maoyanym.activityComm.CoinWebView;
import com.maoyanym.activityComm.SurveyWebView;
import com.maoyanym.utils.j;
import com.maoyanym.views.YmConfig;
import java.net.URLEncoder;
public class s {
private static boolean f17904a = false;
private static String f17905b;
private static View f17906c;
private static YmConfig.MNovelReadObserver f17907d;
private static YmConfig.MNovelTaskObserver f17908e;
private static int f17909f;
private static String f17910g;
public static class a implements j.m {
public final boolean f17911a;
public a(boolean z10) {
this.f17911a = z10;
}
@Override
public boolean a(int i10, int i11, Object obj, Object... objArr) {
s.b(s.f17905b, (String) obj, this.f17911a);
return true;
}
}
public static class b implements j.m {
public final String f17912a;
public final String f17913b;
public final boolean f17914c;
public b(String str, String str2, boolean z10) {
this.f17912a = str;
this.f17913b = str2;
this.f17914c = z10;
}
@Override
public boolean a(int i10, int i11, Object obj, Object... objArr) {
s.b(this.f17912a, this.f17913b, this.f17914c);
return true;
}
}
public static class c implements j.m {
public final String f17915a;
public final String f17916b;
public final boolean f17917c;
public c(String str, String str2, boolean z10) {
this.f17915a = str;
this.f17916b = str2;
this.f17917c = z10;
}
@Override
public boolean a(int i10, int i11, Object obj, Object... objArr) {
s.b(this.f17915a, this.f17916b, this.f17917c);
return true;
}
}
public static class d implements j.m {
public final String f17918a;
public final boolean f17919b;
public d(String str, boolean z10) {
this.f17918a = str;
this.f17919b = z10;
}
@Override
public boolean a(int i10, int i11, Object obj, Object... objArr) {
s.b((String) null, this.f17918a, this.f17919b);
return true;
}
}
public static class e implements j.m {
public final String f17920a;
public final boolean f17921b;
public final boolean f17922c;
public e(String str, boolean z10, boolean z11) {
this.f17920a = str;
this.f17921b = z10;
this.f17922c = z11;
}
@Override
public boolean a(int i10, int i11, Object obj, Object... objArr) {
s.b(this.f17920a, this.f17921b, this.f17922c);
return true;
}
}
public static class f implements j.m {
public final boolean f17923a;
public final boolean f17924b;
public f(boolean z10, boolean z11) {
this.f17923a = z10;
this.f17924b = z11;
}
@Override
public boolean a(int i10, int i11, Object obj, Object... objArr) {
s.b((String) null, this.f17923a, this.f17924b);
return true;
}
}
public static class g implements j.m {
public final boolean f17925a;
public final boolean f17926b;
public g(boolean z10, boolean z11) {
this.f17925a = z10;
this.f17926b = z11;
}
@Override
public boolean a(int i10, int i11, Object obj, Object... objArr) {
s.a(this.f17925a, false, this.f17926b);
return true;
}
}
public static void a(int i10) {
com.maoyanym.c.b.b("webview_progress_color", i10);
}
public static void a(int i10, int i11) {
com.maoyanym.c.b.b("titlebar_bg_color", i10);
com.maoyanym.c.b.b("titlebar_text_color", i11);
}
public static void a(Context context, String str, String str2) {
String b10 = i.b(context);
if (p.a(b10) || context.getApplicationContext().getPackageName().equalsIgnoreCase(b10)) {
try {
com.maoyanym.b.a.a(context, str, str2, false);
com.maoyanym.a.h.a().b("");
} catch (Throwable unused) {
}
}
}
public static void a(View view) {
f17906c = view;
}
public static void a(YmConfig.MNovelReadObserver mNovelReadObserver) {
f17907d = mNovelReadObserver;
}
public static void a(YmConfig.MNovelTaskObserver mNovelTaskObserver) {
f17908e = mNovelTaskObserver;
}
public static void a(String str) {
f17904a = false;
b(f17905b, str, true);
}
private static void a(String str, String str2, boolean z10, boolean z11) {
try {
if (p.a(str2)) {
Toast.makeText(com.maoyanym.b.a.j(), "url不能为空", 0).show();
return;
}
if (str2.contains("sdktype=ymtask")) {
String a10 = i.a(Uri.parse(str2.replace("sdktype=ymtask", "")));
f17910g = a10;
com.maoyanym.c.b.b("current_url", a10);
b((String) null, false, z11);
return;
}
Intent intent = new Intent(com.maoyanym.b.a.j(), (Class<?>) SurveyWebView.class);
intent.putExtra("url", str2);
intent.putExtra("fromTask", z10);
intent.putExtra("back", z11);
intent.addFlags(268435456);
com.maoyanym.b.a.j().startActivity(intent);
} catch (Exception e10) {
Log.i("xxxxxxxxxxxxxxx", "openReader fail--3 !!!!", e10);
Toast.makeText(com.maoyanym.b.a.j(), "打开书籍/书城失败", 0).show();
}
}
public static void a(String str, boolean z10) {
String str2;
if (!com.maoyanym.b.a.f17735i) {
Toast.makeText(com.maoyanym.b.a.j(), "打开失败,请先初始化SDK", 0).show();
return;
}
if (!com.maoyanym.b.a.f17736j) {
Toast.makeText(com.maoyanym.b.a.j(), "打开失败,请检查YMSDK是否正确初始化", 0).show();
return;
}
if (!com.maoyanym.b.a.f17741o) {
Toast.makeText(com.maoyanym.b.a.j(), "打开失败,请检查是否正确引入了tbs sdk包", 0).show();
return;
}
if (str != null) {
if (str.startsWith(com.maoyanym.b.a.f17731e + ".maoyanym.novel://")) {
try {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse(str));
intent.addFlags(268435456);
com.maoyanym.b.a.j().startActivity(intent);
return;
} catch (Throwable unused) {
return;
}
}
}
if (str != null && (str.startsWith("http://") || str.startsWith("https://"))) {
f17904a = false;
b(str);
if (str.contains("ymlandpage=1")) {
j.b(new a(z10));
return;
} else {
b(f17905b, str, z10);
return;
}
}
StringBuilder sb2 = new StringBuilder();
sb2.append("http://tools.ibookeee.com?ymlandpage=1");
if (p.c(str)) {
str2 = "&type=" + URLEncoder.encode(str);
} else {
str2 = "";
}
sb2.append(str2);
a(sb2.toString(), z10);
}
public static void a(boolean z10) {
a(false, true, z10);
}
public static void a(boolean z10, boolean z11) {
f17904a = false;
b(f17905b, z10, z11);
}
public static void a(boolean z10, boolean z11, boolean z12) {
Intent intent;
com.maoyanym.a.t a10 = com.maoyanym.c.b.a(0);
if (a10 == null) {
if (f17910g == null) {
f17910g = com.maoyanym.c.b.a("current_url", (String) null);
}
if (!p.c(f17910g)) {
if (!z10) {
return;
}
Toast.makeText(com.maoyanym.b.a.j(), "今天的奖励任务已做完,明天再来!", 1).show();
return;
}
a(null, f17910g, z11, z12);
return;
}
int j10 = a10.j();
try {
if (j10 == 1) {
intent = new Intent(com.maoyanym.b.a.j(), (Class<?>) CoinWebView.class);
intent.addFlags(268435456);
intent.putExtra("back", z12);
} else {
if (j10 != 6) {
if (f17910g == null) {
f17910g = com.maoyanym.c.b.a("current_url", (String) null);
}
if (!p.c(f17910g)) {
if (!z10) {
return;
}
Toast.makeText(com.maoyanym.b.a.j(), "今天的奖励任务已做完,明天再来!", 1).show();
return;
}
a(null, f17910g, z11, z12);
return;
}
intent = new Intent(com.maoyanym.b.a.j(), (Class<?>) SurveyWebView.class);
intent.putExtra("url", a10.h());
intent.putExtra("fromTask", z11);
intent.putExtra("back", z12);
intent.addFlags(268435456);
}
com.maoyanym.b.a.j().startActivity(intent);
} catch (Throwable unused) {
}
}
public static View b() {
return f17906c;
}
public static void b(String str) {
com.maoyanym.c.b.a("current_entrance");
String string = i.b(Uri.parse(str).getEncodedQuery()).getString("type");
if (p.c(string)) {
com.maoyanym.c.b.b("current_entrance", string);
}
}
public static void b(String str, String str2, boolean z10) {
if (0 == com.maoyanym.c.b.a(com.maoyanym.c.c.b("config_setup"), 0L)) {
j.c(new b(str, str2, z10));
return;
}
j.c(null);
if (p.a(str2) && p.a(com.maoyanym.c.b.a("current_entrance", (String) null))) {
str2 = com.maoyanym.c.b.a(com.maoyanym.c.c.b("putinurl"), (String) null);
}
if (p.a(str2)) {
Toast.makeText(com.maoyanym.b.a.j(), "小说还未配置,请联系商务或运营", 1).show();
return;
}
if (com.maoyanym.c.b.j().c() <= 0 && !f17904a) {
j.a(new c(str, str2, z10));
f17904a = true;
} else if (p.c(str)) {
j.a(str, new d(str2, z10));
} else {
a(str, str2, false, z10);
}
}
public static void b(String str, boolean z10, boolean z11) {
if (com.maoyanym.c.b.j().c() <= 0 && !f17904a) {
j.a(new e(str, z10, z11));
f17904a = true;
} else if (p.c(str)) {
j.a(str, new f(z10, z11));
} else {
com.maoyanym.c.b.f();
j.d(new g(z10, z11));
}
}
public static String c() {
return com.maoyanym.utils.d.b();
}
public static void c(String str) {
f17905b = str;
}
public static YmLoadManager d() {
return h0.a();
}
public static String e() {
return f17905b;
}
public static String f() {
return "3.0";
}
public static int g() {
int a10 = com.maoyanym.c.b.a("config_titlebar_bg_color", 0);
return a10 == 0 ? com.maoyanym.c.b.a("titlebar_bg_color", -1) : a10;
}
public static int h() {
int a10 = com.maoyanym.c.b.a("config_titlebar_text_color", 0);
return a10 == 0 ? com.maoyanym.c.b.a("titlebar_text_color", -16777216) : a10;
}
public static int i() {
return com.maoyanym.c.b.a("webview_progress_color", -32768);
}
public static void j() {
YmConfig.MNovelReadObserver mNovelReadObserver = f17907d;
if (mNovelReadObserver != null) {
int i10 = f17909f - 1;
f17909f = i10;
if (i10 == 0) {
try {
mNovelReadObserver.close();
} catch (Throwable unused) {
}
}
}
}
public static void k() {
YmConfig.MNovelReadObserver mNovelReadObserver = f17907d;
if (mNovelReadObserver != null) {
int i10 = f17909f;
f17909f = i10 + 1;
if (i10 == 0) {
try {
mNovelReadObserver.open();
} catch (Throwable unused) {
}
}
}
}
public static void l() {
if (f17908e != null) {
try {
long a10 = com.maoyanym.c.b.a(com.maoyanym.c.c.b("task_complete_notify"), 0L);
if (a10 == 0 || !i.a(a10)) {
return;
}
f17908e.onTaskComplete();
com.maoyanym.c.b.a(com.maoyanym.c.c.b("task_complete_notify"));
} catch (Throwable unused) {
}
}
}
public static void m() {
r.a();
}
}