Initial commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package com.alibaba.android.arouter.base;
|
||||
|
||||
import java.util.TreeMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class UniqueKeyTreeMap<K, V> extends TreeMap<K, V> {
|
||||
private String tipText;
|
||||
|
||||
public UniqueKeyTreeMap(String str) {
|
||||
this.tipText = str;
|
||||
}
|
||||
|
||||
@Override // java.util.TreeMap, java.util.AbstractMap, java.util.Map
|
||||
public V put(K k, V v) {
|
||||
if (containsKey(k)) {
|
||||
throw new RuntimeException(String.format(this.tipText, k));
|
||||
}
|
||||
return (V) super.put(k, v);
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package com.alibaba.android.arouter.core;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.LruCache;
|
||||
import com.alibaba.android.arouter.facade.service.AutowiredService;
|
||||
import com.alibaba.android.arouter.facade.template.ISyringe;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AutowiredServiceImpl implements AutowiredService {
|
||||
private LruCache<String, ISyringe> a;
|
||||
private List<String> b;
|
||||
|
||||
@Override // com.alibaba.android.arouter.facade.service.AutowiredService
|
||||
public void a(Object obj) {
|
||||
String name = obj.getClass().getName();
|
||||
try {
|
||||
if (this.b.contains(name)) {
|
||||
return;
|
||||
}
|
||||
ISyringe iSyringe = this.a.get(name);
|
||||
if (iSyringe == null) {
|
||||
iSyringe = (ISyringe) Class.forName(obj.getClass().getName() + "$$ARouter$$Autowired").getConstructor(new Class[0]).newInstance(new Object[0]);
|
||||
}
|
||||
iSyringe.inject(obj);
|
||||
this.a.put(name, iSyringe);
|
||||
} catch (Exception unused) {
|
||||
this.b.add(name);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.alibaba.android.arouter.facade.template.IProvider
|
||||
public void init(Context context) {
|
||||
this.a = new LruCache<>(66);
|
||||
this.b = new ArrayList();
|
||||
}
|
||||
}
|
@@ -0,0 +1,113 @@
|
||||
package com.alibaba.android.arouter.core;
|
||||
|
||||
import android.content.Context;
|
||||
import com.alibaba.android.arouter.exception.HandlerException;
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
import com.alibaba.android.arouter.facade.callback.InterceptorCallback;
|
||||
import com.alibaba.android.arouter.facade.service.InterceptorService;
|
||||
import com.alibaba.android.arouter.facade.template.IInterceptor;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.alibaba.android.arouter.thread.CancelableCountDownLatch;
|
||||
import com.alibaba.android.arouter.utils.MapUtils;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class InterceptorServiceImpl implements InterceptorService {
|
||||
private static boolean a;
|
||||
private static final Object b = new Object();
|
||||
|
||||
@Override // com.alibaba.android.arouter.facade.template.IProvider
|
||||
public void init(final Context context) {
|
||||
LogisticsCenter.b.execute(new Runnable(this) { // from class: com.alibaba.android.arouter.core.InterceptorServiceImpl.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (MapUtils.b(Warehouse.e)) {
|
||||
Iterator<Map.Entry<Integer, Class<? extends IInterceptor>>> it = Warehouse.e.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Class<? extends IInterceptor> value = it.next().getValue();
|
||||
try {
|
||||
IInterceptor newInstance = value.getConstructor(new Class[0]).newInstance(new Object[0]);
|
||||
newInstance.init(context);
|
||||
Warehouse.f.add(newInstance);
|
||||
} catch (Exception e) {
|
||||
throw new HandlerException("ARouter::ARouter init interceptor error! name = [" + value.getName() + "], reason = [" + e.getMessage() + "]");
|
||||
}
|
||||
}
|
||||
boolean unused = InterceptorServiceImpl.a = true;
|
||||
ARouter.c.d("ARouter::", "ARouter interceptors init over.");
|
||||
synchronized (InterceptorServiceImpl.b) {
|
||||
InterceptorServiceImpl.b.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void b() {
|
||||
synchronized (b) {
|
||||
while (!a) {
|
||||
try {
|
||||
b.wait(10000L);
|
||||
} catch (InterruptedException e) {
|
||||
throw new HandlerException("ARouter::Interceptor init cost too much time error! reason = [" + e.getMessage() + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.alibaba.android.arouter.facade.service.InterceptorService
|
||||
public void a(final Postcard postcard, final InterceptorCallback interceptorCallback) {
|
||||
List<IInterceptor> list = Warehouse.f;
|
||||
if (list != null && list.size() > 0) {
|
||||
b();
|
||||
if (!a) {
|
||||
interceptorCallback.a(new HandlerException("Interceptors initialization takes too much time."));
|
||||
return;
|
||||
} else {
|
||||
LogisticsCenter.b.execute(new Runnable(this) { // from class: com.alibaba.android.arouter.core.InterceptorServiceImpl.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
CancelableCountDownLatch cancelableCountDownLatch = new CancelableCountDownLatch(Warehouse.f.size());
|
||||
try {
|
||||
InterceptorServiceImpl.a(0, cancelableCountDownLatch, postcard);
|
||||
cancelableCountDownLatch.await(postcard.p(), TimeUnit.SECONDS);
|
||||
if (cancelableCountDownLatch.getCount() > 0) {
|
||||
interceptorCallback.a(new HandlerException("The interceptor processing timed out."));
|
||||
} else if (postcard.o() != null) {
|
||||
interceptorCallback.a(new HandlerException(postcard.o().toString()));
|
||||
} else {
|
||||
interceptorCallback.a(postcard);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
interceptorCallback.a(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
interceptorCallback.a(postcard);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static void a(final int i, final CancelableCountDownLatch cancelableCountDownLatch, final Postcard postcard) {
|
||||
if (i < Warehouse.f.size()) {
|
||||
Warehouse.f.get(i).b(postcard, new InterceptorCallback() { // from class: com.alibaba.android.arouter.core.InterceptorServiceImpl.2
|
||||
@Override // com.alibaba.android.arouter.facade.callback.InterceptorCallback
|
||||
public void a(Postcard postcard2) {
|
||||
CancelableCountDownLatch.this.countDown();
|
||||
InterceptorServiceImpl.a(i + 1, CancelableCountDownLatch.this, postcard2);
|
||||
}
|
||||
|
||||
@Override // com.alibaba.android.arouter.facade.callback.InterceptorCallback
|
||||
public void a(Throwable th) {
|
||||
postcard.a(th == null ? new HandlerException("No message.") : th.getMessage());
|
||||
CancelableCountDownLatch.this.a();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
168
sources/com/alibaba/android/arouter/core/LogisticsCenter.java
Normal file
168
sources/com/alibaba/android/arouter/core/LogisticsCenter.java
Normal file
@@ -0,0 +1,168 @@
|
||||
package com.alibaba.android.arouter.core;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import com.alibaba.android.arouter.exception.HandlerException;
|
||||
import com.alibaba.android.arouter.exception.NoRouteFoundException;
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.enums.TypeKind;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.alibaba.android.arouter.utils.MapUtils;
|
||||
import com.alibaba.android.arouter.utils.TextUtils;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class LogisticsCenter {
|
||||
private static Context a;
|
||||
static ThreadPoolExecutor b;
|
||||
private static boolean c;
|
||||
|
||||
/* renamed from: com.alibaba.android.arouter.core.LogisticsCenter$1, reason: invalid class name */
|
||||
static /* synthetic */ class AnonymousClass1 {
|
||||
static final /* synthetic */ int[] a = new int[RouteType.values().length];
|
||||
|
||||
static {
|
||||
try {
|
||||
a[RouteType.PROVIDER.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
a[RouteType.FRAGMENT.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void a() {
|
||||
c = false;
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:28:0x00b4 A[Catch: Exception -> 0x018f, all -> 0x01b0, TryCatch #1 {Exception -> 0x018f, blocks: (B:6:0x0007, B:8:0x0013, B:9:0x011a, B:11:0x0144, B:12:0x014d, B:14:0x0153, B:19:0x001e, B:21:0x0024, B:24:0x002b, B:25:0x0078, B:26:0x00ae, B:28:0x00b4, B:45:0x00c2, B:31:0x00da, B:42:0x00e2, B:34:0x00fa, B:37:0x0102, B:48:0x004b, B:50:0x0062, B:51:0x0075), top: B:5:0x0007, outer: #0 }] */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public static synchronized void a(android.content.Context r8, java.util.concurrent.ThreadPoolExecutor r9) throws com.alibaba.android.arouter.exception.HandlerException {
|
||||
/*
|
||||
Method dump skipped, instructions count: 435
|
||||
To view this dump change 'Code comments level' option to 'DEBUG'
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.alibaba.android.arouter.core.LogisticsCenter.a(android.content.Context, java.util.concurrent.ThreadPoolExecutor):void");
|
||||
}
|
||||
|
||||
public static Postcard a(String str) {
|
||||
RouteMeta routeMeta = Warehouse.d.get(str);
|
||||
if (routeMeta == null) {
|
||||
return null;
|
||||
}
|
||||
return new Postcard(routeMeta.e(), routeMeta.c());
|
||||
}
|
||||
|
||||
public static synchronized void a(Postcard postcard) {
|
||||
synchronized (LogisticsCenter.class) {
|
||||
if (postcard != null) {
|
||||
RouteMeta routeMeta = Warehouse.b.get(postcard.e());
|
||||
if (routeMeta == null) {
|
||||
Class<? extends IRouteGroup> cls = Warehouse.a.get(postcard.c());
|
||||
if (cls != null) {
|
||||
try {
|
||||
if (ARouter.a()) {
|
||||
ARouter.c.a("ARouter::", String.format(Locale.getDefault(), "The group [%s] starts loading, trigger by [%s]", postcard.c(), postcard.e()));
|
||||
}
|
||||
cls.getConstructor(new Class[0]).newInstance(new Object[0]).loadInto(Warehouse.b);
|
||||
Warehouse.a.remove(postcard.c());
|
||||
if (ARouter.a()) {
|
||||
ARouter.c.a("ARouter::", String.format(Locale.getDefault(), "The group [%s] has already been loaded, trigger by [%s]", postcard.c(), postcard.e()));
|
||||
}
|
||||
a(postcard);
|
||||
} catch (Exception e) {
|
||||
throw new HandlerException("ARouter::Fatal exception when loading group meta. [" + e.getMessage() + "]");
|
||||
}
|
||||
} else {
|
||||
throw new NoRouteFoundException("ARouter::There is no route match the path [" + postcard.e() + "], in group [" + postcard.c() + "]");
|
||||
}
|
||||
} else {
|
||||
postcard.a(routeMeta.a());
|
||||
postcard.a(routeMeta.g());
|
||||
postcard.b(routeMeta.f());
|
||||
postcard.a(routeMeta.b());
|
||||
Uri q = postcard.q();
|
||||
if (q != null) {
|
||||
Map<String, String> a2 = TextUtils.a(q);
|
||||
Map<String, Integer> d = routeMeta.d();
|
||||
if (MapUtils.b(d)) {
|
||||
for (Map.Entry<String, Integer> entry : d.entrySet()) {
|
||||
a(postcard, entry.getValue(), entry.getKey(), a2.get(entry.getKey()));
|
||||
}
|
||||
postcard.k().putStringArray("wmHzgD4lOj5o4241", (String[]) d.keySet().toArray(new String[0]));
|
||||
}
|
||||
postcard.a("NTeRQWvye18AkPd6G", q.toString());
|
||||
}
|
||||
int i = AnonymousClass1.a[routeMeta.g().ordinal()];
|
||||
if (i == 1) {
|
||||
Class<?> a3 = routeMeta.a();
|
||||
IProvider iProvider = Warehouse.c.get(a3);
|
||||
if (iProvider == null) {
|
||||
try {
|
||||
iProvider = (IProvider) a3.getConstructor(new Class[0]).newInstance(new Object[0]);
|
||||
iProvider.init(a);
|
||||
Warehouse.c.put(a3, iProvider);
|
||||
} catch (Exception e2) {
|
||||
throw new HandlerException("Init provider failed! " + e2.getMessage());
|
||||
}
|
||||
}
|
||||
postcard.a(iProvider);
|
||||
postcard.r();
|
||||
} else if (i == 2) {
|
||||
postcard.r();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new NoRouteFoundException("ARouter::No postcard!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void a(Postcard postcard, Integer num, String str, String str2) {
|
||||
if (TextUtils.a(str) || TextUtils.a(str2)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (num != null) {
|
||||
if (num.intValue() == TypeKind.BOOLEAN.ordinal()) {
|
||||
postcard.a(str, Boolean.parseBoolean(str2));
|
||||
} else if (num.intValue() == TypeKind.BYTE.ordinal()) {
|
||||
postcard.a(str, Byte.valueOf(str2).byteValue());
|
||||
} else if (num.intValue() == TypeKind.SHORT.ordinal()) {
|
||||
postcard.a(str, Short.valueOf(str2).shortValue());
|
||||
} else if (num.intValue() == TypeKind.INT.ordinal()) {
|
||||
postcard.a(str, Integer.valueOf(str2).intValue());
|
||||
} else if (num.intValue() == TypeKind.LONG.ordinal()) {
|
||||
postcard.a(str, Long.valueOf(str2).longValue());
|
||||
} else if (num.intValue() == TypeKind.FLOAT.ordinal()) {
|
||||
postcard.a(str, Float.valueOf(str2).floatValue());
|
||||
} else if (num.intValue() == TypeKind.DOUBLE.ordinal()) {
|
||||
postcard.a(str, Double.valueOf(str2).doubleValue());
|
||||
} else if (num.intValue() == TypeKind.STRING.ordinal()) {
|
||||
postcard.a(str, str2);
|
||||
} else if (num.intValue() != TypeKind.PARCELABLE.ordinal()) {
|
||||
if (num.intValue() == TypeKind.OBJECT.ordinal()) {
|
||||
postcard.a(str, str2);
|
||||
} else {
|
||||
postcard.a(str, str2);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
postcard.a(str, str2);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
ARouter.c.c("ARouter::", "LogisticsCenter setValue failed! " + th.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
21
sources/com/alibaba/android/arouter/core/Warehouse.java
Normal file
21
sources/com/alibaba/android/arouter/core/Warehouse.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.alibaba.android.arouter.core;
|
||||
|
||||
import com.alibaba.android.arouter.base.UniqueKeyTreeMap;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IInterceptor;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class Warehouse {
|
||||
static Map<String, Class<? extends IRouteGroup>> a = new HashMap();
|
||||
static Map<String, RouteMeta> b = new HashMap();
|
||||
static Map<Class, IProvider> c = new HashMap();
|
||||
static Map<String, RouteMeta> d = new HashMap();
|
||||
static Map<Integer, Class<? extends IInterceptor>> e = new UniqueKeyTreeMap("More than one interceptors use same priority [%s]");
|
||||
static List<IInterceptor> f = new ArrayList();
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.alibaba.android.arouter.exception;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HandlerException extends RuntimeException {
|
||||
public HandlerException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.alibaba.android.arouter.exception;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class InitException extends RuntimeException {
|
||||
public InitException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.alibaba.android.arouter.exception;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class NoRouteFoundException extends RuntimeException {
|
||||
public NoRouteFoundException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
191
sources/com/alibaba/android/arouter/facade/Postcard.java
Normal file
191
sources/com/alibaba/android/arouter/facade/Postcard.java
Normal file
@@ -0,0 +1,191 @@
|
||||
package com.alibaba.android.arouter.facade;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import com.alibaba.android.arouter.facade.callback.NavigationCallback;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import java.io.Serializable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Postcard extends RouteMeta {
|
||||
private Uri j;
|
||||
private Object k;
|
||||
private Bundle l;
|
||||
private int m;
|
||||
private int n;
|
||||
private IProvider o;
|
||||
private boolean p;
|
||||
private Bundle q;
|
||||
private int r;
|
||||
private int s;
|
||||
private String t;
|
||||
|
||||
public Postcard(String str, String str2) {
|
||||
this(str, str2, null, null);
|
||||
}
|
||||
|
||||
public Postcard a(IProvider iProvider) {
|
||||
this.o = iProvider;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String h() {
|
||||
return this.t;
|
||||
}
|
||||
|
||||
public int i() {
|
||||
return this.r;
|
||||
}
|
||||
|
||||
public int j() {
|
||||
return this.s;
|
||||
}
|
||||
|
||||
public Bundle k() {
|
||||
return this.l;
|
||||
}
|
||||
|
||||
public int l() {
|
||||
return this.m;
|
||||
}
|
||||
|
||||
public Bundle m() {
|
||||
return this.q;
|
||||
}
|
||||
|
||||
public IProvider n() {
|
||||
return this.o;
|
||||
}
|
||||
|
||||
public Object o() {
|
||||
return this.k;
|
||||
}
|
||||
|
||||
public int p() {
|
||||
return this.n;
|
||||
}
|
||||
|
||||
public Uri q() {
|
||||
return this.j;
|
||||
}
|
||||
|
||||
public Postcard r() {
|
||||
this.p = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean s() {
|
||||
return this.p;
|
||||
}
|
||||
|
||||
public Object t() {
|
||||
return a((Context) null);
|
||||
}
|
||||
|
||||
@Override // com.alibaba.android.arouter.facade.model.RouteMeta
|
||||
public String toString() {
|
||||
return "Postcard{uri=" + this.j + ", tag=" + this.k + ", mBundle=" + this.l + ", flags=" + this.m + ", timeout=" + this.n + ", provider=" + this.o + ", greenChannel=" + this.p + ", optionsCompat=" + this.q + ", enterAnim=" + this.r + ", exitAnim=" + this.s + "}\n" + super.toString();
|
||||
}
|
||||
|
||||
public Postcard(String str, String str2, Uri uri, Bundle bundle) {
|
||||
this.m = -1;
|
||||
this.n = 300;
|
||||
this.r = -1;
|
||||
this.s = -1;
|
||||
b(str);
|
||||
a(str2);
|
||||
a(uri);
|
||||
this.l = bundle == null ? new Bundle() : bundle;
|
||||
}
|
||||
|
||||
public Postcard a(Object obj) {
|
||||
this.k = obj;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Postcard a(Uri uri) {
|
||||
this.j = uri;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Object a(Context context) {
|
||||
return a(context, (NavigationCallback) null);
|
||||
}
|
||||
|
||||
public Object a(Context context, NavigationCallback navigationCallback) {
|
||||
return ARouter.b().a(context, this, -1, navigationCallback);
|
||||
}
|
||||
|
||||
public void a(Activity activity, int i) {
|
||||
a(activity, i, null);
|
||||
}
|
||||
|
||||
public void a(Activity activity, int i, NavigationCallback navigationCallback) {
|
||||
ARouter.b().a(activity, this, i, navigationCallback);
|
||||
}
|
||||
|
||||
public Postcard a(String str, String str2) {
|
||||
this.l.putString(str, str2);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Postcard a(String str, boolean z) {
|
||||
this.l.putBoolean(str, z);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Postcard a(String str, short s) {
|
||||
this.l.putShort(str, s);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Postcard a(String str, int i) {
|
||||
this.l.putInt(str, i);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Postcard a(String str, long j) {
|
||||
this.l.putLong(str, j);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Postcard a(String str, double d) {
|
||||
this.l.putDouble(str, d);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Postcard a(String str, byte b) {
|
||||
this.l.putByte(str, b);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Postcard a(String str, float f) {
|
||||
this.l.putFloat(str, f);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Postcard a(String str, Parcelable parcelable) {
|
||||
this.l.putParcelable(str, parcelable);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Postcard a(String str, Serializable serializable) {
|
||||
this.l.putSerializable(str, serializable);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Postcard a(String str, byte[] bArr) {
|
||||
this.l.putByteArray(str, bArr);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Postcard a(String str, Bundle bundle) {
|
||||
this.l.putBundle(str, bundle);
|
||||
return this;
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.alibaba.android.arouter.facade.callback;
|
||||
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface InterceptorCallback {
|
||||
void a(Postcard postcard);
|
||||
|
||||
void a(Throwable th);
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
package com.alibaba.android.arouter.facade.callback;
|
||||
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface NavigationCallback {
|
||||
void a(Postcard postcard);
|
||||
|
||||
void b(Postcard postcard);
|
||||
|
||||
void c(Postcard postcard);
|
||||
|
||||
void d(Postcard postcard);
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
package com.alibaba.android.arouter.facade.enums;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum RouteType {
|
||||
ACTIVITY(0, "android.app.Activity"),
|
||||
SERVICE(1, "android.app.Service"),
|
||||
PROVIDER(2, "com.alibaba.android.arouter.facade.template.IProvider"),
|
||||
CONTENT_PROVIDER(-1, "android.app.ContentProvider"),
|
||||
BOARDCAST(-1, ""),
|
||||
METHOD(-1, ""),
|
||||
FRAGMENT(-1, "android.app.Fragment"),
|
||||
UNKNOWN(-1, "Unknown route type");
|
||||
|
||||
String className;
|
||||
int id;
|
||||
|
||||
RouteType(int i, String str) {
|
||||
this.id = i;
|
||||
this.className = str;
|
||||
}
|
||||
|
||||
public static RouteType parse(String str) {
|
||||
for (RouteType routeType : values()) {
|
||||
if (routeType.getClassName().equals(str)) {
|
||||
return routeType;
|
||||
}
|
||||
}
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return this.className;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public RouteType setClassName(String str) {
|
||||
this.className = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RouteType setId(int i) {
|
||||
this.id = i;
|
||||
return this;
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.alibaba.android.arouter.facade.enums;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum TypeKind {
|
||||
BOOLEAN,
|
||||
BYTE,
|
||||
SHORT,
|
||||
INT,
|
||||
LONG,
|
||||
CHAR,
|
||||
FLOAT,
|
||||
DOUBLE,
|
||||
STRING,
|
||||
SERIALIZABLE,
|
||||
PARCELABLE,
|
||||
OBJECT
|
||||
}
|
101
sources/com/alibaba/android/arouter/facade/model/RouteMeta.java
Normal file
101
sources/com/alibaba/android/arouter/facade/model/RouteMeta.java
Normal file
@@ -0,0 +1,101 @@
|
||||
package com.alibaba.android.arouter.facade.model;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import java.util.Map;
|
||||
import javax.lang.model.element.Element;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class RouteMeta {
|
||||
private RouteType a;
|
||||
private Element b;
|
||||
private Class<?> c;
|
||||
private String d;
|
||||
private String e;
|
||||
private int f;
|
||||
private int g;
|
||||
private Map<String, Integer> h;
|
||||
private String i;
|
||||
|
||||
public RouteMeta() {
|
||||
this.f = -1;
|
||||
}
|
||||
|
||||
public static RouteMeta a(RouteType routeType, Class<?> cls, String str, String str2, Map<String, Integer> map, int i, int i2) {
|
||||
return new RouteMeta(routeType, null, cls, null, str, str2, map, i, i2);
|
||||
}
|
||||
|
||||
public RouteMeta b(String str) {
|
||||
this.d = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String c() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public Map<String, Integer> d() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
public String e() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public int f() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
public RouteType g() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "RouteMeta{type=" + this.a + ", rawType=" + this.b + ", destination=" + this.c + ", path='" + this.d + "', group='" + this.e + "', priority=" + this.f + ", extra=" + this.g + ", paramsType=" + this.h + ", name='" + this.i + "'}";
|
||||
}
|
||||
|
||||
public RouteMeta a(RouteType routeType) {
|
||||
this.a = routeType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RouteMeta b(int i) {
|
||||
this.f = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RouteMeta(RouteType routeType, Element element, Class<?> cls, String str, String str2, String str3, Map<String, Integer> map, int i, int i2) {
|
||||
this.f = -1;
|
||||
this.a = routeType;
|
||||
this.i = str;
|
||||
this.c = cls;
|
||||
this.b = element;
|
||||
this.d = str2;
|
||||
this.e = str3;
|
||||
this.h = map;
|
||||
this.f = i;
|
||||
this.g = i2;
|
||||
}
|
||||
|
||||
public Class<?> a() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public int b() {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
public RouteMeta a(Class<?> cls) {
|
||||
this.c = cls;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RouteMeta a(String str) {
|
||||
this.e = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RouteMeta a(int i) {
|
||||
this.g = i;
|
||||
return this;
|
||||
}
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.alibaba.android.arouter.facade.service;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface AutowiredService extends IProvider {
|
||||
void a(Object obj);
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
package com.alibaba.android.arouter.facade.service;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ClassLoaderService extends IProvider {
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.alibaba.android.arouter.facade.service;
|
||||
|
||||
import android.content.Context;
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface DegradeService extends IProvider {
|
||||
void a(Context context, Postcard postcard);
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.alibaba.android.arouter.facade.service;
|
||||
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
import com.alibaba.android.arouter.facade.callback.InterceptorCallback;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface InterceptorService extends IProvider {
|
||||
void a(Postcard postcard, InterceptorCallback interceptorCallback);
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.alibaba.android.arouter.facade.service;
|
||||
|
||||
import android.net.Uri;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface PathReplaceService extends IProvider {
|
||||
Uri a(Uri uri);
|
||||
|
||||
String a(String str);
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
package com.alibaba.android.arouter.facade.service;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface SerializationService extends IProvider {
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
package com.alibaba.android.arouter.facade.template;
|
||||
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
import com.alibaba.android.arouter.facade.callback.InterceptorCallback;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IInterceptor extends IProvider {
|
||||
void b(Postcard postcard, InterceptorCallback interceptorCallback);
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.alibaba.android.arouter.facade.template;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IInterceptorGroup {
|
||||
void loadInto(Map<Integer, Class<? extends IInterceptor>> map);
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
package com.alibaba.android.arouter.facade.template;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ILogger {
|
||||
void a(String str, String str2);
|
||||
|
||||
void b(String str, String str2);
|
||||
|
||||
void c(String str, String str2);
|
||||
|
||||
void d(String str, String str2);
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.alibaba.android.arouter.facade.template;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IProvider {
|
||||
void init(Context context);
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
package com.alibaba.android.arouter.facade.template;
|
||||
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IProviderGroup {
|
||||
void loadInto(Map<String, RouteMeta> map);
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
package com.alibaba.android.arouter.facade.template;
|
||||
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IRouteGroup {
|
||||
void loadInto(Map<String, RouteMeta> map);
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.alibaba.android.arouter.facade.template;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IRouteRoot {
|
||||
void loadInto(Map<String, Class<? extends IRouteGroup>> map);
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
package com.alibaba.android.arouter.facade.template;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ISyringe {
|
||||
void inject(Object obj);
|
||||
}
|
71
sources/com/alibaba/android/arouter/launcher/ARouter.java
Normal file
71
sources/com/alibaba/android/arouter/launcher/ARouter.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package com.alibaba.android.arouter.launcher;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import com.alibaba.android.arouter.exception.InitException;
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
import com.alibaba.android.arouter.facade.callback.NavigationCallback;
|
||||
import com.alibaba.android.arouter.facade.template.ILogger;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ARouter {
|
||||
private static volatile ARouter a = null;
|
||||
private static volatile boolean b = false;
|
||||
public static ILogger c;
|
||||
|
||||
private ARouter() {
|
||||
}
|
||||
|
||||
public static void a(Application application) {
|
||||
if (b) {
|
||||
return;
|
||||
}
|
||||
ILogger iLogger = _ARouter.a;
|
||||
c = iLogger;
|
||||
iLogger.d("ARouter::", "ARouter init start.");
|
||||
b = _ARouter.a(application);
|
||||
if (b) {
|
||||
_ARouter.b();
|
||||
}
|
||||
_ARouter.a.d("ARouter::", "ARouter init over.");
|
||||
}
|
||||
|
||||
public static ARouter b() {
|
||||
if (!b) {
|
||||
throw new InitException("ARouter::Init::Invoke init(context) first!");
|
||||
}
|
||||
if (a == null) {
|
||||
synchronized (ARouter.class) {
|
||||
if (a == null) {
|
||||
a = new ARouter();
|
||||
}
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
public static boolean a() {
|
||||
return _ARouter.c();
|
||||
}
|
||||
|
||||
public void a(Object obj) {
|
||||
_ARouter.a(obj);
|
||||
}
|
||||
|
||||
public Postcard a(String str) {
|
||||
return _ARouter.d().a(str);
|
||||
}
|
||||
|
||||
public Postcard a(Uri uri) {
|
||||
return _ARouter.d().a(uri);
|
||||
}
|
||||
|
||||
public <T> T a(Class<? extends T> cls) {
|
||||
return (T) _ARouter.d().a((Class) cls);
|
||||
}
|
||||
|
||||
public Object a(Context context, Postcard postcard, int i, NavigationCallback navigationCallback) {
|
||||
return _ARouter.d().a(context, postcard, i, navigationCallback);
|
||||
}
|
||||
}
|
308
sources/com/alibaba/android/arouter/launcher/_ARouter.java
Normal file
308
sources/com/alibaba/android/arouter/launcher/_ARouter.java
Normal file
@@ -0,0 +1,308 @@
|
||||
package com.alibaba.android.arouter.launcher;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.widget.Toast;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import com.alibaba.android.arouter.core.LogisticsCenter;
|
||||
import com.alibaba.android.arouter.exception.HandlerException;
|
||||
import com.alibaba.android.arouter.exception.InitException;
|
||||
import com.alibaba.android.arouter.exception.NoRouteFoundException;
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
import com.alibaba.android.arouter.facade.callback.InterceptorCallback;
|
||||
import com.alibaba.android.arouter.facade.callback.NavigationCallback;
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.service.AutowiredService;
|
||||
import com.alibaba.android.arouter.facade.service.DegradeService;
|
||||
import com.alibaba.android.arouter.facade.service.InterceptorService;
|
||||
import com.alibaba.android.arouter.facade.service.PathReplaceService;
|
||||
import com.alibaba.android.arouter.facade.template.ILogger;
|
||||
import com.alibaba.android.arouter.thread.DefaultPoolExecutor;
|
||||
import com.alibaba.android.arouter.utils.DefaultLogger;
|
||||
import com.alibaba.android.arouter.utils.TextUtils;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class _ARouter {
|
||||
static ILogger a = new DefaultLogger("ARouter::");
|
||||
private static volatile boolean b = false;
|
||||
private static volatile _ARouter c = null;
|
||||
private static volatile boolean d = false;
|
||||
private static volatile ThreadPoolExecutor e = DefaultPoolExecutor.a();
|
||||
private static Handler f;
|
||||
private static Context g;
|
||||
private static InterceptorService h;
|
||||
|
||||
/* renamed from: com.alibaba.android.arouter.launcher._ARouter$4, reason: invalid class name */
|
||||
static /* synthetic */ class AnonymousClass4 {
|
||||
static final /* synthetic */ int[] a = new int[RouteType.values().length];
|
||||
|
||||
static {
|
||||
try {
|
||||
a[RouteType.ACTIVITY.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
a[RouteType.PROVIDER.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
try {
|
||||
a[RouteType.BOARDCAST.ordinal()] = 3;
|
||||
} catch (NoSuchFieldError unused3) {
|
||||
}
|
||||
try {
|
||||
a[RouteType.CONTENT_PROVIDER.ordinal()] = 4;
|
||||
} catch (NoSuchFieldError unused4) {
|
||||
}
|
||||
try {
|
||||
a[RouteType.FRAGMENT.ordinal()] = 5;
|
||||
} catch (NoSuchFieldError unused5) {
|
||||
}
|
||||
try {
|
||||
a[RouteType.METHOD.ordinal()] = 6;
|
||||
} catch (NoSuchFieldError unused6) {
|
||||
}
|
||||
try {
|
||||
a[RouteType.SERVICE.ordinal()] = 7;
|
||||
} catch (NoSuchFieldError unused7) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private _ARouter() {
|
||||
}
|
||||
|
||||
private String b(String str) {
|
||||
if (TextUtils.a(str) || !str.startsWith("/")) {
|
||||
throw new HandlerException("ARouter::Extract the default group failed, the path must be start with '/' and contain more than 2 '/'!");
|
||||
}
|
||||
try {
|
||||
String substring = str.substring(1, str.indexOf("/", 1));
|
||||
if (TextUtils.a(substring)) {
|
||||
throw new HandlerException("ARouter::Extract the default group failed! There's nothing between 2 '/'!");
|
||||
}
|
||||
return substring;
|
||||
} catch (Exception e2) {
|
||||
a.c("ARouter::", "Failed to extract default group! " + e2.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static boolean c() {
|
||||
return b;
|
||||
}
|
||||
|
||||
protected static _ARouter d() {
|
||||
if (!d) {
|
||||
throw new InitException("ARouterCore::Init::Invoke init(context) first!");
|
||||
}
|
||||
if (c == null) {
|
||||
synchronized (_ARouter.class) {
|
||||
if (c == null) {
|
||||
c = new _ARouter();
|
||||
}
|
||||
}
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
protected static synchronized boolean a(Application application) {
|
||||
synchronized (_ARouter.class) {
|
||||
g = application;
|
||||
LogisticsCenter.a(g, e);
|
||||
a.d("ARouter::", "ARouter init success!");
|
||||
d = true;
|
||||
f = new Handler(Looper.getMainLooper());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void b() {
|
||||
h = (InterceptorService) ARouter.b().a("/arouter/service/interceptor").t();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public Object b(Context context, final Postcard postcard, final int i, final NavigationCallback navigationCallback) {
|
||||
if (context == null) {
|
||||
context = g;
|
||||
}
|
||||
final Context context2 = context;
|
||||
int i2 = AnonymousClass4.a[postcard.g().ordinal()];
|
||||
if (i2 == 1) {
|
||||
final Intent intent = new Intent(context2, postcard.a());
|
||||
intent.putExtras(postcard.k());
|
||||
int l = postcard.l();
|
||||
if (-1 != l) {
|
||||
intent.setFlags(l);
|
||||
} else if (!(context2 instanceof Activity)) {
|
||||
intent.setFlags(268435456);
|
||||
}
|
||||
String h2 = postcard.h();
|
||||
if (!TextUtils.a(h2)) {
|
||||
intent.setAction(h2);
|
||||
}
|
||||
a(new Runnable() { // from class: com.alibaba.android.arouter.launcher._ARouter.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
_ARouter.this.a(i, context2, intent, postcard, navigationCallback);
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}
|
||||
if (i2 == 2) {
|
||||
return postcard.n();
|
||||
}
|
||||
if (i2 == 3 || i2 == 4 || i2 == 5) {
|
||||
try {
|
||||
Object newInstance = postcard.a().getConstructor(new Class[0]).newInstance(new Object[0]);
|
||||
if (newInstance instanceof Fragment) {
|
||||
((Fragment) newInstance).setArguments(postcard.k());
|
||||
} else if (newInstance instanceof androidx.fragment.app.Fragment) {
|
||||
((androidx.fragment.app.Fragment) newInstance).setArguments(postcard.k());
|
||||
}
|
||||
return newInstance;
|
||||
} catch (Exception e2) {
|
||||
a.b("ARouter::", "Fetch fragment instance error, " + TextUtils.a(e2.getStackTrace()));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static void a(Object obj) {
|
||||
AutowiredService autowiredService = (AutowiredService) ARouter.b().a("/arouter/service/autowired").t();
|
||||
if (autowiredService != null) {
|
||||
autowiredService.a(obj);
|
||||
}
|
||||
}
|
||||
|
||||
protected Postcard a(String str) {
|
||||
if (!TextUtils.a(str)) {
|
||||
PathReplaceService pathReplaceService = (PathReplaceService) ARouter.b().a(PathReplaceService.class);
|
||||
if (pathReplaceService != null) {
|
||||
str = pathReplaceService.a(str);
|
||||
}
|
||||
return a(str, b(str));
|
||||
}
|
||||
throw new HandlerException("ARouter::Parameter is invalid!");
|
||||
}
|
||||
|
||||
protected Postcard a(Uri uri) {
|
||||
if (uri != null && !TextUtils.a(uri.toString())) {
|
||||
PathReplaceService pathReplaceService = (PathReplaceService) ARouter.b().a(PathReplaceService.class);
|
||||
if (pathReplaceService != null) {
|
||||
uri = pathReplaceService.a(uri);
|
||||
}
|
||||
return new Postcard(uri.getPath(), b(uri.getPath()), uri, null);
|
||||
}
|
||||
throw new HandlerException("ARouter::Parameter invalid!");
|
||||
}
|
||||
|
||||
protected Postcard a(String str, String str2) {
|
||||
if (!TextUtils.a(str) && !TextUtils.a(str2)) {
|
||||
PathReplaceService pathReplaceService = (PathReplaceService) ARouter.b().a(PathReplaceService.class);
|
||||
if (pathReplaceService != null) {
|
||||
str = pathReplaceService.a(str);
|
||||
}
|
||||
return new Postcard(str, str2);
|
||||
}
|
||||
throw new HandlerException("ARouter::Parameter is invalid!");
|
||||
}
|
||||
|
||||
protected <T> T a(Class<? extends T> cls) {
|
||||
try {
|
||||
Postcard a2 = LogisticsCenter.a(cls.getName());
|
||||
if (a2 == null) {
|
||||
a2 = LogisticsCenter.a(cls.getSimpleName());
|
||||
}
|
||||
if (a2 == null) {
|
||||
return null;
|
||||
}
|
||||
LogisticsCenter.a(a2);
|
||||
return (T) a2.n();
|
||||
} catch (NoRouteFoundException e2) {
|
||||
a.c("ARouter::", e2.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected Object a(final Context context, final Postcard postcard, final int i, final NavigationCallback navigationCallback) {
|
||||
try {
|
||||
LogisticsCenter.a(postcard);
|
||||
if (navigationCallback != null) {
|
||||
navigationCallback.a(postcard);
|
||||
}
|
||||
if (!postcard.s()) {
|
||||
h.a(postcard, new InterceptorCallback() { // from class: com.alibaba.android.arouter.launcher._ARouter.2
|
||||
@Override // com.alibaba.android.arouter.facade.callback.InterceptorCallback
|
||||
public void a(Postcard postcard2) {
|
||||
_ARouter.this.b(context, postcard2, i, navigationCallback);
|
||||
}
|
||||
|
||||
@Override // com.alibaba.android.arouter.facade.callback.InterceptorCallback
|
||||
public void a(Throwable th) {
|
||||
NavigationCallback navigationCallback2 = navigationCallback;
|
||||
if (navigationCallback2 != null) {
|
||||
navigationCallback2.c(postcard);
|
||||
}
|
||||
_ARouter.a.d("ARouter::", "Navigation failed, termination by interceptor : " + th.getMessage());
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}
|
||||
return b(context, postcard, i, navigationCallback);
|
||||
} catch (NoRouteFoundException e2) {
|
||||
a.c("ARouter::", e2.getMessage());
|
||||
if (c()) {
|
||||
a(new Runnable(this) { // from class: com.alibaba.android.arouter.launcher._ARouter.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
Toast.makeText(_ARouter.g, "There's no route matched!\n Path = [" + postcard.e() + "]\n Group = [" + postcard.c() + "]", 1).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
if (navigationCallback != null) {
|
||||
navigationCallback.b(postcard);
|
||||
} else {
|
||||
DegradeService degradeService = (DegradeService) ARouter.b().a(DegradeService.class);
|
||||
if (degradeService != null) {
|
||||
degradeService.a(context, postcard);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void a(Runnable runnable) {
|
||||
if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
|
||||
f.post(runnable);
|
||||
} else {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void a(int i, Context context, Intent intent, Postcard postcard, NavigationCallback navigationCallback) {
|
||||
if (i >= 0) {
|
||||
if (context instanceof Activity) {
|
||||
ActivityCompat.a((Activity) context, intent, i, postcard.m());
|
||||
} else {
|
||||
a.c("ARouter::", "Must use [navigation(activity, ...)] to support [startActivityForResult]");
|
||||
}
|
||||
} else {
|
||||
ContextCompat.a(context, intent, postcard.m());
|
||||
}
|
||||
if (-1 != postcard.i() && -1 != postcard.j() && (context instanceof Activity)) {
|
||||
((Activity) context).overridePendingTransition(postcard.i(), postcard.j());
|
||||
}
|
||||
if (navigationCallback != null) {
|
||||
navigationCallback.d(postcard);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.ubt.jimu.user.view.CountryCodeActivity;
|
||||
import com.ubt.jimu.user.view.FindPasswordActivity;
|
||||
import com.ubt.jimu.user.view.LoginActivity;
|
||||
import com.ubt.jimu.user.view.RegisterActivity;
|
||||
import com.ubt.jimu.user.view.VerifyCaptchaActivity;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Group$$account implements IRouteGroup {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IRouteGroup
|
||||
public void loadInto(Map<String, RouteMeta> map) {
|
||||
map.put("/account/captcha", RouteMeta.a(RouteType.ACTIVITY, VerifyCaptchaActivity.class, "/account/captcha", "account", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/account/countrycode", RouteMeta.a(RouteType.ACTIVITY, CountryCodeActivity.class, "/account/countrycode", "account", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/account/findpwd", RouteMeta.a(RouteType.ACTIVITY, FindPasswordActivity.class, "/account/findpwd", "account", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/account/login", RouteMeta.a(RouteType.ACTIVITY, LoginActivity.class, "/account/login", "account", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/account/register", RouteMeta.a(RouteType.ACTIVITY, RegisterActivity.class, "/account/register", "account", new HashMap<String, Integer>(this) { // from class: com.alibaba.android.arouter.routes.ARouter$$Group$$account.1
|
||||
{
|
||||
put("loginType", 3);
|
||||
}
|
||||
}, -1, Integer.MIN_VALUE));
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.ubt.jimu.widgets.choosePhotos.AlbumActivity;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Group$$album implements IRouteGroup {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IRouteGroup
|
||||
public void loadInto(Map<String, RouteMeta> map) {
|
||||
map.put("/album/chooser", RouteMeta.a(RouteType.ACTIVITY, AlbumActivity.class, "/album/chooser", "album", null, -1, Integer.MIN_VALUE));
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.core.AutowiredServiceImpl;
|
||||
import com.alibaba.android.arouter.core.InterceptorServiceImpl;
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Group$$arouter implements IRouteGroup {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IRouteGroup
|
||||
public void loadInto(Map<String, RouteMeta> map) {
|
||||
map.put("/arouter/service/autowired", RouteMeta.a(RouteType.PROVIDER, AutowiredServiceImpl.class, "/arouter/service/autowired", "arouter", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/arouter/service/interceptor", RouteMeta.a(RouteType.PROVIDER, InterceptorServiceImpl.class, "/arouter/service/interceptor", "arouter", null, -1, Integer.MIN_VALUE));
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.ubt.jimu.community.activity.JimuActListActivity;
|
||||
import com.ubt.jimu.community.view.HotLaststActivity;
|
||||
import com.ubt.jimu.community.view.InspireActivity;
|
||||
import com.ubt.jimu.community.view.MyFavouriteActivity;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Group$$community implements IRouteGroup {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IRouteGroup
|
||||
public void loadInto(Map<String, RouteMeta> map) {
|
||||
map.put("/community/activity", RouteMeta.a(RouteType.ACTIVITY, JimuActListActivity.class, "/community/activity", "community", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/community/favorite", RouteMeta.a(RouteType.ACTIVITY, MyFavouriteActivity.class, "/community/favorite", "community", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/community/hot", RouteMeta.a(RouteType.ACTIVITY, HotLaststActivity.class, "/community/hot", "community", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/community/inspire", RouteMeta.a(RouteType.ACTIVITY, InspireActivity.class, "/community/inspire", "community", null, -1, Integer.MIN_VALUE));
|
||||
}
|
||||
}
|
@@ -0,0 +1,63 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.ubt.jimu.controller.AccumulatorSettingActivity;
|
||||
import com.ubt.jimu.controller.AddDirectionActivity;
|
||||
import com.ubt.jimu.controller.AngleSettingActivity;
|
||||
import com.ubt.jimu.controller.ControllerActivity;
|
||||
import com.ubt.jimu.controller.JockstickSettingActivity;
|
||||
import com.ubt.jimu.controller.ServoModeSettingNewActivity;
|
||||
import com.ubt.jimu.controller.VSliderSetActivity;
|
||||
import com.ubt.jimu.transport.model.TransportFile;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Group$$controller implements IRouteGroup {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IRouteGroup
|
||||
public void loadInto(Map<String, RouteMeta> map) {
|
||||
map.put("/controller/accumulatorsettings", RouteMeta.a(RouteType.ACTIVITY, AccumulatorSettingActivity.class, "/controller/accumulatorsettings", TransportFile.TYPE_CONTROLLER, new HashMap<String, Integer>(this) { // from class: com.alibaba.android.arouter.routes.ARouter$$Group$$controller.1
|
||||
{
|
||||
put("robotLite", 10);
|
||||
put("config_id_key", 8);
|
||||
}
|
||||
}, -1, Integer.MIN_VALUE));
|
||||
map.put("/controller/adddirect", RouteMeta.a(RouteType.ACTIVITY, AddDirectionActivity.class, "/controller/adddirect", TransportFile.TYPE_CONTROLLER, new HashMap<String, Integer>(this) { // from class: com.alibaba.android.arouter.routes.ARouter$$Group$$controller.2
|
||||
{
|
||||
put("robotLite", 10);
|
||||
}
|
||||
}, -1, Integer.MIN_VALUE));
|
||||
map.put("/controller/anglesettings", RouteMeta.a(RouteType.ACTIVITY, AngleSettingActivity.class, "/controller/anglesettings", TransportFile.TYPE_CONTROLLER, new HashMap<String, Integer>(this) { // from class: com.alibaba.android.arouter.routes.ARouter$$Group$$controller.3
|
||||
{
|
||||
put("robotLite", 10);
|
||||
put("config_id_key", 8);
|
||||
}
|
||||
}, -1, Integer.MIN_VALUE));
|
||||
map.put("/controller/control", RouteMeta.a(RouteType.ACTIVITY, ControllerActivity.class, "/controller/control", TransportFile.TYPE_CONTROLLER, new HashMap<String, Integer>(this) { // from class: com.alibaba.android.arouter.routes.ARouter$$Group$$controller.4
|
||||
{
|
||||
put("robotLite", 10);
|
||||
}
|
||||
}, -1, Integer.MIN_VALUE));
|
||||
map.put("/controller/jocksticksettings", RouteMeta.a(RouteType.ACTIVITY, JockstickSettingActivity.class, "/controller/jocksticksettings", TransportFile.TYPE_CONTROLLER, new HashMap<String, Integer>(this) { // from class: com.alibaba.android.arouter.routes.ARouter$$Group$$controller.5
|
||||
{
|
||||
put("jock_type", 3);
|
||||
put("robotLite", 10);
|
||||
put("config_id_key", 8);
|
||||
}
|
||||
}, -1, Integer.MIN_VALUE));
|
||||
map.put("/controller/servosettings", RouteMeta.a(RouteType.ACTIVITY, ServoModeSettingNewActivity.class, "/controller/servosettings", TransportFile.TYPE_CONTROLLER, new HashMap<String, Integer>(this) { // from class: com.alibaba.android.arouter.routes.ARouter$$Group$$controller.6
|
||||
{
|
||||
put("robotLite", 10);
|
||||
put("isFromUnity", 0);
|
||||
}
|
||||
}, -1, Integer.MIN_VALUE));
|
||||
map.put("/controller/vslidersettings", RouteMeta.a(RouteType.ACTIVITY, VSliderSetActivity.class, "/controller/vslidersettings", TransportFile.TYPE_CONTROLLER, new HashMap<String, Integer>(this) { // from class: com.alibaba.android.arouter.routes.ARouter$$Group$$controller.7
|
||||
{
|
||||
put("robotLite", 10);
|
||||
put("config_id_key", 8);
|
||||
}
|
||||
}, -1, Integer.MIN_VALUE));
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.ubt.jimu.diy.activity.UserDiyActivity;
|
||||
import com.ubt.jimu.diy.view.DiyCommentListActivity;
|
||||
import com.ubt.jimu.diy.view.DiyFanActivity;
|
||||
import com.ubt.jimu.diy.view.OfficialDiyDetailActivity;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Group$$diy implements IRouteGroup {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IRouteGroup
|
||||
public void loadInto(Map<String, RouteMeta> map) {
|
||||
map.put("/diy/commentlist", RouteMeta.a(RouteType.ACTIVITY, DiyCommentListActivity.class, "/diy/commentlist", "diy", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/diy/detail", RouteMeta.a(RouteType.ACTIVITY, OfficialDiyDetailActivity.class, "/diy/detail", "diy", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/diy/fan", RouteMeta.a(RouteType.ACTIVITY, DiyFanActivity.class, "/diy/fan", "diy", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/diy/usercreatives", RouteMeta.a(RouteType.ACTIVITY, UserDiyActivity.class, "/diy/usercreatives", "diy", null, -1, Integer.MIN_VALUE));
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.ubt.jimu.ar.view.GameListActivity;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Group$$game implements IRouteGroup {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IRouteGroup
|
||||
public void loadInto(Map<String, RouteMeta> map) {
|
||||
map.put("/game/list", RouteMeta.a(RouteType.ACTIVITY, GameListActivity.class, "/game/list", "game", null, -1, Integer.MIN_VALUE));
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.ubt.jimu.course.view.JimuTaskListActivity;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Group$$learn implements IRouteGroup {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IRouteGroup
|
||||
public void loadInto(Map<String, RouteMeta> map) {
|
||||
map.put("/learn/lessons", RouteMeta.a(RouteType.ACTIVITY, JimuTaskListActivity.class, "/learn/lessons", "learn", null, -1, Integer.MIN_VALUE));
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.ubt.jimu.pack.view.BarCodeScanActivity;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Group$$package implements IRouteGroup {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IRouteGroup
|
||||
public void loadInto(Map<String, RouteMeta> map) {
|
||||
map.put("/package/scan", RouteMeta.a(RouteType.ACTIVITY, BarCodeScanActivity.class, "/package/scan", "package", null, -1, Integer.MIN_VALUE));
|
||||
}
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.ubt.jimu.discover.DiscoveryActivity;
|
||||
import com.ubt.jimu.main.activity.MainActivity;
|
||||
import com.ubt.jimu.message.view.MessageCenterActivity;
|
||||
import com.ubt.jimu.user.view.UserCenterActivity;
|
||||
import com.ubt.jimu.user.view.setting.SettingActivity;
|
||||
import com.ubt.jimu.web.GdprWebActivity;
|
||||
import com.ubt.jimu.web.WebActivity;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Group$$page implements IRouteGroup {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IRouteGroup
|
||||
public void loadInto(Map<String, RouteMeta> map) {
|
||||
map.put("/page/discovery", RouteMeta.a(RouteType.ACTIVITY, DiscoveryActivity.class, "/page/discovery", "page", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/page/gdpr_web", RouteMeta.a(RouteType.ACTIVITY, GdprWebActivity.class, "/page/gdpr_web", "page", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/page/main", RouteMeta.a(RouteType.ACTIVITY, MainActivity.class, "/page/main", "page", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/page/message", RouteMeta.a(RouteType.ACTIVITY, MessageCenterActivity.class, "/page/message", "page", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/page/setting", RouteMeta.a(RouteType.ACTIVITY, SettingActivity.class, "/page/setting", "page", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/page/user", RouteMeta.a(RouteType.ACTIVITY, UserCenterActivity.class, "/page/user", "page", null, -1, Integer.MIN_VALUE));
|
||||
map.put("/page/web", RouteMeta.a(RouteType.ACTIVITY, WebActivity.class, "/page/web", "page", null, -1, Integer.MIN_VALUE));
|
||||
}
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.ubt.jimu.pack.view.DownloadRobotActivity;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Group$$robot implements IRouteGroup {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IRouteGroup
|
||||
public void loadInto(Map<String, RouteMeta> map) {
|
||||
map.put("/robot/download", RouteMeta.a(RouteType.ACTIVITY, DownloadRobotActivity.class, "/robot/download", Constant.SelectRobot.DOWNLAOD_ROBOT_DATA_KEY, null, -1, Integer.MIN_VALUE));
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IProviderGroup;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Providers$$app implements IProviderGroup {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IProviderGroup
|
||||
public void loadInto(Map<String, RouteMeta> map) {
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.core.AutowiredServiceImpl;
|
||||
import com.alibaba.android.arouter.core.InterceptorServiceImpl;
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IProviderGroup;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Providers$$arouterapi implements IProviderGroup {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IProviderGroup
|
||||
public void loadInto(Map<String, RouteMeta> map) {
|
||||
map.put("com.alibaba.android.arouter.facade.service.AutowiredService", RouteMeta.a(RouteType.PROVIDER, AutowiredServiceImpl.class, "/arouter/service/autowired", "arouter", null, -1, Integer.MIN_VALUE));
|
||||
map.put("com.alibaba.android.arouter.facade.service.InterceptorService", RouteMeta.a(RouteType.PROVIDER, InterceptorServiceImpl.class, "/arouter/service/interceptor", "arouter", null, -1, Integer.MIN_VALUE));
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteRoot;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.ubt.jimu.transport.model.TransportFile;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Root$$app implements IRouteRoot {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IRouteRoot
|
||||
public void loadInto(Map<String, Class<? extends IRouteGroup>> map) {
|
||||
map.put("account", ARouter$$Group$$account.class);
|
||||
map.put("album", ARouter$$Group$$album.class);
|
||||
map.put("community", ARouter$$Group$$community.class);
|
||||
map.put(TransportFile.TYPE_CONTROLLER, ARouter$$Group$$controller.class);
|
||||
map.put("diy", ARouter$$Group$$diy.class);
|
||||
map.put("game", ARouter$$Group$$game.class);
|
||||
map.put("learn", ARouter$$Group$$learn.class);
|
||||
map.put("package", ARouter$$Group$$package.class);
|
||||
map.put("page", ARouter$$Group$$page.class);
|
||||
map.put(Constant.SelectRobot.DOWNLAOD_ROBOT_DATA_KEY, ARouter$$Group$$robot.class);
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteRoot;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ARouter$$Root$$arouterapi implements IRouteRoot {
|
||||
@Override // com.alibaba.android.arouter.facade.template.IRouteRoot
|
||||
public void loadInto(Map<String, Class<? extends IRouteGroup>> map) {
|
||||
map.put("arouter", ARouter$$Group$$arouter.class);
|
||||
}
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
package com.alibaba.android.arouter.thread;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class CancelableCountDownLatch extends CountDownLatch {
|
||||
public CancelableCountDownLatch(int i) {
|
||||
super(i);
|
||||
}
|
||||
|
||||
public void a() {
|
||||
while (getCount() > 0) {
|
||||
countDown();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,60 @@
|
||||
package com.alibaba.android.arouter.thread;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.alibaba.android.arouter.utils.TextUtils;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.RejectedExecutionHandler;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DefaultPoolExecutor extends ThreadPoolExecutor {
|
||||
private static final int a = Runtime.getRuntime().availableProcessors();
|
||||
private static final int b = a + 1;
|
||||
private static final int c = b;
|
||||
private static DefaultPoolExecutor d;
|
||||
|
||||
private DefaultPoolExecutor(int i, int i2, long j, TimeUnit timeUnit, BlockingQueue<Runnable> blockingQueue, ThreadFactory threadFactory) {
|
||||
super(i, i2, j, timeUnit, blockingQueue, threadFactory, new RejectedExecutionHandler() { // from class: com.alibaba.android.arouter.thread.DefaultPoolExecutor.1
|
||||
@Override // java.util.concurrent.RejectedExecutionHandler
|
||||
public void rejectedExecution(Runnable runnable, ThreadPoolExecutor threadPoolExecutor) {
|
||||
ARouter.c.b("ARouter::", "Task rejected, too many task!");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static DefaultPoolExecutor a() {
|
||||
if (d == null) {
|
||||
synchronized (DefaultPoolExecutor.class) {
|
||||
if (d == null) {
|
||||
d = new DefaultPoolExecutor(b, c, 30L, TimeUnit.SECONDS, new ArrayBlockingQueue(64), new DefaultThreadFactory());
|
||||
}
|
||||
}
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ThreadPoolExecutor
|
||||
protected void afterExecute(Runnable runnable, Throwable th) {
|
||||
super.afterExecute(runnable, th);
|
||||
if (th == null && (runnable instanceof Future)) {
|
||||
try {
|
||||
((Future) runnable).get();
|
||||
} catch (InterruptedException unused) {
|
||||
Thread.currentThread().interrupt();
|
||||
} catch (CancellationException e) {
|
||||
th = e;
|
||||
} catch (ExecutionException e2) {
|
||||
th = e2.getCause();
|
||||
}
|
||||
}
|
||||
if (th != null) {
|
||||
ARouter.c.c("ARouter::", "Running task appeared exception! Thread [" + Thread.currentThread().getName() + "], because [" + th.getMessage() + "]\n" + TextUtils.a(th.getStackTrace()));
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
package com.alibaba.android.arouter.thread;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import java.lang.Thread;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DefaultThreadFactory implements ThreadFactory {
|
||||
private static final AtomicInteger d = new AtomicInteger(1);
|
||||
private final AtomicInteger a = new AtomicInteger(1);
|
||||
private final ThreadGroup b;
|
||||
private final String c;
|
||||
|
||||
public DefaultThreadFactory() {
|
||||
SecurityManager securityManager = System.getSecurityManager();
|
||||
this.b = securityManager != null ? securityManager.getThreadGroup() : Thread.currentThread().getThreadGroup();
|
||||
this.c = "ARouter task pool No." + d.getAndIncrement() + ", thread No.";
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ThreadFactory
|
||||
public Thread newThread(Runnable runnable) {
|
||||
String str = this.c + this.a.getAndIncrement();
|
||||
ARouter.c.d("ARouter::", "Thread production, name is [" + str + "]");
|
||||
Thread thread = new Thread(this.b, runnable, str, 0L);
|
||||
if (thread.isDaemon()) {
|
||||
thread.setDaemon(false);
|
||||
}
|
||||
if (thread.getPriority() != 5) {
|
||||
thread.setPriority(5);
|
||||
}
|
||||
thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler(this) { // from class: com.alibaba.android.arouter.thread.DefaultThreadFactory.1
|
||||
@Override // java.lang.Thread.UncaughtExceptionHandler
|
||||
public void uncaughtException(Thread thread2, Throwable th) {
|
||||
ARouter.c.d("ARouter::", "Running task appeared exception! Thread [" + thread2.getName() + "], because [" + th.getMessage() + "]");
|
||||
}
|
||||
});
|
||||
return thread;
|
||||
}
|
||||
}
|
249
sources/com/alibaba/android/arouter/utils/ClassUtils.java
Normal file
249
sources/com/alibaba/android/arouter/utils/ClassUtils.java
Normal file
@@ -0,0 +1,249 @@
|
||||
package com.alibaba.android.arouter.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.alibaba.android.arouter.thread.DefaultPoolExecutor;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ClassUtils {
|
||||
private static final String a = "code_cache" + File.separator + "secondary-dexes";
|
||||
|
||||
private static SharedPreferences a(Context context) {
|
||||
return context.getSharedPreferences("multidex.version", Build.VERSION.SDK_INT < 11 ? 0 : 4);
|
||||
}
|
||||
|
||||
public static List<String> b(Context context) throws PackageManager.NameNotFoundException, IOException {
|
||||
ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(), 0);
|
||||
File file = new File(applicationInfo.sourceDir);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
arrayList.add(applicationInfo.sourceDir);
|
||||
String str = file.getName() + ".classes";
|
||||
if (!a()) {
|
||||
int i = a(context).getInt("dex.number", 1);
|
||||
File file2 = new File(applicationInfo.dataDir, a);
|
||||
for (int i2 = 2; i2 <= i; i2++) {
|
||||
File file3 = new File(file2, str + i2 + ".zip");
|
||||
if (!file3.isFile()) {
|
||||
throw new IOException("Missing extracted secondary dex file '" + file3.getPath() + "'");
|
||||
}
|
||||
arrayList.add(file3.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
if (ARouter.a()) {
|
||||
arrayList.addAll(a(applicationInfo));
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public static Set<String> a(Context context, final String str) throws PackageManager.NameNotFoundException, IOException, InterruptedException {
|
||||
final HashSet hashSet = new HashSet();
|
||||
List<String> b = b(context);
|
||||
final CountDownLatch countDownLatch = new CountDownLatch(b.size());
|
||||
for (final String str2 : b) {
|
||||
DefaultPoolExecutor.a().execute(new Runnable() { // from class: com.alibaba.android.arouter.utils.ClassUtils.1
|
||||
/* JADX WARN: Code restructure failed: missing block: B:30:0x0057, code lost:
|
||||
|
||||
if (r0 == null) goto L20;
|
||||
*/
|
||||
@Override // java.lang.Runnable
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public void run() {
|
||||
/*
|
||||
r4 = this;
|
||||
r0 = 0
|
||||
java.lang.String r1 = r1 // Catch: java.lang.Throwable -> L4f
|
||||
java.lang.String r2 = ".zip"
|
||||
boolean r1 = r1.endsWith(r2) // Catch: java.lang.Throwable -> L4f
|
||||
if (r1 == 0) goto L26
|
||||
java.lang.String r1 = r1 // Catch: java.lang.Throwable -> L4f
|
||||
java.lang.StringBuilder r2 = new java.lang.StringBuilder // Catch: java.lang.Throwable -> L4f
|
||||
r2.<init>() // Catch: java.lang.Throwable -> L4f
|
||||
java.lang.String r3 = r1 // Catch: java.lang.Throwable -> L4f
|
||||
r2.append(r3) // Catch: java.lang.Throwable -> L4f
|
||||
java.lang.String r3 = ".tmp"
|
||||
r2.append(r3) // Catch: java.lang.Throwable -> L4f
|
||||
java.lang.String r2 = r2.toString() // Catch: java.lang.Throwable -> L4f
|
||||
r3 = 0
|
||||
dalvik.system.DexFile r0 = dalvik.system.DexFile.loadDex(r1, r2, r3) // Catch: java.lang.Throwable -> L4f
|
||||
goto L2e
|
||||
L26:
|
||||
dalvik.system.DexFile r1 = new dalvik.system.DexFile // Catch: java.lang.Throwable -> L4f
|
||||
java.lang.String r2 = r1 // Catch: java.lang.Throwable -> L4f
|
||||
r1.<init>(r2) // Catch: java.lang.Throwable -> L4f
|
||||
r0 = r1
|
||||
L2e:
|
||||
java.util.Enumeration r1 = r0.entries() // Catch: java.lang.Throwable -> L4f
|
||||
L32:
|
||||
boolean r2 = r1.hasMoreElements() // Catch: java.lang.Throwable -> L4f
|
||||
if (r2 == 0) goto L4c
|
||||
java.lang.Object r2 = r1.nextElement() // Catch: java.lang.Throwable -> L4f
|
||||
java.lang.String r2 = (java.lang.String) r2 // Catch: java.lang.Throwable -> L4f
|
||||
java.lang.String r3 = r2 // Catch: java.lang.Throwable -> L4f
|
||||
boolean r3 = r2.startsWith(r3) // Catch: java.lang.Throwable -> L4f
|
||||
if (r3 == 0) goto L32
|
||||
java.util.Set r3 = r3 // Catch: java.lang.Throwable -> L4f
|
||||
r3.add(r2) // Catch: java.lang.Throwable -> L4f
|
||||
goto L32
|
||||
L4c:
|
||||
if (r0 == 0) goto L5c
|
||||
goto L59
|
||||
L4f:
|
||||
r1 = move-exception
|
||||
java.lang.String r2 = "ARouter"
|
||||
java.lang.String r3 = "Scan map file in dex files made error."
|
||||
android.util.Log.e(r2, r3, r1) // Catch: java.lang.Throwable -> L62
|
||||
if (r0 == 0) goto L5c
|
||||
L59:
|
||||
r0.close() // Catch: java.lang.Throwable -> L5c
|
||||
L5c:
|
||||
java.util.concurrent.CountDownLatch r0 = r4
|
||||
r0.countDown()
|
||||
return
|
||||
L62:
|
||||
r1 = move-exception
|
||||
if (r0 == 0) goto L68
|
||||
r0.close() // Catch: java.lang.Throwable -> L68
|
||||
L68:
|
||||
java.util.concurrent.CountDownLatch r0 = r4
|
||||
r0.countDown()
|
||||
throw r1
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.alibaba.android.arouter.utils.ClassUtils.AnonymousClass1.run():void");
|
||||
}
|
||||
});
|
||||
}
|
||||
countDownLatch.await();
|
||||
Log.d("ARouter::", "Filter " + hashSet.size() + " classes by packageName <" + str + ">");
|
||||
return hashSet;
|
||||
}
|
||||
|
||||
private static List<String> a(ApplicationInfo applicationInfo) {
|
||||
String[] strArr;
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (Build.VERSION.SDK_INT >= 21 && (strArr = applicationInfo.splitSourceDirs) != null) {
|
||||
arrayList.addAll(Arrays.asList(strArr));
|
||||
Log.d("ARouter::", "Found InstantRun support");
|
||||
} else {
|
||||
try {
|
||||
File file = new File((String) Class.forName("com.android.tools.fd.runtime.Paths").getMethod("getDexFileDirectory", String.class).invoke(null, applicationInfo.packageName));
|
||||
if (file.exists() && file.isDirectory()) {
|
||||
for (File file2 : file.listFiles()) {
|
||||
if (file2 != null && file2.exists() && file2.isFile() && file2.getName().endsWith(".dex")) {
|
||||
arrayList.add(file2.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
Log.d("ARouter::", "Found InstantRun support");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("ARouter::", "InstantRun support error, " + e.getMessage());
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
private static boolean b() {
|
||||
try {
|
||||
String property = System.getProperty("ro.yunos.version");
|
||||
String property2 = System.getProperty("java.vm.name");
|
||||
if (property2 == null || !property2.toLowerCase().contains("lemur")) {
|
||||
if (property == null) {
|
||||
return false;
|
||||
}
|
||||
if (property.trim().length() <= 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch (Exception unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:24:0x004e, code lost:
|
||||
|
||||
if (r2 < 1) goto L24;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:6:0x001b, code lost:
|
||||
|
||||
if (java.lang.Integer.valueOf(java.lang.System.getProperty("ro.build.version.sdk")).intValue() >= 21) goto L7;
|
||||
*/
|
||||
/* JADX WARN: Removed duplicated region for block: B:11:0x0061 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:15:0x0064 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private static boolean a() {
|
||||
/*
|
||||
r0 = 0
|
||||
r1 = 0
|
||||
boolean r2 = b() // Catch: java.lang.Throwable -> L51
|
||||
r3 = 1
|
||||
if (r2 == 0) goto L1f
|
||||
java.lang.String r1 = "'YunOS'"
|
||||
java.lang.String r2 = "ro.build.version.sdk"
|
||||
java.lang.String r2 = java.lang.System.getProperty(r2) // Catch: java.lang.Throwable -> L51
|
||||
java.lang.Integer r2 = java.lang.Integer.valueOf(r2) // Catch: java.lang.Throwable -> L51
|
||||
int r2 = r2.intValue() // Catch: java.lang.Throwable -> L51
|
||||
r4 = 21
|
||||
if (r2 < r4) goto L52
|
||||
L1d:
|
||||
r0 = 1
|
||||
goto L52
|
||||
L1f:
|
||||
java.lang.String r1 = "'Android'"
|
||||
java.lang.String r2 = "java.vm.version"
|
||||
java.lang.String r2 = java.lang.System.getProperty(r2) // Catch: java.lang.Throwable -> L51
|
||||
if (r2 == 0) goto L52
|
||||
java.lang.String r4 = "(\\d+)\\.(\\d+)(\\.\\d+)?"
|
||||
java.util.regex.Pattern r4 = java.util.regex.Pattern.compile(r4) // Catch: java.lang.Throwable -> L51
|
||||
java.util.regex.Matcher r2 = r4.matcher(r2) // Catch: java.lang.Throwable -> L51
|
||||
boolean r4 = r2.matches() // Catch: java.lang.Throwable -> L51
|
||||
if (r4 == 0) goto L52
|
||||
java.lang.String r4 = r2.group(r3) // Catch: java.lang.Throwable -> L51
|
||||
int r4 = java.lang.Integer.parseInt(r4) // Catch: java.lang.Throwable -> L51
|
||||
r5 = 2
|
||||
java.lang.String r2 = r2.group(r5) // Catch: java.lang.Throwable -> L51
|
||||
int r2 = java.lang.Integer.parseInt(r2) // Catch: java.lang.Throwable -> L51
|
||||
if (r4 > r5) goto L1d
|
||||
if (r4 != r5) goto L52
|
||||
if (r2 < r3) goto L52
|
||||
goto L1d
|
||||
L51:
|
||||
L52:
|
||||
java.lang.StringBuilder r2 = new java.lang.StringBuilder
|
||||
r2.<init>()
|
||||
java.lang.String r3 = "VM with name "
|
||||
r2.append(r3)
|
||||
r2.append(r1)
|
||||
if (r0 == 0) goto L64
|
||||
java.lang.String r1 = " has multidex support"
|
||||
goto L66
|
||||
L64:
|
||||
java.lang.String r1 = " does not have multidex support"
|
||||
L66:
|
||||
r2.append(r1)
|
||||
java.lang.String r1 = r2.toString()
|
||||
java.lang.String r2 = "ARouter::"
|
||||
android.util.Log.i(r2, r1)
|
||||
return r0
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.alibaba.android.arouter.utils.ClassUtils.a():boolean");
|
||||
}
|
||||
}
|
95
sources/com/alibaba/android/arouter/utils/DefaultLogger.java
Normal file
95
sources/com/alibaba/android/arouter/utils/DefaultLogger.java
Normal file
@@ -0,0 +1,95 @@
|
||||
package com.alibaba.android.arouter.utils;
|
||||
|
||||
import android.util.Log;
|
||||
import com.alibaba.android.arouter.facade.template.ILogger;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DefaultLogger implements ILogger {
|
||||
private static boolean b = false;
|
||||
private static boolean c = false;
|
||||
private String a;
|
||||
|
||||
public DefaultLogger(String str) {
|
||||
this.a = "ARouter";
|
||||
this.a = str;
|
||||
}
|
||||
|
||||
@Override // com.alibaba.android.arouter.facade.template.ILogger
|
||||
public void a(String str, String str2) {
|
||||
if (b) {
|
||||
StackTraceElement stackTraceElement = Thread.currentThread().getStackTrace()[3];
|
||||
if (android.text.TextUtils.isEmpty(str)) {
|
||||
str = a();
|
||||
}
|
||||
Log.d(str, str2 + a(stackTraceElement));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.alibaba.android.arouter.facade.template.ILogger
|
||||
public void b(String str, String str2) {
|
||||
if (b) {
|
||||
StackTraceElement stackTraceElement = Thread.currentThread().getStackTrace()[3];
|
||||
if (android.text.TextUtils.isEmpty(str)) {
|
||||
str = a();
|
||||
}
|
||||
Log.e(str, str2 + a(stackTraceElement));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.alibaba.android.arouter.facade.template.ILogger
|
||||
public void c(String str, String str2) {
|
||||
if (b) {
|
||||
StackTraceElement stackTraceElement = Thread.currentThread().getStackTrace()[3];
|
||||
if (android.text.TextUtils.isEmpty(str)) {
|
||||
str = a();
|
||||
}
|
||||
Log.w(str, str2 + a(stackTraceElement));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.alibaba.android.arouter.facade.template.ILogger
|
||||
public void d(String str, String str2) {
|
||||
if (b) {
|
||||
StackTraceElement stackTraceElement = Thread.currentThread().getStackTrace()[3];
|
||||
if (android.text.TextUtils.isEmpty(str)) {
|
||||
str = a();
|
||||
}
|
||||
Log.i(str, str2 + a(stackTraceElement));
|
||||
}
|
||||
}
|
||||
|
||||
public String a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public static String a(StackTraceElement stackTraceElement) {
|
||||
StringBuilder sb = new StringBuilder("[");
|
||||
if (c) {
|
||||
String name = Thread.currentThread().getName();
|
||||
String fileName = stackTraceElement.getFileName();
|
||||
String className = stackTraceElement.getClassName();
|
||||
String methodName = stackTraceElement.getMethodName();
|
||||
long id = Thread.currentThread().getId();
|
||||
int lineNumber = stackTraceElement.getLineNumber();
|
||||
sb.append("ThreadId=");
|
||||
sb.append(id);
|
||||
sb.append(" & ");
|
||||
sb.append("ThreadName=");
|
||||
sb.append(name);
|
||||
sb.append(" & ");
|
||||
sb.append("FileName=");
|
||||
sb.append(fileName);
|
||||
sb.append(" & ");
|
||||
sb.append("ClassName=");
|
||||
sb.append(className);
|
||||
sb.append(" & ");
|
||||
sb.append("MethodName=");
|
||||
sb.append(methodName);
|
||||
sb.append(" & ");
|
||||
sb.append("LineNumber=");
|
||||
sb.append(lineNumber);
|
||||
}
|
||||
sb.append(" ] ");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
14
sources/com/alibaba/android/arouter/utils/MapUtils.java
Normal file
14
sources/com/alibaba/android/arouter/utils/MapUtils.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.alibaba.android.arouter.utils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MapUtils {
|
||||
public static boolean a(Map<?, ?> map) {
|
||||
return map == null || map.isEmpty();
|
||||
}
|
||||
|
||||
public static boolean b(Map<?, ?> map) {
|
||||
return !a(map);
|
||||
}
|
||||
}
|
43
sources/com/alibaba/android/arouter/utils/PackageUtils.java
Normal file
43
sources/com/alibaba/android/arouter/utils/PackageUtils.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.alibaba.android.arouter.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageInfo;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PackageUtils {
|
||||
private static String a;
|
||||
private static int b;
|
||||
|
||||
private static PackageInfo a(Context context) {
|
||||
try {
|
||||
return context.getPackageManager().getPackageInfo(context.getPackageName(), 16384);
|
||||
} catch (Exception unused) {
|
||||
ARouter.c.b("ARouter::", "Get package info error.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean b(Context context) {
|
||||
PackageInfo a2 = a(context);
|
||||
if (a2 != null) {
|
||||
String str = a2.versionName;
|
||||
int i = a2.versionCode;
|
||||
SharedPreferences sharedPreferences = context.getSharedPreferences("SP_AROUTER_CACHE", 0);
|
||||
if (str.equals(sharedPreferences.getString("LAST_VERSION_NAME", null)) && i == sharedPreferences.getInt("LAST_VERSION_CODE", -1)) {
|
||||
return false;
|
||||
}
|
||||
a = str;
|
||||
b = i;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void c(Context context) {
|
||||
if (android.text.TextUtils.isEmpty(a) || b == 0) {
|
||||
return;
|
||||
}
|
||||
context.getSharedPreferences("SP_AROUTER_CACHE", 0).edit().putString("LAST_VERSION_NAME", a).putInt("LAST_VERSION_CODE", b).apply();
|
||||
}
|
||||
}
|
48
sources/com/alibaba/android/arouter/utils/TextUtils.java
Normal file
48
sources/com/alibaba/android/arouter/utils/TextUtils.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.alibaba.android.arouter.utils;
|
||||
|
||||
import android.net.Uri;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class TextUtils {
|
||||
public static boolean a(CharSequence charSequence) {
|
||||
return charSequence == null || charSequence.length() == 0;
|
||||
}
|
||||
|
||||
public static String a(StackTraceElement[] stackTraceElementArr) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (StackTraceElement stackTraceElement : stackTraceElementArr) {
|
||||
sb.append(" at ");
|
||||
sb.append(stackTraceElement.toString());
|
||||
sb.append("\n");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static Map<String, String> a(Uri uri) {
|
||||
String encodedQuery = uri.getEncodedQuery();
|
||||
if (encodedQuery == null) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
||||
int i = 0;
|
||||
do {
|
||||
int indexOf = encodedQuery.indexOf(38, i);
|
||||
if (indexOf == -1) {
|
||||
indexOf = encodedQuery.length();
|
||||
}
|
||||
int indexOf2 = encodedQuery.indexOf(61, i);
|
||||
if (indexOf2 > indexOf || indexOf2 == -1) {
|
||||
indexOf2 = indexOf;
|
||||
}
|
||||
String substring = encodedQuery.substring(i, indexOf2);
|
||||
if (!android.text.TextUtils.isEmpty(substring)) {
|
||||
linkedHashMap.put(Uri.decode(substring), Uri.decode(indexOf2 == indexOf ? "" : encodedQuery.substring(indexOf2 + 1, indexOf)));
|
||||
}
|
||||
i = indexOf + 1;
|
||||
} while (i < encodedQuery.length());
|
||||
return Collections.unmodifiableMap(linkedHashMap);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user