Initial commit
This commit is contained in:
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);
|
||||
}
|
Reference in New Issue
Block a user