Initial commit
This commit is contained in:
70
sources/com/tencent/mm/opensdk/channel/MMessageActV2.java
Normal file
70
sources/com/tencent/mm/opensdk/channel/MMessageActV2.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package com.tencent.mm.opensdk.channel;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.channel.a.b;
|
||||
import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import com.tencent.mm.opensdk.utils.d;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MMessageActV2 {
|
||||
public static final String DEFAULT_ENTRY_CLASS_NAME = ".wxapi.WXEntryActivity";
|
||||
public static final String MM_ENTRY_PACKAGE_NAME = "com.tencent.mm";
|
||||
public static final String MM_MSG_ENTRY_CLASS_NAME = "com.tencent.mm.plugin.base.stub.WXEntryActivity";
|
||||
private static final String TAG = "MicroMsg.SDK.MMessageAct";
|
||||
|
||||
public static class Args {
|
||||
public static final int INVALID_FLAGS = -1;
|
||||
public Bundle bundle;
|
||||
public String content;
|
||||
public int flags = -1;
|
||||
public String targetClassName;
|
||||
public String targetPkgName;
|
||||
|
||||
public String toString() {
|
||||
return "targetPkgName:" + this.targetPkgName + ", targetClassName:" + this.targetClassName + ", content:" + this.content + ", flags:" + this.flags + ", bundle:" + this.bundle;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean send(Context context, Args args) {
|
||||
String str;
|
||||
if (context == null || args == null) {
|
||||
str = "send fail, invalid argument";
|
||||
} else if (d.h(args.targetPkgName)) {
|
||||
str = "send fail, invalid targetPkgName, targetPkgName = " + args.targetPkgName;
|
||||
} else {
|
||||
if (d.h(args.targetClassName)) {
|
||||
args.targetClassName = args.targetPkgName + DEFAULT_ENTRY_CLASS_NAME;
|
||||
}
|
||||
Log.d(TAG, "send, targetPkgName = " + args.targetPkgName + ", targetClassName = " + args.targetClassName);
|
||||
Intent intent = new Intent();
|
||||
intent.setClassName(args.targetPkgName, args.targetClassName);
|
||||
Bundle bundle = args.bundle;
|
||||
if (bundle != null) {
|
||||
intent.putExtras(bundle);
|
||||
}
|
||||
String packageName = context.getPackageName();
|
||||
intent.putExtra(ConstantsAPI.SDK_VERSION, 620756998);
|
||||
intent.putExtra(ConstantsAPI.APP_PACKAGE, packageName);
|
||||
intent.putExtra(ConstantsAPI.CONTENT, args.content);
|
||||
intent.putExtra(ConstantsAPI.CHECK_SUM, b.a(args.content, 620756998, packageName));
|
||||
int i = args.flags;
|
||||
if (i == -1) {
|
||||
intent.addFlags(268435456).addFlags(134217728);
|
||||
} else {
|
||||
intent.setFlags(i);
|
||||
}
|
||||
try {
|
||||
context.startActivity(intent);
|
||||
Log.d(TAG, "send mm message, intent=" + intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
str = "send fail, ex = " + e.getMessage();
|
||||
}
|
||||
}
|
||||
Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
}
|
52
sources/com/tencent/mm/opensdk/channel/a/a.java
Normal file
52
sources/com/tencent/mm/opensdk/channel/a/a.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.tencent.mm.opensdk.channel.a;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import com.tencent.mm.opensdk.utils.d;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class a {
|
||||
|
||||
/* renamed from: com.tencent.mm.opensdk.channel.a.a$a, reason: collision with other inner class name */
|
||||
public static class C0015a {
|
||||
public String W;
|
||||
public long X;
|
||||
public String action;
|
||||
public Bundle bundle;
|
||||
public String content;
|
||||
}
|
||||
|
||||
public static boolean a(Context context, C0015a c0015a) {
|
||||
String str;
|
||||
if (context == null) {
|
||||
str = "send fail, invalid argument";
|
||||
} else {
|
||||
if (!d.h(c0015a.action)) {
|
||||
String str2 = null;
|
||||
if (!d.h(c0015a.W)) {
|
||||
str2 = c0015a.W + ".permission.MM_MESSAGE";
|
||||
}
|
||||
Intent intent = new Intent(c0015a.action);
|
||||
Bundle bundle = c0015a.bundle;
|
||||
if (bundle != null) {
|
||||
intent.putExtras(bundle);
|
||||
}
|
||||
String packageName = context.getPackageName();
|
||||
intent.putExtra(ConstantsAPI.SDK_VERSION, 620756998);
|
||||
intent.putExtra(ConstantsAPI.APP_PACKAGE, packageName);
|
||||
intent.putExtra(ConstantsAPI.CONTENT, c0015a.content);
|
||||
intent.putExtra(ConstantsAPI.APP_SUPORT_CONTENT_TYPE, c0015a.X);
|
||||
intent.putExtra(ConstantsAPI.CHECK_SUM, b.a(c0015a.content, 620756998, packageName));
|
||||
context.sendBroadcast(intent, str2);
|
||||
Log.d("MicroMsg.SDK.MMessage", "send mm message, intent=" + intent + ", perm=" + str2);
|
||||
return true;
|
||||
}
|
||||
str = "send fail, action is null";
|
||||
}
|
||||
Log.e("MicroMsg.SDK.MMessage", str);
|
||||
return false;
|
||||
}
|
||||
}
|
15
sources/com/tencent/mm/opensdk/channel/a/b.java
Normal file
15
sources/com/tencent/mm/opensdk/channel/a/b.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.tencent.mm.opensdk.channel.a;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class b {
|
||||
public static byte[] a(String str, int i, String str2) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
if (str != null) {
|
||||
stringBuffer.append(str);
|
||||
}
|
||||
stringBuffer.append(i);
|
||||
stringBuffer.append(str2);
|
||||
stringBuffer.append("mMcShCsTr");
|
||||
return com.tencent.mm.opensdk.utils.b.e(stringBuffer.toString().substring(1, 9).getBytes()).getBytes();
|
||||
}
|
||||
}
|
31
sources/com/tencent/mm/opensdk/constants/Build.java
Normal file
31
sources/com/tencent/mm/opensdk/constants/Build.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.tencent.mm.opensdk.constants;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Build {
|
||||
public static final int EMOJI_SUPPORTED_SDK_INT = 553844737;
|
||||
public static final int FAVORITE_SUPPPORTED_SDK_INT = 570425345;
|
||||
public static final int MESSAGE_ACTION_SUPPPORTED_SDK_INT = 570490883;
|
||||
public static final int MINIPROGRAM_SUPPORTED_SDK_INT = 620756993;
|
||||
public static final int MIN_SDK_INT = 553713665;
|
||||
public static final int MUSIC_DATA_URL_SUPPORTED_SDK_INT = 553910273;
|
||||
public static final int OPENID_SUPPORTED_SDK_INT = 570425345;
|
||||
public static final int PAY_SUPPORTED_SDK_INT = 570425345;
|
||||
public static final int SCAN_QRCODE_AUTH_SUPPORTED_SDK_INT = 587268097;
|
||||
public static final int SDK_INT = 620756998;
|
||||
public static final String SDK_VERSION_NAME = "android 5.0.6";
|
||||
public static final int SUBSCRIBE_MESSAGE_SUPPORTED_SDK_INT = 620756998;
|
||||
public static final int TIMELINE_SUPPORTED_SDK_INT = 553779201;
|
||||
public static final int VIDEO_FILE_SUPPORTED_SDK_INT = 620756996;
|
||||
|
||||
private Build() {
|
||||
throw new RuntimeException(Build.class.getSimpleName() + " should not be instantiated");
|
||||
}
|
||||
|
||||
public static int getMajorVersion() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
public static int getMinorVersion() {
|
||||
return 0;
|
||||
}
|
||||
}
|
66
sources/com/tencent/mm/opensdk/constants/ConstantsAPI.java
Normal file
66
sources/com/tencent/mm/opensdk/constants/ConstantsAPI.java
Normal file
@@ -0,0 +1,66 @@
|
||||
package com.tencent.mm.opensdk.constants;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ConstantsAPI {
|
||||
public static final String ACTION_HANDLE_APP_REGISTER = "com.tencent.mm.plugin.openapi.Intent.ACTION_HANDLE_APP_REGISTER";
|
||||
public static final String ACTION_HANDLE_APP_UNREGISTER = "com.tencent.mm.plugin.openapi.Intent.ACTION_HANDLE_APP_UNREGISTER";
|
||||
public static final String ACTION_REFRESH_WXAPP = "com.tencent.mm.plugin.openapi.Intent.ACTION_REFRESH_WXAPP";
|
||||
public static final String APP_PACKAGE = "_mmessage_appPackage";
|
||||
public static final String APP_SUPORT_CONTENT_TYPE = "_mmessage_support_content_type";
|
||||
public static final String CHECK_SUM = "_mmessage_checksum";
|
||||
public static final int COMMAND_ADD_CARD_TO_EX_CARD_PACKAGE = 9;
|
||||
public static final int COMMAND_CHOOSE_CARD_FROM_EX_CARD_PACKAGE = 16;
|
||||
public static final int COMMAND_CREATE_CHATROOM = 14;
|
||||
public static final int COMMAND_GETMESSAGE_FROM_WX = 3;
|
||||
public static final int COMMAND_HANDLE_SCAN_RESULT = 17;
|
||||
public static final int COMMAND_JOIN_CHATROOM = 15;
|
||||
public static final int COMMAND_JUMP_BIZ_TEMPSESSION = 10;
|
||||
public static final int COMMAND_JUMP_BIZ_WEBVIEW = 8;
|
||||
public static final int COMMAND_JUMP_TO_BIZ_PROFILE = 7;
|
||||
public static final int COMMAND_LAUNCH_BY_WX = 6;
|
||||
public static final int COMMAND_OPEN_BUSI_LUCKY_MONEY = 13;
|
||||
public static final int COMMAND_OPEN_RANK_LIST = 11;
|
||||
public static final int COMMAND_OPEN_WEBVIEW = 12;
|
||||
public static final int COMMAND_PAY_BY_WX = 5;
|
||||
public static final int COMMAND_SENDAUTH = 1;
|
||||
public static final int COMMAND_SENDMESSAGE_TO_WX = 2;
|
||||
public static final int COMMAND_SHOWMESSAGE_FROM_WX = 4;
|
||||
public static final int COMMAND_SUBSCRIBE_MESSAGE = 18;
|
||||
public static final int COMMAND_UNKNOWN = 0;
|
||||
public static final String CONTENT = "_mmessage_content";
|
||||
public static final String SDK_VERSION = "_mmessage_sdkVersion";
|
||||
|
||||
public static final class AppSupportContentFlag {
|
||||
public static final long MMAPP_SUPPORT_AUDIO = 16;
|
||||
public static final long MMAPP_SUPPORT_DOC = 64;
|
||||
public static final long MMAPP_SUPPORT_DOCX = 128;
|
||||
public static final long MMAPP_SUPPORT_LOCATION = 4;
|
||||
public static final long MMAPP_SUPPORT_PDF = 4096;
|
||||
public static final long MMAPP_SUPPORT_PICTURE = 2;
|
||||
public static final long MMAPP_SUPPORT_PPT = 256;
|
||||
public static final long MMAPP_SUPPORT_PPTX = 512;
|
||||
public static final long MMAPP_SUPPORT_TEXT = 1;
|
||||
public static final long MMAPP_SUPPORT_VIDEO = 8;
|
||||
public static final long MMAPP_SUPPORT_WEBPAGE = 32;
|
||||
public static final long MMAPP_SUPPORT_XLS = 1024;
|
||||
public static final long MMAPP_SUPPORT_XLSX = 2048;
|
||||
}
|
||||
|
||||
public static final class OpenWebviewType {
|
||||
public static final int TYPE_SUBSCRIBE_MESSAGE = 1;
|
||||
}
|
||||
|
||||
public static final class Token {
|
||||
public static final String WX_LAUNCH_PARAM_KEY = "launchParam";
|
||||
public static final String WX_TOKEN_KEY = "wx_token_key";
|
||||
public static final String WX_TOKEN_PLATFORMID_KEY = "platformId";
|
||||
public static final String WX_TOKEN_PLATFORMID_VALUE = "wechat";
|
||||
public static final String WX_TOKEN_VALUE_MSG = "com.tencent.mm.openapi.token";
|
||||
}
|
||||
|
||||
public static final class WXApp {
|
||||
public static final String WXAPP_BROADCAST_PERMISSION = "com.tencent.mm.permission.MM_MESSAGE";
|
||||
public static final String WXAPP_MSG_ENTRY_CLASSNAME = "com.tencent.mm.plugin.base.stub.WXEntryActivity";
|
||||
public static final String WXAPP_PACKAGE_NAME = "com.tencent.mm";
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package com.tencent.mm.opensdk.diffdev;
|
||||
|
||||
import com.tencent.mm.opensdk.diffdev.a.a;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DiffDevOAuthFactory {
|
||||
public static final int MAX_SUPPORTED_VERSION = 1;
|
||||
private static final String TAG = "MicroMsg.SDK.DiffDevOAuthFactory";
|
||||
public static final int VERSION_1 = 1;
|
||||
private static IDiffDevOAuth v1Instance;
|
||||
|
||||
private DiffDevOAuthFactory() {
|
||||
}
|
||||
|
||||
public static IDiffDevOAuth getDiffDevOAuth() {
|
||||
return getDiffDevOAuth(1);
|
||||
}
|
||||
|
||||
public static IDiffDevOAuth getDiffDevOAuth(int i) {
|
||||
Log.v(TAG, "getDiffDevOAuth, version = " + i);
|
||||
if (i > 1) {
|
||||
Log.e(TAG, "getDiffDevOAuth fail, unsupported version = " + i);
|
||||
return null;
|
||||
}
|
||||
if (i != 1) {
|
||||
return null;
|
||||
}
|
||||
if (v1Instance == null) {
|
||||
v1Instance = new a();
|
||||
}
|
||||
return v1Instance;
|
||||
}
|
||||
}
|
16
sources/com/tencent/mm/opensdk/diffdev/IDiffDevOAuth.java
Normal file
16
sources/com/tencent/mm/opensdk/diffdev/IDiffDevOAuth.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.tencent.mm.opensdk.diffdev;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IDiffDevOAuth {
|
||||
void addListener(OAuthListener oAuthListener);
|
||||
|
||||
boolean auth(String str, String str2, String str3, String str4, String str5, OAuthListener oAuthListener);
|
||||
|
||||
void detach();
|
||||
|
||||
void removeAllListeners();
|
||||
|
||||
void removeListener(OAuthListener oAuthListener);
|
||||
|
||||
boolean stopAuth();
|
||||
}
|
27
sources/com/tencent/mm/opensdk/diffdev/OAuthErrCode.java
Normal file
27
sources/com/tencent/mm/opensdk/diffdev/OAuthErrCode.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package com.tencent.mm.opensdk.diffdev;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum OAuthErrCode {
|
||||
WechatAuth_Err_OK(0),
|
||||
WechatAuth_Err_NormalErr(-1),
|
||||
WechatAuth_Err_NetworkErr(-2),
|
||||
WechatAuth_Err_JsonDecodeErr(-3),
|
||||
WechatAuth_Err_Cancel(-4),
|
||||
WechatAuth_Err_Timeout(-5),
|
||||
WechatAuth_Err_Auth_Stopped(-6);
|
||||
|
||||
private int code;
|
||||
|
||||
OAuthErrCode(int i) {
|
||||
this.code = i;
|
||||
}
|
||||
|
||||
public final int getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
@Override // java.lang.Enum
|
||||
public final String toString() {
|
||||
return "OAuthErrCode:" + this.code;
|
||||
}
|
||||
}
|
10
sources/com/tencent/mm/opensdk/diffdev/OAuthListener.java
Normal file
10
sources/com/tencent/mm/opensdk/diffdev/OAuthListener.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.tencent.mm.opensdk.diffdev;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface OAuthListener {
|
||||
void onAuthFinish(OAuthErrCode oAuthErrCode, String str);
|
||||
|
||||
void onAuthGotQrcode(String str, byte[] bArr);
|
||||
|
||||
void onQrcodeScanned();
|
||||
}
|
88
sources/com/tencent/mm/opensdk/diffdev/a/a.java
Normal file
88
sources/com/tencent/mm/opensdk/diffdev/a/a.java
Normal file
@@ -0,0 +1,88 @@
|
||||
package com.tencent.mm.opensdk.diffdev.a;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import com.tencent.mm.opensdk.diffdev.IDiffDevOAuth;
|
||||
import com.tencent.mm.opensdk.diffdev.OAuthListener;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class a implements IDiffDevOAuth {
|
||||
private d Z;
|
||||
private Handler handler = null;
|
||||
private List<OAuthListener> Y = new ArrayList();
|
||||
private OAuthListener aa = new b(this);
|
||||
|
||||
static /* synthetic */ d c(a aVar) {
|
||||
aVar.Z = null;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.diffdev.IDiffDevOAuth
|
||||
public final void addListener(OAuthListener oAuthListener) {
|
||||
if (this.Y.contains(oAuthListener)) {
|
||||
return;
|
||||
}
|
||||
this.Y.add(oAuthListener);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.diffdev.IDiffDevOAuth
|
||||
public final boolean auth(String str, String str2, String str3, String str4, String str5, OAuthListener oAuthListener) {
|
||||
Log.i("MicroMsg.SDK.DiffDevOAuth", "start auth, appId = " + str);
|
||||
if (str == null || str.length() <= 0 || str2 == null || str2.length() <= 0) {
|
||||
Log.d("MicroMsg.SDK.DiffDevOAuth", String.format("auth fail, invalid argument, appId = %s, scope = %s", str, str2));
|
||||
return false;
|
||||
}
|
||||
if (this.handler == null) {
|
||||
this.handler = new Handler(Looper.getMainLooper());
|
||||
}
|
||||
addListener(oAuthListener);
|
||||
if (this.Z != null) {
|
||||
Log.d("MicroMsg.SDK.DiffDevOAuth", "auth, already running, no need to start auth again");
|
||||
return true;
|
||||
}
|
||||
this.Z = new d(str, str2, str3, str4, str5, this.aa);
|
||||
d dVar = this.Z;
|
||||
if (Build.VERSION.SDK_INT >= 11) {
|
||||
dVar.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
|
||||
} else {
|
||||
dVar.execute(new Void[0]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.diffdev.IDiffDevOAuth
|
||||
public final void detach() {
|
||||
Log.i("MicroMsg.SDK.DiffDevOAuth", "detach");
|
||||
this.Y.clear();
|
||||
stopAuth();
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.diffdev.IDiffDevOAuth
|
||||
public final void removeAllListeners() {
|
||||
this.Y.clear();
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.diffdev.IDiffDevOAuth
|
||||
public final void removeListener(OAuthListener oAuthListener) {
|
||||
this.Y.remove(oAuthListener);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.diffdev.IDiffDevOAuth
|
||||
public final boolean stopAuth() {
|
||||
boolean z;
|
||||
Log.i("MicroMsg.SDK.DiffDevOAuth", "stopAuth");
|
||||
try {
|
||||
z = this.Z == null ? true : this.Z.q();
|
||||
} catch (Exception e) {
|
||||
Log.w("MicroMsg.SDK.DiffDevOAuth", "stopAuth fail, ex = " + e.getMessage());
|
||||
z = false;
|
||||
}
|
||||
this.Z = null;
|
||||
return z;
|
||||
}
|
||||
}
|
57
sources/com/tencent/mm/opensdk/diffdev/a/b.java
Normal file
57
sources/com/tencent/mm/opensdk/diffdev/a/b.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package com.tencent.mm.opensdk.diffdev.a;
|
||||
|
||||
import android.os.Handler;
|
||||
import com.tencent.mm.opensdk.diffdev.OAuthErrCode;
|
||||
import com.tencent.mm.opensdk.diffdev.OAuthListener;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class b implements OAuthListener {
|
||||
final /* synthetic */ a ab;
|
||||
|
||||
b(a aVar) {
|
||||
this.ab = aVar;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.diffdev.OAuthListener
|
||||
public final void onAuthFinish(OAuthErrCode oAuthErrCode, String str) {
|
||||
List list;
|
||||
Log.d("MicroMsg.SDK.ListenerWrapper", String.format("onAuthFinish, errCode = %s, authCode = %s", oAuthErrCode.toString(), str));
|
||||
a.c(this.ab);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
list = this.ab.Y;
|
||||
arrayList.addAll(list);
|
||||
Iterator it = arrayList.iterator();
|
||||
while (it.hasNext()) {
|
||||
((OAuthListener) it.next()).onAuthFinish(oAuthErrCode, str);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.diffdev.OAuthListener
|
||||
public final void onAuthGotQrcode(String str, byte[] bArr) {
|
||||
List list;
|
||||
Log.d("MicroMsg.SDK.ListenerWrapper", "onAuthGotQrcode, qrcodeImgPath = " + str);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
list = this.ab.Y;
|
||||
arrayList.addAll(list);
|
||||
Iterator it = arrayList.iterator();
|
||||
while (it.hasNext()) {
|
||||
((OAuthListener) it.next()).onAuthGotQrcode(str, bArr);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.diffdev.OAuthListener
|
||||
public final void onQrcodeScanned() {
|
||||
Handler handler;
|
||||
Handler handler2;
|
||||
Log.d("MicroMsg.SDK.ListenerWrapper", "onQrcodeScanned");
|
||||
handler = this.ab.handler;
|
||||
if (handler != null) {
|
||||
handler2 = this.ab.handler;
|
||||
handler2.post(new c(this));
|
||||
}
|
||||
}
|
||||
}
|
27
sources/com/tencent/mm/opensdk/diffdev/a/c.java
Normal file
27
sources/com/tencent/mm/opensdk/diffdev/a/c.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package com.tencent.mm.opensdk.diffdev.a;
|
||||
|
||||
import com.tencent.mm.opensdk.diffdev.OAuthListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class c implements Runnable {
|
||||
final /* synthetic */ b ac;
|
||||
|
||||
c(b bVar) {
|
||||
this.ac = bVar;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
List list;
|
||||
ArrayList arrayList = new ArrayList();
|
||||
list = this.ac.ab.Y;
|
||||
arrayList.addAll(list);
|
||||
Iterator it = arrayList.iterator();
|
||||
while (it.hasNext()) {
|
||||
((OAuthListener) it.next()).onQrcodeScanned();
|
||||
}
|
||||
}
|
||||
}
|
212
sources/com/tencent/mm/opensdk/diffdev/a/d.java
Normal file
212
sources/com/tencent/mm/opensdk/diffdev/a/d.java
Normal file
@@ -0,0 +1,212 @@
|
||||
package com.tencent.mm.opensdk.diffdev.a;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.util.Base64;
|
||||
import com.tencent.mm.opensdk.diffdev.OAuthErrCode;
|
||||
import com.tencent.mm.opensdk.diffdev.OAuthListener;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import com.ubt.jimu.diy.view.fragment.BuildStepFragment;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class d extends AsyncTask<Void, Void, a> {
|
||||
private static final boolean ad;
|
||||
private static final String ae;
|
||||
private static String af;
|
||||
private String ag;
|
||||
private String ah;
|
||||
private OAuthListener ai;
|
||||
private f aj;
|
||||
private String appId;
|
||||
private String scope;
|
||||
private String signature;
|
||||
|
||||
static class a {
|
||||
public OAuthErrCode ak;
|
||||
public String al;
|
||||
public String am;
|
||||
public String an;
|
||||
public int ao;
|
||||
public String ap;
|
||||
public byte[] aq;
|
||||
|
||||
private a() {
|
||||
}
|
||||
|
||||
private static boolean a(String str, byte[] bArr) {
|
||||
FileOutputStream fileOutputStream = null;
|
||||
try {
|
||||
try {
|
||||
FileOutputStream fileOutputStream2 = new FileOutputStream(str);
|
||||
try {
|
||||
fileOutputStream2.write(bArr);
|
||||
fileOutputStream2.flush();
|
||||
try {
|
||||
fileOutputStream2.close();
|
||||
} catch (IOException e) {
|
||||
Log.e("MicroMsg.SDK.GetQRCodeResult", "fout.close() exception:" + e.getMessage());
|
||||
}
|
||||
Log.d("MicroMsg.SDK.GetQRCodeResult", "writeToFile ok!");
|
||||
return true;
|
||||
} catch (Exception e2) {
|
||||
e = e2;
|
||||
fileOutputStream = fileOutputStream2;
|
||||
Log.w("MicroMsg.SDK.GetQRCodeResult", "write to file error, exception:" + e.getMessage());
|
||||
if (fileOutputStream == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
fileOutputStream.close();
|
||||
return false;
|
||||
} catch (IOException e3) {
|
||||
Log.e("MicroMsg.SDK.GetQRCodeResult", "fout.close() exception:" + e3.getMessage());
|
||||
return false;
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
th = th;
|
||||
fileOutputStream = fileOutputStream2;
|
||||
if (fileOutputStream != null) {
|
||||
try {
|
||||
fileOutputStream.close();
|
||||
} catch (IOException e4) {
|
||||
Log.e("MicroMsg.SDK.GetQRCodeResult", "fout.close() exception:" + e4.getMessage());
|
||||
}
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
} catch (Exception e5) {
|
||||
e = e5;
|
||||
}
|
||||
} catch (Throwable th2) {
|
||||
th = th2;
|
||||
}
|
||||
}
|
||||
|
||||
public static a c(byte[] bArr) {
|
||||
OAuthErrCode oAuthErrCode;
|
||||
String format;
|
||||
a aVar = new a();
|
||||
if (bArr == null || bArr.length == 0) {
|
||||
Log.e("MicroMsg.SDK.GetQRCodeResult", "parse fail, buf is null");
|
||||
oAuthErrCode = OAuthErrCode.WechatAuth_Err_NetworkErr;
|
||||
} else {
|
||||
try {
|
||||
try {
|
||||
JSONObject jSONObject = new JSONObject(new String(bArr, "utf-8"));
|
||||
int i = jSONObject.getInt("errcode");
|
||||
if (i != 0) {
|
||||
Log.e("MicroMsg.SDK.GetQRCodeResult", String.format("resp errcode = %d", Integer.valueOf(i)));
|
||||
aVar.ak = OAuthErrCode.WechatAuth_Err_NormalErr;
|
||||
aVar.ao = i;
|
||||
aVar.ap = jSONObject.optString("errmsg");
|
||||
return aVar;
|
||||
}
|
||||
String string = jSONObject.getJSONObject("qrcode").getString("qrcodebase64");
|
||||
if (string != null && string.length() != 0) {
|
||||
byte[] decode = Base64.decode(string, 0);
|
||||
if (decode != null && decode.length != 0) {
|
||||
if (!d.ad) {
|
||||
aVar.ak = OAuthErrCode.WechatAuth_Err_OK;
|
||||
aVar.aq = decode;
|
||||
aVar.al = jSONObject.getString(BuildStepFragment.UUID);
|
||||
aVar.am = jSONObject.getString("appname");
|
||||
Log.d("MicroMsg.SDK.GetQRCodeResult", String.format("parse succ, save in memory, uuid = %s, appname = %s, imgBufLength = %d", aVar.al, aVar.am, Integer.valueOf(aVar.aq.length)));
|
||||
return aVar;
|
||||
}
|
||||
File file = new File(d.ae);
|
||||
file.mkdirs();
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
if (!a(d.ae, decode)) {
|
||||
Log.e("MicroMsg.SDK.GetQRCodeResult", String.format("writeToFile fail, qrcodeBuf length = %d", Integer.valueOf(decode.length)));
|
||||
aVar.ak = OAuthErrCode.WechatAuth_Err_NormalErr;
|
||||
return aVar;
|
||||
}
|
||||
aVar.ak = OAuthErrCode.WechatAuth_Err_OK;
|
||||
aVar.an = d.ae;
|
||||
aVar.al = jSONObject.getString(BuildStepFragment.UUID);
|
||||
aVar.am = jSONObject.getString("appname");
|
||||
Log.d("MicroMsg.SDK.GetQRCodeResult", String.format("parse succ, save in external storage, uuid = %s, appname = %s, imgPath = %s", aVar.al, aVar.am, aVar.an));
|
||||
return aVar;
|
||||
}
|
||||
Log.e("MicroMsg.SDK.GetQRCodeResult", "parse fail, qrcodeBuf is null");
|
||||
aVar.ak = OAuthErrCode.WechatAuth_Err_JsonDecodeErr;
|
||||
return aVar;
|
||||
}
|
||||
Log.e("MicroMsg.SDK.GetQRCodeResult", "parse fail, qrcodeBase64 is null");
|
||||
aVar.ak = OAuthErrCode.WechatAuth_Err_JsonDecodeErr;
|
||||
return aVar;
|
||||
} catch (Exception e) {
|
||||
format = String.format("parse json fail, ex = %s", e.getMessage());
|
||||
Log.e("MicroMsg.SDK.GetQRCodeResult", format);
|
||||
oAuthErrCode = OAuthErrCode.WechatAuth_Err_NormalErr;
|
||||
aVar.ak = oAuthErrCode;
|
||||
return aVar;
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
format = String.format("parse fail, build String fail, ex = %s", e2.getMessage());
|
||||
}
|
||||
}
|
||||
aVar.ak = oAuthErrCode;
|
||||
return aVar;
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
ad = Environment.getExternalStorageState().equals("mounted") && new File(Environment.getExternalStorageDirectory().getAbsolutePath()).canWrite();
|
||||
ae = Environment.getExternalStorageDirectory().getAbsolutePath() + "/tencent/MicroMsg/oauth_qrcode.png";
|
||||
af = null;
|
||||
af = "http://open.weixin.qq.com/connect/sdk/qrconnect?appid=%s&noncestr=%s×tamp=%s&scope=%s&signature=%s";
|
||||
}
|
||||
|
||||
public d(String str, String str2, String str3, String str4, String str5, OAuthListener oAuthListener) {
|
||||
this.appId = str;
|
||||
this.scope = str2;
|
||||
this.ag = str3;
|
||||
this.ah = str4;
|
||||
this.signature = str5;
|
||||
this.ai = oAuthListener;
|
||||
}
|
||||
|
||||
@Override // android.os.AsyncTask
|
||||
protected final /* synthetic */ a doInBackground(Void[] voidArr) {
|
||||
Log.i("MicroMsg.SDK.GetQRCodeTask", "external storage available = " + ad);
|
||||
String format = String.format(af, this.appId, this.ag, this.ah, this.scope, this.signature);
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
byte[] b = e.b(format, -1);
|
||||
Log.d("MicroMsg.SDK.GetQRCodeTask", String.format("doInBackground, url = %s, time consumed = %d(ms)", format, Long.valueOf(System.currentTimeMillis() - currentTimeMillis)));
|
||||
return a.c(b);
|
||||
}
|
||||
|
||||
@Override // android.os.AsyncTask
|
||||
protected final /* synthetic */ void onPostExecute(a aVar) {
|
||||
a aVar2 = aVar;
|
||||
OAuthErrCode oAuthErrCode = aVar2.ak;
|
||||
if (oAuthErrCode != OAuthErrCode.WechatAuth_Err_OK) {
|
||||
Log.e("MicroMsg.SDK.GetQRCodeTask", String.format("onPostExecute, get qrcode fail, OAuthErrCode = %s", oAuthErrCode));
|
||||
this.ai.onAuthFinish(aVar2.ak, null);
|
||||
return;
|
||||
}
|
||||
Log.d("MicroMsg.SDK.GetQRCodeTask", "onPostExecute, get qrcode success");
|
||||
this.ai.onAuthGotQrcode(aVar2.an, aVar2.aq);
|
||||
this.aj = new f(aVar2.al, this.ai);
|
||||
f fVar = this.aj;
|
||||
if (Build.VERSION.SDK_INT >= 11) {
|
||||
fVar.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
|
||||
} else {
|
||||
fVar.execute(new Void[0]);
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean q() {
|
||||
Log.i("MicroMsg.SDK.GetQRCodeTask", "cancelTask");
|
||||
f fVar = this.aj;
|
||||
return fVar == null ? cancel(true) : fVar.cancel(true);
|
||||
}
|
||||
}
|
56
sources/com/tencent/mm/opensdk/diffdev/a/e.java
Normal file
56
sources/com/tencent/mm/opensdk/diffdev/a/e.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package com.tencent.mm.opensdk.diffdev.a;
|
||||
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.params.HttpConnectionParams;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class e {
|
||||
public static byte[] b(String str, int i) {
|
||||
String str2;
|
||||
StringBuilder sb;
|
||||
String message;
|
||||
if (str != null && str.length() != 0) {
|
||||
DefaultHttpClient defaultHttpClient = new DefaultHttpClient();
|
||||
HttpGet httpGet = new HttpGet(str);
|
||||
if (i >= 0) {
|
||||
try {
|
||||
HttpConnectionParams.setSoTimeout(defaultHttpClient.getParams(), i);
|
||||
} catch (Exception e) {
|
||||
sb = new StringBuilder("httpGet, Exception ex = ");
|
||||
message = e.getMessage();
|
||||
sb.append(message);
|
||||
str2 = sb.toString();
|
||||
Log.e("MicroMsg.SDK.NetUtil", str2);
|
||||
return null;
|
||||
} catch (IncompatibleClassChangeError e2) {
|
||||
sb = new StringBuilder("httpGet, IncompatibleClassChangeError ex = ");
|
||||
message = e2.getMessage();
|
||||
sb.append(message);
|
||||
str2 = sb.toString();
|
||||
Log.e("MicroMsg.SDK.NetUtil", str2);
|
||||
return null;
|
||||
} catch (Throwable th) {
|
||||
sb = new StringBuilder("httpGet, Throwable ex = ");
|
||||
message = th.getMessage();
|
||||
sb.append(message);
|
||||
str2 = sb.toString();
|
||||
Log.e("MicroMsg.SDK.NetUtil", str2);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
HttpResponse execute = defaultHttpClient.execute(httpGet);
|
||||
if (execute.getStatusLine().getStatusCode() == 200) {
|
||||
return EntityUtils.toByteArray(execute.getEntity());
|
||||
}
|
||||
Log.e("MicroMsg.SDK.NetUtil", "httpGet fail, status code = " + execute.getStatusLine().getStatusCode());
|
||||
return null;
|
||||
}
|
||||
str2 = "httpGet, url is null";
|
||||
Log.e("MicroMsg.SDK.NetUtil", str2);
|
||||
return null;
|
||||
}
|
||||
}
|
146
sources/com/tencent/mm/opensdk/diffdev/a/f.java
Normal file
146
sources/com/tencent/mm/opensdk/diffdev/a/f.java
Normal file
@@ -0,0 +1,146 @@
|
||||
package com.tencent.mm.opensdk.diffdev.a;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
import com.tencent.mm.opensdk.diffdev.OAuthErrCode;
|
||||
import com.tencent.mm.opensdk.diffdev.OAuthListener;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class f extends AsyncTask<Void, Void, a> {
|
||||
private OAuthListener ai;
|
||||
private String al;
|
||||
private int ar;
|
||||
private String url;
|
||||
|
||||
static class a {
|
||||
public OAuthErrCode ak;
|
||||
public String as;
|
||||
|
||||
/* renamed from: at, reason: collision with root package name */
|
||||
public int f2at;
|
||||
|
||||
a() {
|
||||
}
|
||||
|
||||
public static a d(byte[] bArr) {
|
||||
OAuthErrCode oAuthErrCode;
|
||||
String format;
|
||||
OAuthErrCode oAuthErrCode2;
|
||||
a aVar = new a();
|
||||
if (bArr == null || bArr.length == 0) {
|
||||
Log.e("MicroMsg.SDK.NoopingResult", "parse fail, buf is null");
|
||||
oAuthErrCode = OAuthErrCode.WechatAuth_Err_NetworkErr;
|
||||
} else {
|
||||
try {
|
||||
try {
|
||||
JSONObject jSONObject = new JSONObject(new String(bArr, "utf-8"));
|
||||
aVar.f2at = jSONObject.getInt("wx_errcode");
|
||||
Log.d("MicroMsg.SDK.NoopingResult", String.format("nooping uuidStatusCode = %d", Integer.valueOf(aVar.f2at)));
|
||||
int i = aVar.f2at;
|
||||
if (i == 408) {
|
||||
oAuthErrCode2 = OAuthErrCode.WechatAuth_Err_OK;
|
||||
} else if (i != 500) {
|
||||
switch (i) {
|
||||
case 402:
|
||||
oAuthErrCode2 = OAuthErrCode.WechatAuth_Err_Timeout;
|
||||
break;
|
||||
case 403:
|
||||
oAuthErrCode2 = OAuthErrCode.WechatAuth_Err_Cancel;
|
||||
break;
|
||||
case 404:
|
||||
oAuthErrCode2 = OAuthErrCode.WechatAuth_Err_OK;
|
||||
break;
|
||||
case 405:
|
||||
aVar.ak = OAuthErrCode.WechatAuth_Err_OK;
|
||||
aVar.as = jSONObject.getString("wx_code");
|
||||
return aVar;
|
||||
default:
|
||||
oAuthErrCode2 = OAuthErrCode.WechatAuth_Err_NormalErr;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
oAuthErrCode2 = OAuthErrCode.WechatAuth_Err_NormalErr;
|
||||
}
|
||||
aVar.ak = oAuthErrCode2;
|
||||
return aVar;
|
||||
} catch (Exception e) {
|
||||
format = String.format("parse json fail, ex = %s", e.getMessage());
|
||||
Log.e("MicroMsg.SDK.NoopingResult", format);
|
||||
oAuthErrCode = OAuthErrCode.WechatAuth_Err_NormalErr;
|
||||
aVar.ak = oAuthErrCode;
|
||||
return aVar;
|
||||
}
|
||||
} catch (Exception e2) {
|
||||
format = String.format("parse fail, build String fail, ex = %s", e2.getMessage());
|
||||
}
|
||||
}
|
||||
aVar.ak = oAuthErrCode;
|
||||
return aVar;
|
||||
}
|
||||
}
|
||||
|
||||
public f(String str, OAuthListener oAuthListener) {
|
||||
this.al = str;
|
||||
this.ai = oAuthListener;
|
||||
this.url = String.format("https://long.open.weixin.qq.com/connect/l/qrconnect?f=json&uuid=%s", str);
|
||||
}
|
||||
|
||||
@Override // android.os.AsyncTask
|
||||
protected final /* synthetic */ a doInBackground(Void[] voidArr) {
|
||||
a aVar;
|
||||
OAuthErrCode oAuthErrCode;
|
||||
String str;
|
||||
String str2 = this.al;
|
||||
if (str2 == null || str2.length() == 0) {
|
||||
Log.e("MicroMsg.SDK.NoopingTask", "run fail, uuid is null");
|
||||
aVar = new a();
|
||||
oAuthErrCode = OAuthErrCode.WechatAuth_Err_NormalErr;
|
||||
} else {
|
||||
while (!isCancelled()) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(this.url);
|
||||
if (this.ar == 0) {
|
||||
str = "";
|
||||
} else {
|
||||
str = "&last=" + this.ar;
|
||||
}
|
||||
sb.append(str);
|
||||
String sb2 = sb.toString();
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
byte[] b = e.b(sb2, 60000);
|
||||
long currentTimeMillis2 = System.currentTimeMillis();
|
||||
a d = a.d(b);
|
||||
Log.d("MicroMsg.SDK.NoopingTask", String.format("nooping, url = %s, errCode = %s, uuidStatusCode = %d, time consumed = %d(ms)", sb2, d.ak.toString(), Integer.valueOf(d.f2at), Long.valueOf(currentTimeMillis2 - currentTimeMillis)));
|
||||
OAuthErrCode oAuthErrCode2 = d.ak;
|
||||
if (oAuthErrCode2 != OAuthErrCode.WechatAuth_Err_OK) {
|
||||
Log.e("MicroMsg.SDK.NoopingTask", String.format("nooping fail, errCode = %s, uuidStatusCode = %d", oAuthErrCode2.toString(), Integer.valueOf(d.f2at)));
|
||||
return d;
|
||||
}
|
||||
int i = d.f2at;
|
||||
this.ar = i;
|
||||
if (i == g.UUID_SCANED.getCode()) {
|
||||
this.ai.onQrcodeScanned();
|
||||
} else if (d.f2at != g.UUID_KEEP_CONNECT.getCode() && d.f2at == g.UUID_CONFIRM.getCode()) {
|
||||
String str3 = d.as;
|
||||
if (str3 == null || str3.length() == 0) {
|
||||
Log.e("MicroMsg.SDK.NoopingTask", "nooping fail, confirm with an empty code!!!");
|
||||
d.ak = OAuthErrCode.WechatAuth_Err_NormalErr;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
}
|
||||
Log.i("MicroMsg.SDK.NoopingTask", "IDiffDevOAuth.stopAuth / detach invoked");
|
||||
aVar = new a();
|
||||
oAuthErrCode = OAuthErrCode.WechatAuth_Err_Auth_Stopped;
|
||||
}
|
||||
aVar.ak = oAuthErrCode;
|
||||
return aVar;
|
||||
}
|
||||
|
||||
@Override // android.os.AsyncTask
|
||||
protected final /* synthetic */ void onPostExecute(a aVar) {
|
||||
a aVar2 = aVar;
|
||||
this.ai.onAuthFinish(aVar2.ak, aVar2.as);
|
||||
}
|
||||
}
|
28
sources/com/tencent/mm/opensdk/diffdev/a/g.java
Normal file
28
sources/com/tencent/mm/opensdk/diffdev/a/g.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.tencent.mm.opensdk.diffdev.a;
|
||||
|
||||
import com.ubt.jimu.base.mvp.SingleClickListener;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum g {
|
||||
UUID_EXPIRED(402),
|
||||
UUID_CANCELED(403),
|
||||
UUID_SCANED(404),
|
||||
UUID_CONFIRM(405),
|
||||
UUID_KEEP_CONNECT(408),
|
||||
UUID_ERROR(SingleClickListener.FAST_CLICK_DELAY_TIME);
|
||||
|
||||
private int code;
|
||||
|
||||
g(int i) {
|
||||
this.code = i;
|
||||
}
|
||||
|
||||
public final int getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
@Override // java.lang.Enum
|
||||
public final String toString() {
|
||||
return "UUIDStatusCode:" + this.code;
|
||||
}
|
||||
}
|
25
sources/com/tencent/mm/opensdk/modelbase/BaseReq.java
Normal file
25
sources/com/tencent/mm/opensdk/modelbase/BaseReq.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.tencent.mm.opensdk.modelbase;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.utils.a;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class BaseReq {
|
||||
public String openId;
|
||||
public String transaction;
|
||||
|
||||
public abstract boolean checkArgs();
|
||||
|
||||
public void fromBundle(Bundle bundle) {
|
||||
this.transaction = a.b(bundle, "_wxapi_basereq_transaction");
|
||||
this.openId = a.b(bundle, "_wxapi_basereq_openid");
|
||||
}
|
||||
|
||||
public abstract int getType();
|
||||
|
||||
public void toBundle(Bundle bundle) {
|
||||
bundle.putInt("_wxapi_command_type", getType());
|
||||
bundle.putString("_wxapi_basereq_transaction", this.transaction);
|
||||
bundle.putString("_wxapi_basereq_openid", this.openId);
|
||||
}
|
||||
}
|
40
sources/com/tencent/mm/opensdk/modelbase/BaseResp.java
Normal file
40
sources/com/tencent/mm/opensdk/modelbase/BaseResp.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.tencent.mm.opensdk.modelbase;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class BaseResp {
|
||||
public int errCode;
|
||||
public String errStr;
|
||||
public String openId;
|
||||
public String transaction;
|
||||
|
||||
public interface ErrCode {
|
||||
public static final int ERR_AUTH_DENIED = -4;
|
||||
public static final int ERR_BAN = -6;
|
||||
public static final int ERR_COMM = -1;
|
||||
public static final int ERR_OK = 0;
|
||||
public static final int ERR_SENT_FAILED = -3;
|
||||
public static final int ERR_UNSUPPORT = -5;
|
||||
public static final int ERR_USER_CANCEL = -2;
|
||||
}
|
||||
|
||||
public abstract boolean checkArgs();
|
||||
|
||||
public void fromBundle(Bundle bundle) {
|
||||
this.errCode = bundle.getInt("_wxapi_baseresp_errcode");
|
||||
this.errStr = bundle.getString("_wxapi_baseresp_errstr");
|
||||
this.transaction = bundle.getString("_wxapi_baseresp_transaction");
|
||||
this.openId = bundle.getString("_wxapi_baseresp_openId");
|
||||
}
|
||||
|
||||
public abstract int getType();
|
||||
|
||||
public void toBundle(Bundle bundle) {
|
||||
bundle.putInt("_wxapi_command_type", getType());
|
||||
bundle.putInt("_wxapi_baseresp_errcode", this.errCode);
|
||||
bundle.putString("_wxapi_baseresp_errstr", this.errStr);
|
||||
bundle.putString("_wxapi_baseresp_transaction", this.transaction);
|
||||
bundle.putString("_wxapi_baseresp_openId", this.openId);
|
||||
}
|
||||
}
|
@@ -0,0 +1,144 @@
|
||||
package com.tencent.mm.opensdk.modelbiz;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.json.JSONStringer;
|
||||
import org.json.JSONTokener;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AddCardToWXCardPackage {
|
||||
private static final String TAG = "MicroMsg.AddCardToWXCardPackage";
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
public List<WXCardItem> cardArrary;
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2;
|
||||
List<WXCardItem> list = this.cardArrary;
|
||||
if (list == null || list.size() == 0 || this.cardArrary.size() > 40) {
|
||||
return false;
|
||||
}
|
||||
for (WXCardItem wXCardItem : this.cardArrary) {
|
||||
if (wXCardItem == null || (str = wXCardItem.cardId) == null || str.length() > 1024 || ((str2 = wXCardItem.cardExtMsg) != null && str2.length() > 1024)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 9;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
JSONStringer jSONStringer = new JSONStringer();
|
||||
try {
|
||||
jSONStringer.object();
|
||||
jSONStringer.key("card_list");
|
||||
jSONStringer.array();
|
||||
for (WXCardItem wXCardItem : this.cardArrary) {
|
||||
jSONStringer.object();
|
||||
jSONStringer.key("card_id");
|
||||
jSONStringer.value(wXCardItem.cardId);
|
||||
jSONStringer.key("card_ext");
|
||||
jSONStringer.value(wXCardItem.cardExtMsg == null ? "" : wXCardItem.cardExtMsg);
|
||||
jSONStringer.endObject();
|
||||
}
|
||||
jSONStringer.endArray();
|
||||
jSONStringer.endObject();
|
||||
} catch (Exception e) {
|
||||
Log.e(AddCardToWXCardPackage.TAG, "Req.toBundle exception:" + e.getMessage());
|
||||
}
|
||||
bundle.putString("_wxapi_add_card_to_wx_card_list", jSONStringer.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public static class Resp extends BaseResp {
|
||||
public List<WXCardItem> cardArrary;
|
||||
|
||||
public Resp() {
|
||||
}
|
||||
|
||||
public Resp(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public boolean checkArgs() {
|
||||
List<WXCardItem> list = this.cardArrary;
|
||||
return (list == null || list.size() == 0) ? false : true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
if (this.cardArrary == null) {
|
||||
this.cardArrary = new LinkedList();
|
||||
}
|
||||
String string = bundle.getString("_wxapi_add_card_to_wx_card_list");
|
||||
if (string == null || string.length() <= 0) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
JSONArray jSONArray = ((JSONObject) new JSONTokener(string).nextValue()).getJSONArray("card_list");
|
||||
for (int i = 0; i < jSONArray.length(); i++) {
|
||||
JSONObject jSONObject = jSONArray.getJSONObject(i);
|
||||
WXCardItem wXCardItem = new WXCardItem();
|
||||
wXCardItem.cardId = jSONObject.optString("card_id");
|
||||
wXCardItem.cardExtMsg = jSONObject.optString("card_ext");
|
||||
wXCardItem.cardState = jSONObject.optInt("is_succ");
|
||||
this.cardArrary.add(wXCardItem);
|
||||
}
|
||||
} catch (Exception unused) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public int getType() {
|
||||
return 9;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
JSONStringer jSONStringer = new JSONStringer();
|
||||
try {
|
||||
jSONStringer.object();
|
||||
jSONStringer.key("card_list");
|
||||
jSONStringer.array();
|
||||
for (WXCardItem wXCardItem : this.cardArrary) {
|
||||
jSONStringer.object();
|
||||
jSONStringer.key("card_id");
|
||||
jSONStringer.value(wXCardItem.cardId);
|
||||
jSONStringer.key("card_ext");
|
||||
jSONStringer.value(wXCardItem.cardExtMsg == null ? "" : wXCardItem.cardExtMsg);
|
||||
jSONStringer.key("is_succ");
|
||||
jSONStringer.value(wXCardItem.cardState);
|
||||
jSONStringer.endObject();
|
||||
}
|
||||
jSONStringer.endArray();
|
||||
jSONStringer.endObject();
|
||||
} catch (Exception e) {
|
||||
Log.e(AddCardToWXCardPackage.TAG, "Resp.toBundle exception:" + e.getMessage());
|
||||
}
|
||||
bundle.putString("_wxapi_add_card_to_wx_card_list", jSONStringer.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public static final class WXCardItem {
|
||||
public String cardExtMsg;
|
||||
public String cardId;
|
||||
public int cardState;
|
||||
}
|
||||
}
|
@@ -0,0 +1,89 @@
|
||||
package com.tencent.mm.opensdk.modelbiz;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ChooseCardFromWXCardPackage {
|
||||
private static final String TAG = "MicroMsg.ChooseCardFromWXCardPackage";
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
public String appId;
|
||||
public String canMultiSelect;
|
||||
public String cardId;
|
||||
public String cardSign;
|
||||
public String cardType;
|
||||
public String locationId;
|
||||
public String nonceStr;
|
||||
public String signType;
|
||||
public String timeStamp;
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2;
|
||||
String str3 = this.appId;
|
||||
return str3 != null && str3.length() > 0 && (str = this.signType) != null && str.length() > 0 && (str2 = this.cardSign) != null && str2.length() > 0;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 16;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_choose_card_from_wx_card_app_id", this.appId);
|
||||
bundle.putString("_wxapi_choose_card_from_wx_card_location_id", this.locationId);
|
||||
bundle.putString("_wxapi_choose_card_from_wx_card_sign_type", this.signType);
|
||||
bundle.putString("_wxapi_choose_card_from_wx_card_card_sign", this.cardSign);
|
||||
bundle.putString("_wxapi_choose_card_from_wx_card_time_stamp", this.timeStamp);
|
||||
bundle.putString("_wxapi_choose_card_from_wx_card_nonce_str", this.nonceStr);
|
||||
bundle.putString("_wxapi_choose_card_from_wx_card_card_id", this.cardId);
|
||||
bundle.putString("_wxapi_choose_card_from_wx_card_card_type", this.cardType);
|
||||
bundle.putString("_wxapi_choose_card_from_wx_card_can_multi_select", this.canMultiSelect);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Resp extends BaseResp {
|
||||
public String cardItemList;
|
||||
|
||||
public Resp() {
|
||||
}
|
||||
|
||||
public Resp(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public boolean checkArgs() {
|
||||
String str = this.cardItemList;
|
||||
return (str == null || str.length() == 0) ? false : true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
String string = bundle.getString("_wxapi_choose_card_from_wx_card_list");
|
||||
if (string == null || string.length() <= 0) {
|
||||
Log.i(ChooseCardFromWXCardPackage.TAG, "cardItemList is empty!");
|
||||
} else {
|
||||
this.cardItemList = string;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public int getType() {
|
||||
return 16;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_choose_card_from_wx_card_list", this.cardItemList);
|
||||
}
|
||||
}
|
||||
}
|
73
sources/com/tencent/mm/opensdk/modelbiz/CreateChatroom.java
Normal file
73
sources/com/tencent/mm/opensdk/modelbiz/CreateChatroom.java
Normal file
@@ -0,0 +1,73 @@
|
||||
package com.tencent.mm.opensdk.modelbiz;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.utils.d;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class CreateChatroom {
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
public String chatroomName;
|
||||
public String chatroomNickName;
|
||||
public String extMsg;
|
||||
public String groupId = "";
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
return !d.h(this.groupId);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 14;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_create_chatroom_group_id", this.groupId);
|
||||
bundle.putString("_wxapi_create_chatroom_chatroom_name", this.chatroomName);
|
||||
bundle.putString("_wxapi_create_chatroom_chatroom_nickname", this.chatroomNickName);
|
||||
bundle.putString("_wxapi_create_chatroom_ext_msg", this.extMsg);
|
||||
bundle.putString("_wxapi_basereq_openid", this.openId);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Resp extends BaseResp {
|
||||
public String extMsg;
|
||||
|
||||
public Resp() {
|
||||
}
|
||||
|
||||
public Resp(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public boolean checkArgs() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.extMsg = bundle.getString("_wxapi_create_chatroom_ext_msg");
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public int getType() {
|
||||
return 14;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_create_chatroom_ext_msg", this.extMsg);
|
||||
}
|
||||
}
|
||||
|
||||
private CreateChatroom() {
|
||||
}
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
package com.tencent.mm.opensdk.modelbiz;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HandleScanResult {
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
private static final int MAX_URL_LENGHT = 10240;
|
||||
public String scanResult;
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
String str = this.scanResult;
|
||||
return str != null && str.length() >= 0 && this.scanResult.length() <= MAX_URL_LENGHT;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 17;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_scan_qrcode_result", URLEncoder.encode(this.scanResult));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Resp extends BaseResp {
|
||||
public Resp() {
|
||||
}
|
||||
|
||||
public Resp(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public boolean checkArgs() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public int getType() {
|
||||
return 17;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
}
|
||||
}
|
||||
}
|
71
sources/com/tencent/mm/opensdk/modelbiz/JoinChatroom.java
Normal file
71
sources/com/tencent/mm/opensdk/modelbiz/JoinChatroom.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package com.tencent.mm.opensdk.modelbiz;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.utils.d;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class JoinChatroom {
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
public String chatroomNickName;
|
||||
public String extMsg;
|
||||
public String groupId = "";
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
return !d.h(this.groupId);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 15;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_join_chatroom_group_id", this.groupId);
|
||||
bundle.putString("_wxapi_join_chatroom_chatroom_nickname", this.chatroomNickName);
|
||||
bundle.putString("_wxapi_join_chatroom_ext_msg", this.extMsg);
|
||||
bundle.putString("_wxapi_basereq_openid", this.openId);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Resp extends BaseResp {
|
||||
public String extMsg;
|
||||
|
||||
public Resp() {
|
||||
}
|
||||
|
||||
public Resp(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public boolean checkArgs() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.extMsg = bundle.getString("_wxapi_join_chatroom_ext_msg");
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public int getType() {
|
||||
return 15;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_join_chatroom_ext_msg", this.extMsg);
|
||||
}
|
||||
}
|
||||
|
||||
private JoinChatroom() {
|
||||
}
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
package com.tencent.mm.opensdk.modelbiz;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class JumpToBizProfile {
|
||||
public static final int JUMP_TO_HARD_WARE_BIZ_PROFILE = 1;
|
||||
public static final int JUMP_TO_NORMAL_BIZ_PROFILE = 0;
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
private static final int EXT_MSG_LENGTH = 1024;
|
||||
private static final String TAG = "MicroMsg.SDK.JumpToBizProfile.Req";
|
||||
public String extMsg;
|
||||
public int profileType = 0;
|
||||
public String toUserName;
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2;
|
||||
String str3 = this.toUserName;
|
||||
if (str3 == null || str3.length() == 0) {
|
||||
str = "checkArgs fail, toUserName is invalid";
|
||||
} else {
|
||||
String str4 = this.extMsg;
|
||||
if (str4 != null && str4.length() > 1024) {
|
||||
str = "ext msg is not null, while the length exceed 1024 bytes";
|
||||
} else {
|
||||
if (this.profileType != 1 || ((str2 = this.extMsg) != null && str2.length() != 0)) {
|
||||
return true;
|
||||
}
|
||||
str = "scene is jump to hardware profile, while extmsg is null";
|
||||
}
|
||||
}
|
||||
Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.toUserName = bundle.getString("_wxapi_jump_to_biz_profile_req_to_user_name");
|
||||
this.extMsg = bundle.getString("_wxapi_jump_to_biz_profile_req_ext_msg");
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 7;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_jump_to_biz_profile_req_to_user_name", this.toUserName);
|
||||
bundle.putString("_wxapi_jump_to_biz_profile_req_ext_msg", this.extMsg);
|
||||
bundle.putInt("_wxapi_jump_to_biz_profile_req_scene", 0);
|
||||
bundle.putInt("_wxapi_jump_to_biz_profile_req_profile_type", this.profileType);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
package com.tencent.mm.opensdk.modelbiz;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class JumpToBizTempSession {
|
||||
public static final int SHOW_CHAT = 1;
|
||||
public static final int SHOW_MENU = 0;
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
private static final int MAX_SESSION_FROM_LENGTH = 1024;
|
||||
private static final String TAG = "MicroMsg.SDK.JumpToBizTempSession.Req";
|
||||
public String sessionFrom;
|
||||
public int showType;
|
||||
public String toUserName;
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2 = this.toUserName;
|
||||
if (str2 == null || str2.length() <= 0) {
|
||||
str = "checkArgs fail, toUserName is invalid";
|
||||
} else {
|
||||
String str3 = this.sessionFrom;
|
||||
if (str3 != null && str3.length() <= 1024) {
|
||||
return true;
|
||||
}
|
||||
str = "checkArgs fail, sessionFrom is invalid";
|
||||
}
|
||||
Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_jump_to_biz_webview_req_to_user_name", this.toUserName);
|
||||
bundle.putString("_wxapi_jump_to_biz_webview_req_session_from", this.sessionFrom);
|
||||
bundle.putInt("_wxapi_jump_to_biz_webview_req_show_type", this.showType);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
package com.tencent.mm.opensdk.modelbiz;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class JumpToBizWebview {
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
private static final int EXT_MSG_LENGTH = 1024;
|
||||
private static final String TAG = "MicroMsg.SDK.JumpToBizWebview.Req";
|
||||
public String extMsg;
|
||||
public int scene = 1;
|
||||
public String toUserName;
|
||||
public int webType;
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2 = this.toUserName;
|
||||
if (str2 == null || str2.length() <= 0) {
|
||||
str = "checkArgs fail, toUserName is invalid";
|
||||
} else {
|
||||
String str3 = this.extMsg;
|
||||
if (str3 == null || str3.length() <= 1024) {
|
||||
return true;
|
||||
}
|
||||
str = "ext msg is not null, while the length exceed 1024 bytes";
|
||||
}
|
||||
Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_jump_to_biz_webview_req_to_user_name", this.toUserName);
|
||||
bundle.putString("_wxapi_jump_to_biz_webview_req_ext_msg", this.extMsg);
|
||||
bundle.putInt("_wxapi_jump_to_biz_webview_req_web_type", this.webType);
|
||||
bundle.putInt("_wxapi_jump_to_biz_webview_req_scene", this.scene);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
package com.tencent.mm.opensdk.modelbiz;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class OpenBusiLuckyMoney {
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
private static final int MAX_URL_LENGHT = 10240;
|
||||
public String appId;
|
||||
public String nonceStr;
|
||||
public String packageExt;
|
||||
public String signType;
|
||||
public String signature;
|
||||
public String timeStamp;
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2;
|
||||
String str3;
|
||||
String str4;
|
||||
String str5 = this.appId;
|
||||
return str5 != null && str5.length() > 0 && (str = this.timeStamp) != null && str.length() > 0 && (str2 = this.nonceStr) != null && str2.length() > 0 && (str3 = this.signType) != null && str3.length() > 0 && (str4 = this.signature) != null && str4.length() > 0;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 13;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_open_busi_lucky_money_appid", this.appId);
|
||||
bundle.putString("_wxapi_open_busi_lucky_money_timeStamp", this.timeStamp);
|
||||
bundle.putString("_wxapi_open_busi_lucky_money_nonceStr", this.nonceStr);
|
||||
bundle.putString("_wxapi_open_busi_lucky_money_signType", this.signType);
|
||||
bundle.putString("_wxapi_open_busi_lucky_money_signature", this.signature);
|
||||
bundle.putString("_wxapi_open_busi_lucky_money_package", this.packageExt);
|
||||
}
|
||||
}
|
||||
}
|
19
sources/com/tencent/mm/opensdk/modelbiz/OpenRankList.java
Normal file
19
sources/com/tencent/mm/opensdk/modelbiz/OpenRankList.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.tencent.mm.opensdk.modelbiz;
|
||||
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class OpenRankList {
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 11;
|
||||
}
|
||||
}
|
||||
}
|
65
sources/com/tencent/mm/opensdk/modelbiz/OpenWebview.java
Normal file
65
sources/com/tencent/mm/opensdk/modelbiz/OpenWebview.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package com.tencent.mm.opensdk.modelbiz;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class OpenWebview {
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
private static final int MAX_URL_LENGHT = 10240;
|
||||
public String url;
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
String str = this.url;
|
||||
return str != null && str.length() >= 0 && this.url.length() <= MAX_URL_LENGHT;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 12;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_jump_to_webview_url", URLEncoder.encode(this.url));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Resp extends BaseResp {
|
||||
public String result;
|
||||
|
||||
public Resp() {
|
||||
}
|
||||
|
||||
public Resp(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public boolean checkArgs() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.result = bundle.getString("_wxapi_open_webview_result");
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public int getType() {
|
||||
return 12;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_open_webview_result", this.result);
|
||||
}
|
||||
}
|
||||
}
|
111
sources/com/tencent/mm/opensdk/modelbiz/SubscribeMessage.java
Normal file
111
sources/com/tencent/mm/opensdk/modelbiz/SubscribeMessage.java
Normal file
@@ -0,0 +1,111 @@
|
||||
package com.tencent.mm.opensdk.modelbiz;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class SubscribeMessage {
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
private static final int LENGTH_LIMIT = 1024;
|
||||
private static final String TAG = "MicroMsg.SDK.SubscribeMessage.Req";
|
||||
public String reserved;
|
||||
public int scene;
|
||||
public String templateID;
|
||||
|
||||
public Req() {
|
||||
}
|
||||
|
||||
public Req(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2 = this.templateID;
|
||||
if (str2 == null || str2.length() == 0) {
|
||||
str = "checkArgs fail, templateID is null";
|
||||
} else if (this.templateID.length() > 1024) {
|
||||
str = "checkArgs fail, templateID is too long";
|
||||
} else {
|
||||
String str3 = this.reserved;
|
||||
if (str3 == null || str3.length() <= 1024) {
|
||||
return true;
|
||||
}
|
||||
str = "checkArgs fail, reserved is too long";
|
||||
}
|
||||
Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.scene = bundle.getInt("_wxapi_subscribemessage_req_scene");
|
||||
this.templateID = bundle.getString("_wxapi_subscribemessage_req_templateid");
|
||||
this.reserved = bundle.getString("_wxapi_subscribemessage_req_reserved");
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 18;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putInt("_wxapi_subscribemessage_req_scene", this.scene);
|
||||
bundle.putString("_wxapi_subscribemessage_req_templateid", this.templateID);
|
||||
bundle.putString("_wxapi_subscribemessage_req_reserved", this.reserved);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Resp extends BaseResp {
|
||||
private static final String TAG = "MicroMsg.SDK.SubscribeMessage.Resp";
|
||||
public String action;
|
||||
public String reserved;
|
||||
public int scene;
|
||||
public String templateID;
|
||||
|
||||
public Resp() {
|
||||
}
|
||||
|
||||
public Resp(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public boolean checkArgs() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.templateID = bundle.getString("_wxapi_subscribemessage_resp_templateid");
|
||||
this.scene = bundle.getInt("_wxapi_subscribemessage_resp_scene");
|
||||
this.action = bundle.getString("_wxapi_subscribemessage_resp_action");
|
||||
this.reserved = bundle.getString("_wxapi_subscribemessage_resp_reserved");
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public int getType() {
|
||||
return 18;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_subscribemessage_resp_templateid", this.templateID);
|
||||
bundle.putInt("_wxapi_subscribemessage_resp_scene", this.scene);
|
||||
bundle.putString("_wxapi_subscribemessage_resp_action", this.action);
|
||||
bundle.putString("_wxapi_subscribemessage_resp_reserved", this.reserved);
|
||||
}
|
||||
}
|
||||
|
||||
private SubscribeMessage() {
|
||||
}
|
||||
}
|
@@ -0,0 +1,90 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class GetMessageFromWX {
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
public String country;
|
||||
public String lang;
|
||||
public String username;
|
||||
|
||||
public Req() {
|
||||
}
|
||||
|
||||
public Req(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.lang = bundle.getString("_wxapi_getmessage_req_lang");
|
||||
this.country = bundle.getString("_wxapi_getmessage_req_country");
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_getmessage_req_lang", this.lang);
|
||||
bundle.putString("_wxapi_getmessage_req_country", this.country);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Resp extends BaseResp {
|
||||
private static final String TAG = "MicroMsg.SDK.GetMessageFromWX.Resp";
|
||||
public WXMediaMessage message;
|
||||
|
||||
public Resp() {
|
||||
}
|
||||
|
||||
public Resp(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public boolean checkArgs() {
|
||||
WXMediaMessage wXMediaMessage = this.message;
|
||||
if (wXMediaMessage != null) {
|
||||
return wXMediaMessage.checkArgs();
|
||||
}
|
||||
Log.e(TAG, "checkArgs fail, message is null");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.message = WXMediaMessage.Builder.fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public int getType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putAll(WXMediaMessage.Builder.toBundle(this.message));
|
||||
}
|
||||
}
|
||||
|
||||
private GetMessageFromWX() {
|
||||
}
|
||||
}
|
89
sources/com/tencent/mm/opensdk/modelmsg/LaunchFromWX.java
Normal file
89
sources/com/tencent/mm/opensdk/modelmsg/LaunchFromWX.java
Normal file
@@ -0,0 +1,89 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class LaunchFromWX {
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
private static final int MESSAGE_ACTION_LENGTH_LIMIT = 2048;
|
||||
private static final int MESSAGE_EXT_LENGTH_LIMIT = 2048;
|
||||
private static final String TAG = "MicroMsg.SDK.LaunchFromWX.Req";
|
||||
public String country;
|
||||
public String lang;
|
||||
public String messageAction;
|
||||
public String messageExt;
|
||||
|
||||
public Req() {
|
||||
}
|
||||
|
||||
public Req(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2 = this.messageAction;
|
||||
if (str2 == null || str2.length() <= 2048) {
|
||||
String str3 = this.messageExt;
|
||||
if (str3 == null || str3.length() <= 2048) {
|
||||
return true;
|
||||
}
|
||||
str = "checkArgs fail, messageExt is too long";
|
||||
} else {
|
||||
str = "checkArgs fail, messageAction is too long";
|
||||
}
|
||||
Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.messageAction = bundle.getString("_wxobject_message_action");
|
||||
this.messageExt = bundle.getString("_wxobject_message_ext");
|
||||
this.lang = bundle.getString("_wxapi_launch_req_lang");
|
||||
this.country = bundle.getString("_wxapi_launch_req_country");
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 6;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxobject_message_action", this.messageAction);
|
||||
bundle.putString("_wxobject_message_ext", this.messageExt);
|
||||
bundle.putString("_wxapi_launch_req_lang", this.lang);
|
||||
bundle.putString("_wxapi_launch_req_country", this.country);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Resp extends BaseResp {
|
||||
public Resp() {
|
||||
}
|
||||
|
||||
public Resp(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public boolean checkArgs() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public int getType() {
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
|
||||
private LaunchFromWX() {
|
||||
}
|
||||
}
|
115
sources/com/tencent/mm/opensdk/modelmsg/SendAuth.java
Normal file
115
sources/com/tencent/mm/opensdk/modelmsg/SendAuth.java
Normal file
@@ -0,0 +1,115 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class SendAuth {
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
private static final int LENGTH_LIMIT = 1024;
|
||||
private static final String TAG = "MicroMsg.SDK.SendAuth.Req";
|
||||
public String scope;
|
||||
public String state;
|
||||
|
||||
public Req() {
|
||||
}
|
||||
|
||||
public Req(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2 = this.scope;
|
||||
if (str2 == null || str2.length() == 0 || this.scope.length() > 1024) {
|
||||
str = "checkArgs fail, scope is invalid";
|
||||
} else {
|
||||
String str3 = this.state;
|
||||
if (str3 == null || str3.length() <= 1024) {
|
||||
return true;
|
||||
}
|
||||
str = "checkArgs fail, state is invalid";
|
||||
}
|
||||
Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.scope = bundle.getString("_wxapi_sendauth_req_scope");
|
||||
this.state = bundle.getString("_wxapi_sendauth_req_state");
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_sendauth_req_scope", this.scope);
|
||||
bundle.putString("_wxapi_sendauth_req_state", this.state);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Resp extends BaseResp {
|
||||
private static final int LENGTH_LIMIT = 1024;
|
||||
private static final String TAG = "MicroMsg.SDK.SendAuth.Resp";
|
||||
public String code;
|
||||
public String country;
|
||||
public String lang;
|
||||
public String state;
|
||||
public String url;
|
||||
|
||||
public Resp() {
|
||||
}
|
||||
|
||||
public Resp(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public boolean checkArgs() {
|
||||
String str = this.state;
|
||||
if (str == null || str.length() <= 1024) {
|
||||
return true;
|
||||
}
|
||||
Log.e(TAG, "checkArgs fail, state is invalid");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.code = bundle.getString("_wxapi_sendauth_resp_token");
|
||||
this.state = bundle.getString("_wxapi_sendauth_resp_state");
|
||||
this.url = bundle.getString("_wxapi_sendauth_resp_url");
|
||||
this.lang = bundle.getString("_wxapi_sendauth_resp_lang");
|
||||
this.country = bundle.getString("_wxapi_sendauth_resp_country");
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public int getType() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_sendauth_resp_token", this.code);
|
||||
bundle.putString("_wxapi_sendauth_resp_state", this.state);
|
||||
bundle.putString("_wxapi_sendauth_resp_url", this.url);
|
||||
bundle.putString("_wxapi_sendauth_resp_lang", this.lang);
|
||||
bundle.putString("_wxapi_sendauth_resp_country", this.country);
|
||||
}
|
||||
}
|
||||
|
||||
private SendAuth() {
|
||||
}
|
||||
}
|
93
sources/com/tencent/mm/opensdk/modelmsg/SendMessageToWX.java
Normal file
93
sources/com/tencent/mm/opensdk/modelmsg/SendMessageToWX.java
Normal file
@@ -0,0 +1,93 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class SendMessageToWX {
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
private static final int FAV_CONTENT_LENGTH_LIMIT = 26214400;
|
||||
private static final String TAG = "MicroMsg.SDK.SendMessageToWX.Req";
|
||||
public static final int WXSceneFavorite = 2;
|
||||
public static final int WXSceneSession = 0;
|
||||
public static final int WXSceneTimeline = 1;
|
||||
public WXMediaMessage message;
|
||||
public int scene;
|
||||
|
||||
public Req() {
|
||||
}
|
||||
|
||||
public Req(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
WXMediaMessage wXMediaMessage = this.message;
|
||||
if (wXMediaMessage == null) {
|
||||
Log.e(TAG, "checkArgs fail ,message is null");
|
||||
return false;
|
||||
}
|
||||
if (wXMediaMessage.mediaObject.type() == 6 && this.scene == 2) {
|
||||
((WXFileObject) this.message.mediaObject).setContentLengthLimit(FAV_CONTENT_LENGTH_LIMIT);
|
||||
}
|
||||
return this.message.checkArgs();
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.message = WXMediaMessage.Builder.fromBundle(bundle);
|
||||
this.scene = bundle.getInt("_wxapi_sendmessagetowx_req_scene");
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putAll(WXMediaMessage.Builder.toBundle(this.message));
|
||||
bundle.putInt("_wxapi_sendmessagetowx_req_scene", this.scene);
|
||||
bundle.putInt("_wxapi_sendmessagetowx_req_media_type", this.message.getType());
|
||||
}
|
||||
}
|
||||
|
||||
public static class Resp extends BaseResp {
|
||||
public Resp() {
|
||||
}
|
||||
|
||||
public Resp(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public boolean checkArgs() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public int getType() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
}
|
||||
}
|
||||
|
||||
private SendMessageToWX() {
|
||||
}
|
||||
}
|
@@ -0,0 +1,76 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ShowMessageFromWX {
|
||||
|
||||
public static class Req extends BaseReq {
|
||||
public String country;
|
||||
public String lang;
|
||||
public WXMediaMessage message;
|
||||
|
||||
public Req() {
|
||||
}
|
||||
|
||||
public Req(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
WXMediaMessage wXMediaMessage = this.message;
|
||||
if (wXMediaMessage == null) {
|
||||
return false;
|
||||
}
|
||||
return wXMediaMessage.checkArgs();
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.lang = bundle.getString("_wxapi_showmessage_req_lang");
|
||||
this.country = bundle.getString("_wxapi_showmessage_req_country");
|
||||
this.message = WXMediaMessage.Builder.fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
Bundle bundle2 = WXMediaMessage.Builder.toBundle(this.message);
|
||||
super.toBundle(bundle2);
|
||||
bundle.putString("_wxapi_showmessage_req_lang", this.lang);
|
||||
bundle.putString("_wxapi_showmessage_req_country", this.country);
|
||||
bundle.putAll(bundle2);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Resp extends BaseResp {
|
||||
public Resp() {
|
||||
}
|
||||
|
||||
public Resp(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public boolean checkArgs() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public int getType() {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
private ShowMessageFromWX() {
|
||||
}
|
||||
}
|
@@ -0,0 +1,94 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import java.io.File;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXAppExtendObject implements WXMediaMessage.IMediaObject {
|
||||
private static final int CONTENT_LENGTH_LIMIT = 10485760;
|
||||
private static final int EXTINFO_LENGTH_LIMIT = 2048;
|
||||
private static final int PATH_LENGTH_LIMIT = 10240;
|
||||
private static final String TAG = "MicroMsg.SDK.WXAppExtendObject";
|
||||
public String extInfo;
|
||||
public byte[] fileData;
|
||||
public String filePath;
|
||||
|
||||
public WXAppExtendObject() {
|
||||
}
|
||||
|
||||
public WXAppExtendObject(String str, String str2) {
|
||||
this.extInfo = str;
|
||||
this.filePath = str2;
|
||||
}
|
||||
|
||||
public WXAppExtendObject(String str, byte[] bArr) {
|
||||
this.extInfo = str;
|
||||
this.fileData = bArr;
|
||||
}
|
||||
|
||||
private int getFileSize(String str) {
|
||||
if (str == null || str.length() == 0) {
|
||||
return 0;
|
||||
}
|
||||
File file = new File(str);
|
||||
if (file.exists()) {
|
||||
return (int) file.length();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
byte[] bArr;
|
||||
String str2;
|
||||
String str3 = this.extInfo;
|
||||
if ((str3 == null || str3.length() == 0) && (((str = this.filePath) == null || str.length() == 0) && ((bArr = this.fileData) == null || bArr.length == 0))) {
|
||||
str2 = "checkArgs fail, all arguments is null";
|
||||
} else {
|
||||
String str4 = this.extInfo;
|
||||
if (str4 == null || str4.length() <= EXTINFO_LENGTH_LIMIT) {
|
||||
String str5 = this.filePath;
|
||||
if (str5 == null || str5.length() <= PATH_LENGTH_LIMIT) {
|
||||
String str6 = this.filePath;
|
||||
if (str6 == null || getFileSize(str6) <= CONTENT_LENGTH_LIMIT) {
|
||||
byte[] bArr2 = this.fileData;
|
||||
if (bArr2 == null || bArr2.length <= CONTENT_LENGTH_LIMIT) {
|
||||
return true;
|
||||
}
|
||||
str2 = "checkArgs fail, fileData is too large";
|
||||
} else {
|
||||
str2 = "checkArgs fail, fileSize is too large";
|
||||
}
|
||||
} else {
|
||||
str2 = "checkArgs fail, filePath is invalid";
|
||||
}
|
||||
} else {
|
||||
str2 = "checkArgs fail, extInfo is invalid";
|
||||
}
|
||||
}
|
||||
Log.e(TAG, str2);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putString("_wxappextendobject_extInfo", this.extInfo);
|
||||
bundle.putByteArray("_wxappextendobject_fileData", this.fileData);
|
||||
bundle.putString("_wxappextendobject_filePath", this.filePath);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 7;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.extInfo = bundle.getString("_wxappextendobject_extInfo");
|
||||
this.fileData = bundle.getByteArray("_wxappextendobject_fileData");
|
||||
this.filePath = bundle.getString("_wxappextendobject_filePath");
|
||||
}
|
||||
}
|
28
sources/com/tencent/mm/opensdk/modelmsg/WXAppLaunchData.java
Normal file
28
sources/com/tencent/mm/opensdk/modelmsg/WXAppLaunchData.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class WXAppLaunchData {
|
||||
public static final String ACTION_HANDLE_WXAPPLAUNCH = ".ACTION_HANDLE_WXAPPLAUNCH";
|
||||
public static final String ACTION_HANDLE_WXAPP_RESULT = ".ACTION_HANDLE_WXAPP_RESULT";
|
||||
public static final String ACTION_HANDLE_WXAPP_SHOW = ".ACTION_HANDLE_WXAPP_SHOW";
|
||||
public int launchType;
|
||||
public String message;
|
||||
|
||||
public static class Builder {
|
||||
public static WXAppLaunchData fromBundle(Bundle bundle) {
|
||||
WXAppLaunchData wXAppLaunchData = new WXAppLaunchData();
|
||||
wXAppLaunchData.launchType = bundle.getInt("_wxapplaunchdata_launchType");
|
||||
wXAppLaunchData.message = bundle.getString("_wxapplaunchdata_message");
|
||||
return wXAppLaunchData;
|
||||
}
|
||||
|
||||
public static Bundle toBundle(WXAppLaunchData wXAppLaunchData) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt("_wxapplaunchdata_launchType", wXAppLaunchData.launchType);
|
||||
bundle.putString("_wxapplaunchdata_message", wXAppLaunchData.message);
|
||||
return bundle;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXDesignerSharedObject implements WXMediaMessage.IMediaObject {
|
||||
private static final String TAG = "MicroMsg.SDK.WXEmojiSharedObject";
|
||||
public String designerName;
|
||||
public String designerRediretctUrl;
|
||||
public int designerUIN;
|
||||
public String thumburl;
|
||||
public String url;
|
||||
|
||||
public WXDesignerSharedObject() {
|
||||
}
|
||||
|
||||
public WXDesignerSharedObject(String str, int i, String str2, String str3) {
|
||||
this.url = str2;
|
||||
this.thumburl = str;
|
||||
this.designerUIN = i;
|
||||
this.designerName = str3;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
if (this.designerUIN != 0 && !TextUtils.isEmpty(this.thumburl) && !TextUtils.isEmpty(this.url)) {
|
||||
return true;
|
||||
}
|
||||
Log.e(TAG, "checkArgs fail, packageid or thumburl is invalid");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putString("_wxemojisharedobject_thumburl", this.thumburl);
|
||||
bundle.putInt("_wxemojisharedobject_designer_uin", this.designerUIN);
|
||||
bundle.putString("_wxemojisharedobject_designer_name", this.designerName);
|
||||
bundle.putString("_wxemojisharedobject_designer_rediretcturl", this.designerRediretctUrl);
|
||||
bundle.putString("_wxemojisharedobject_url", this.url);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 25;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.thumburl = bundle.getString("_wxwebpageobject_thumburl");
|
||||
this.designerUIN = bundle.getInt("_wxemojisharedobject_designer_uin");
|
||||
this.designerName = bundle.getString("_wxemojisharedobject_designer_name");
|
||||
this.designerRediretctUrl = bundle.getString("_wxemojisharedobject_designer_rediretcturl");
|
||||
this.url = bundle.getString("_wxwebpageobject_url");
|
||||
}
|
||||
}
|
86
sources/com/tencent/mm/opensdk/modelmsg/WXEmojiObject.java
Normal file
86
sources/com/tencent/mm/opensdk/modelmsg/WXEmojiObject.java
Normal file
@@ -0,0 +1,86 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import java.io.File;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXEmojiObject implements WXMediaMessage.IMediaObject {
|
||||
private static final int CONTENT_LENGTH_LIMIT = 10485760;
|
||||
private static final String TAG = "MicroMsg.SDK.WXEmojiObject";
|
||||
public byte[] emojiData;
|
||||
public String emojiPath;
|
||||
|
||||
public WXEmojiObject() {
|
||||
this.emojiData = null;
|
||||
this.emojiPath = null;
|
||||
}
|
||||
|
||||
public WXEmojiObject(String str) {
|
||||
this.emojiPath = str;
|
||||
}
|
||||
|
||||
public WXEmojiObject(byte[] bArr) {
|
||||
this.emojiData = bArr;
|
||||
}
|
||||
|
||||
private int getFileSize(String str) {
|
||||
if (str == null || str.length() == 0) {
|
||||
return 0;
|
||||
}
|
||||
File file = new File(str);
|
||||
if (file.exists()) {
|
||||
return (int) file.length();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2;
|
||||
byte[] bArr = this.emojiData;
|
||||
if ((bArr == null || bArr.length == 0) && ((str = this.emojiPath) == null || str.length() == 0)) {
|
||||
str2 = "checkArgs fail, both arguments is null";
|
||||
} else {
|
||||
byte[] bArr2 = this.emojiData;
|
||||
if (bArr2 == null || bArr2.length <= CONTENT_LENGTH_LIMIT) {
|
||||
String str3 = this.emojiPath;
|
||||
if (str3 == null || getFileSize(str3) <= CONTENT_LENGTH_LIMIT) {
|
||||
return true;
|
||||
}
|
||||
str2 = "checkArgs fail, emojiSize is too large";
|
||||
} else {
|
||||
str2 = "checkArgs fail, emojiData is too large";
|
||||
}
|
||||
}
|
||||
Log.e(TAG, str2);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putByteArray("_wxemojiobject_emojiData", this.emojiData);
|
||||
bundle.putString("_wxemojiobject_emojiPath", this.emojiPath);
|
||||
}
|
||||
|
||||
public void setEmojiData(byte[] bArr) {
|
||||
this.emojiData = bArr;
|
||||
}
|
||||
|
||||
public void setEmojiPath(String str) {
|
||||
this.emojiPath = str;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.emojiData = bundle.getByteArray("_wxemojiobject_emojiData");
|
||||
this.emojiPath = bundle.getString("_wxemojiobject_emojiPath");
|
||||
}
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import com.tencent.mm.opensdk.utils.d;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXEmojiPageSharedObject implements WXMediaMessage.IMediaObject {
|
||||
private static final String TAG = "MicroMsg.SDK.WXEmojiSharedObject";
|
||||
public String desc;
|
||||
public String iconUrl;
|
||||
public int pageType;
|
||||
public String secondUrl;
|
||||
public int tid;
|
||||
public String title;
|
||||
public int type;
|
||||
public String url;
|
||||
|
||||
public WXEmojiPageSharedObject() {
|
||||
}
|
||||
|
||||
public WXEmojiPageSharedObject(int i, int i2, String str, String str2, String str3, String str4, int i3, String str5) {
|
||||
this.tid = i2;
|
||||
this.title = str;
|
||||
this.desc = str2;
|
||||
this.iconUrl = str3;
|
||||
this.secondUrl = str4;
|
||||
this.pageType = i3;
|
||||
this.url = str5;
|
||||
this.type = i;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
if (!d.h(this.title) && !d.h(this.iconUrl)) {
|
||||
return true;
|
||||
}
|
||||
Log.e(TAG, "checkArgs fail, title or iconUrl is invalid");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putInt("_wxemojisharedobject_tid", this.tid);
|
||||
bundle.putString("_wxemojisharedobject_title", this.title);
|
||||
bundle.putString("_wxemojisharedobject_desc", this.desc);
|
||||
bundle.putString("_wxemojisharedobject_iconurl", this.iconUrl);
|
||||
bundle.putString("_wxemojisharedobject_secondurl", this.secondUrl);
|
||||
bundle.putInt("_wxemojisharedobject_pagetype", this.pageType);
|
||||
bundle.putString("_wxwebpageobject_url", this.url);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.tid = bundle.getInt("_wxemojisharedobject_tid");
|
||||
this.title = bundle.getString("_wxemojisharedobject_title");
|
||||
this.desc = bundle.getString("_wxemojisharedobject_desc");
|
||||
this.iconUrl = bundle.getString("_wxemojisharedobject_iconurl");
|
||||
this.secondUrl = bundle.getString("_wxemojisharedobject_secondurl");
|
||||
this.pageType = bundle.getInt("_wxemojisharedobject_pagetype");
|
||||
this.url = bundle.getString("_wxwebpageobject_url");
|
||||
}
|
||||
}
|
@@ -0,0 +1,55 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXEmojiSharedObject implements WXMediaMessage.IMediaObject {
|
||||
private static final String TAG = "MicroMsg.SDK.WXEmojiSharedObject";
|
||||
public int packageflag;
|
||||
public String packageid;
|
||||
public String thumburl;
|
||||
public String url;
|
||||
|
||||
public WXEmojiSharedObject() {
|
||||
}
|
||||
|
||||
public WXEmojiSharedObject(String str, int i, String str2, String str3) {
|
||||
this.thumburl = str;
|
||||
this.packageflag = i;
|
||||
this.packageid = str2;
|
||||
this.url = str3;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
if (!TextUtils.isEmpty(this.packageid) && !TextUtils.isEmpty(this.thumburl) && !TextUtils.isEmpty(this.url) && this.packageflag != -1) {
|
||||
return true;
|
||||
}
|
||||
Log.e(TAG, "checkArgs fail, packageid or thumburl is invalid");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putString("_wxemojisharedobject_thumburl", this.thumburl);
|
||||
bundle.putInt("_wxemojisharedobject_packageflag", this.packageflag);
|
||||
bundle.putString("_wxemojisharedobject_packageid", this.packageid);
|
||||
bundle.putString("_wxemojisharedobject_url", this.url);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 15;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.thumburl = bundle.getString("_wxwebpageobject_thumburl");
|
||||
this.packageflag = bundle.getInt("_wxwebpageobject_packageflag");
|
||||
this.packageid = bundle.getString("_wxwebpageobject_packageid");
|
||||
this.url = bundle.getString("_wxwebpageobject_url");
|
||||
}
|
||||
}
|
94
sources/com/tencent/mm/opensdk/modelmsg/WXFileObject.java
Normal file
94
sources/com/tencent/mm/opensdk/modelmsg/WXFileObject.java
Normal file
@@ -0,0 +1,94 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import java.io.File;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXFileObject implements WXMediaMessage.IMediaObject {
|
||||
private static final int CONTENT_LENGTH_LIMIT = 10485760;
|
||||
private static final String TAG = "MicroMsg.SDK.WXFileObject";
|
||||
private int contentLengthLimit;
|
||||
public byte[] fileData;
|
||||
public String filePath;
|
||||
|
||||
public WXFileObject() {
|
||||
this.contentLengthLimit = CONTENT_LENGTH_LIMIT;
|
||||
this.fileData = null;
|
||||
this.filePath = null;
|
||||
}
|
||||
|
||||
public WXFileObject(String str) {
|
||||
this.contentLengthLimit = CONTENT_LENGTH_LIMIT;
|
||||
this.filePath = str;
|
||||
}
|
||||
|
||||
public WXFileObject(byte[] bArr) {
|
||||
this.contentLengthLimit = CONTENT_LENGTH_LIMIT;
|
||||
this.fileData = bArr;
|
||||
}
|
||||
|
||||
private int getFileSize(String str) {
|
||||
if (str == null || str.length() == 0) {
|
||||
return 0;
|
||||
}
|
||||
File file = new File(str);
|
||||
if (file.exists()) {
|
||||
return (int) file.length();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2;
|
||||
byte[] bArr = this.fileData;
|
||||
if ((bArr == null || bArr.length == 0) && ((str = this.filePath) == null || str.length() == 0)) {
|
||||
str2 = "checkArgs fail, both arguments is null";
|
||||
} else {
|
||||
byte[] bArr2 = this.fileData;
|
||||
if (bArr2 == null || bArr2.length <= this.contentLengthLimit) {
|
||||
String str3 = this.filePath;
|
||||
if (str3 == null || getFileSize(str3) <= this.contentLengthLimit) {
|
||||
return true;
|
||||
}
|
||||
str2 = "checkArgs fail, fileSize is too large";
|
||||
} else {
|
||||
str2 = "checkArgs fail, fileData is too large";
|
||||
}
|
||||
}
|
||||
Log.e(TAG, str2);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putByteArray("_wxfileobject_fileData", this.fileData);
|
||||
bundle.putString("_wxfileobject_filePath", this.filePath);
|
||||
}
|
||||
|
||||
public void setContentLengthLimit(int i) {
|
||||
this.contentLengthLimit = i;
|
||||
}
|
||||
|
||||
public void setFileData(byte[] bArr) {
|
||||
this.fileData = bArr;
|
||||
}
|
||||
|
||||
public void setFilePath(String str) {
|
||||
this.filePath = str;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 6;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.fileData = bundle.getByteArray("_wxfileobject_fileData");
|
||||
this.filePath = bundle.getString("_wxfileobject_filePath");
|
||||
}
|
||||
}
|
@@ -0,0 +1,82 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import java.io.File;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXGameVideoFileObject implements WXMediaMessage.IMediaObject {
|
||||
private static final int FILE_SIZE_LIMIT = 10485760;
|
||||
private static final String TAG = "MicroMsg.SDK.WXGameVideoFileObject";
|
||||
private static final int URL_LENGTH_LIMIT = 10240;
|
||||
public String filePath;
|
||||
public String thumbUrl;
|
||||
public String videoUrl;
|
||||
|
||||
public WXGameVideoFileObject() {
|
||||
this.filePath = null;
|
||||
this.videoUrl = null;
|
||||
this.thumbUrl = null;
|
||||
}
|
||||
|
||||
public WXGameVideoFileObject(String str, String str2, String str3) {
|
||||
this.filePath = str;
|
||||
this.videoUrl = str2;
|
||||
this.thumbUrl = str3;
|
||||
}
|
||||
|
||||
private int getFileSize(String str) {
|
||||
if (str == null || str.length() == 0) {
|
||||
return 0;
|
||||
}
|
||||
File file = new File(str);
|
||||
if (file.exists()) {
|
||||
return (int) file.length();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2 = this.filePath;
|
||||
if (str2 == null || str2.length() == 0) {
|
||||
str = "checkArgs fail, filePath is null";
|
||||
} else if (getFileSize(this.filePath) > FILE_SIZE_LIMIT) {
|
||||
str = "checkArgs fail, video file size is too large";
|
||||
} else {
|
||||
String str3 = this.videoUrl;
|
||||
if (str3 == null || str3.length() <= URL_LENGTH_LIMIT) {
|
||||
String str4 = this.thumbUrl;
|
||||
if (str4 == null || str4.length() <= URL_LENGTH_LIMIT) {
|
||||
return true;
|
||||
}
|
||||
str = "checkArgs fail, thumbUrl is too long";
|
||||
} else {
|
||||
str = "checkArgs fail, videoUrl is too long";
|
||||
}
|
||||
}
|
||||
Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putString("_wxvideofileobject_filePath", this.filePath);
|
||||
bundle.putString("_wxvideofileobject_cdnUrl", this.videoUrl);
|
||||
bundle.putString("_wxvideofileobject_thumbUrl", this.thumbUrl);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 39;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.filePath = bundle.getString("_wxvideofileobject_filePath");
|
||||
this.videoUrl = bundle.getString("_wxvideofileobject_cdnUrl");
|
||||
this.thumbUrl = bundle.getString("_wxvideofileobject_thumbUrl");
|
||||
}
|
||||
}
|
95
sources/com/tencent/mm/opensdk/modelmsg/WXImageObject.java
Normal file
95
sources/com/tencent/mm/opensdk/modelmsg/WXImageObject.java
Normal file
@@ -0,0 +1,95 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXImageObject implements WXMediaMessage.IMediaObject {
|
||||
private static final int CONTENT_LENGTH_LIMIT = 10485760;
|
||||
private static final int PATH_LENGTH_LIMIT = 10240;
|
||||
private static final String TAG = "MicroMsg.SDK.WXImageObject";
|
||||
public byte[] imageData;
|
||||
public String imagePath;
|
||||
|
||||
public WXImageObject() {
|
||||
}
|
||||
|
||||
public WXImageObject(Bitmap bitmap) {
|
||||
try {
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 85, byteArrayOutputStream);
|
||||
this.imageData = byteArrayOutputStream.toByteArray();
|
||||
byteArrayOutputStream.close();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "WXImageObject <init>, exception:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public WXImageObject(byte[] bArr) {
|
||||
this.imageData = bArr;
|
||||
}
|
||||
|
||||
private int getFileSize(String str) {
|
||||
if (str == null || str.length() == 0) {
|
||||
return 0;
|
||||
}
|
||||
File file = new File(str);
|
||||
if (file.exists()) {
|
||||
return (int) file.length();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2;
|
||||
byte[] bArr = this.imageData;
|
||||
if ((bArr == null || bArr.length == 0) && ((str = this.imagePath) == null || str.length() == 0)) {
|
||||
str2 = "checkArgs fail, all arguments are null";
|
||||
} else {
|
||||
byte[] bArr2 = this.imageData;
|
||||
if (bArr2 == null || bArr2.length <= CONTENT_LENGTH_LIMIT) {
|
||||
String str3 = this.imagePath;
|
||||
if (str3 == null || str3.length() <= PATH_LENGTH_LIMIT) {
|
||||
String str4 = this.imagePath;
|
||||
if (str4 == null || getFileSize(str4) <= CONTENT_LENGTH_LIMIT) {
|
||||
return true;
|
||||
}
|
||||
str2 = "checkArgs fail, image content is too large";
|
||||
} else {
|
||||
str2 = "checkArgs fail, path is invalid";
|
||||
}
|
||||
} else {
|
||||
str2 = "checkArgs fail, content is too large";
|
||||
}
|
||||
}
|
||||
Log.e(TAG, str2);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putByteArray("_wximageobject_imageData", this.imageData);
|
||||
bundle.putString("_wximageobject_imagePath", this.imagePath);
|
||||
}
|
||||
|
||||
public void setImagePath(String str) {
|
||||
this.imagePath = str;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.imageData = bundle.getByteArray("_wximageobject_imageData");
|
||||
this.imagePath = bundle.getString("_wximageobject_imagePath");
|
||||
}
|
||||
}
|
@@ -0,0 +1,42 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXLocationObject implements WXMediaMessage.IMediaObject {
|
||||
private static final String TAG = "MicroMsg.SDK.WXLocationObject";
|
||||
public double lat;
|
||||
public double lng;
|
||||
|
||||
public WXLocationObject() {
|
||||
this(0.0d, 0.0d);
|
||||
}
|
||||
|
||||
public WXLocationObject(double d, double d2) {
|
||||
this.lat = d;
|
||||
this.lng = d2;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putDouble("_wxlocationobject_lat", this.lat);
|
||||
bundle.putDouble("_wxlocationobject_lng", this.lng);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 30;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.lat = bundle.getDouble("_wxlocationobject_lat");
|
||||
this.lng = bundle.getDouble("_wxlocationobject_lng");
|
||||
}
|
||||
}
|
203
sources/com/tencent/mm/opensdk/modelmsg/WXMediaMessage.java
Normal file
203
sources/com/tencent/mm/opensdk/modelmsg/WXMediaMessage.java
Normal file
@@ -0,0 +1,203 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class WXMediaMessage {
|
||||
public static final String ACTION_WXAPPMESSAGE = "com.tencent.mm.sdk.openapi.Intent.ACTION_WXAPPMESSAGE";
|
||||
private static final int DESCRIPTION_LENGTH_LIMIT = 1024;
|
||||
private static final int MEDIA_TAG_NAME_LENGTH_LIMIT = 64;
|
||||
private static final int MESSAGE_ACTION_LENGTH_LIMIT = 2048;
|
||||
private static final int MESSAGE_EXT_LENGTH_LIMIT = 2048;
|
||||
private static final int MINI_PROGRAM__THUMB_LENGHT = 131072;
|
||||
private static final String TAG = "MicroMsg.SDK.WXMediaMessage";
|
||||
private static final int THUMB_LENGTH_LIMIT = 32768;
|
||||
private static final int TITLE_LENGTH_LIMIT = 512;
|
||||
public String description;
|
||||
public IMediaObject mediaObject;
|
||||
public String mediaTagName;
|
||||
public String messageAction;
|
||||
public String messageExt;
|
||||
public int sdkVer;
|
||||
public byte[] thumbData;
|
||||
public String title;
|
||||
|
||||
public static class Builder {
|
||||
public static final String KEY_IDENTIFIER = "_wxobject_identifier_";
|
||||
|
||||
public static WXMediaMessage fromBundle(Bundle bundle) {
|
||||
WXMediaMessage wXMediaMessage = new WXMediaMessage();
|
||||
wXMediaMessage.sdkVer = bundle.getInt("_wxobject_sdkVer");
|
||||
wXMediaMessage.title = bundle.getString("_wxobject_title");
|
||||
wXMediaMessage.description = bundle.getString("_wxobject_description");
|
||||
wXMediaMessage.thumbData = bundle.getByteArray("_wxobject_thumbdata");
|
||||
wXMediaMessage.mediaTagName = bundle.getString("_wxobject_mediatagname");
|
||||
wXMediaMessage.messageAction = bundle.getString("_wxobject_message_action");
|
||||
wXMediaMessage.messageExt = bundle.getString("_wxobject_message_ext");
|
||||
String pathOldToNew = pathOldToNew(bundle.getString(KEY_IDENTIFIER));
|
||||
if (pathOldToNew != null && pathOldToNew.length() > 0) {
|
||||
try {
|
||||
wXMediaMessage.mediaObject = (IMediaObject) Class.forName(pathOldToNew).newInstance();
|
||||
wXMediaMessage.mediaObject.unserialize(bundle);
|
||||
return wXMediaMessage;
|
||||
} catch (Exception e) {
|
||||
Log.e(WXMediaMessage.TAG, "get media object from bundle failed: unknown ident " + pathOldToNew + ", ex = " + e.getMessage());
|
||||
}
|
||||
}
|
||||
return wXMediaMessage;
|
||||
}
|
||||
|
||||
private static String pathNewToOld(String str) {
|
||||
if (str != null && str.length() != 0) {
|
||||
return str.replace("com.tencent.mm.opensdk.modelmsg", "com.tencent.mm.sdk.openapi");
|
||||
}
|
||||
Log.e(WXMediaMessage.TAG, "pathNewToOld fail, newPath is null");
|
||||
return str;
|
||||
}
|
||||
|
||||
private static String pathOldToNew(String str) {
|
||||
Log.i(WXMediaMessage.TAG, "pathOldToNew, oldPath = " + str);
|
||||
if (str == null || str.length() == 0) {
|
||||
Log.e(WXMediaMessage.TAG, "pathOldToNew fail, oldPath is null");
|
||||
return str;
|
||||
}
|
||||
int lastIndexOf = str.lastIndexOf(46);
|
||||
if (lastIndexOf != -1) {
|
||||
return "com.tencent.mm.opensdk.modelmsg" + str.substring(lastIndexOf);
|
||||
}
|
||||
Log.e(WXMediaMessage.TAG, "pathOldToNew fail, invalid pos, oldPath = " + str);
|
||||
return str;
|
||||
}
|
||||
|
||||
public static Bundle toBundle(WXMediaMessage wXMediaMessage) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt("_wxobject_sdkVer", wXMediaMessage.sdkVer);
|
||||
bundle.putString("_wxobject_title", wXMediaMessage.title);
|
||||
bundle.putString("_wxobject_description", wXMediaMessage.description);
|
||||
bundle.putByteArray("_wxobject_thumbdata", wXMediaMessage.thumbData);
|
||||
IMediaObject iMediaObject = wXMediaMessage.mediaObject;
|
||||
if (iMediaObject != null) {
|
||||
bundle.putString(KEY_IDENTIFIER, pathNewToOld(iMediaObject.getClass().getName()));
|
||||
wXMediaMessage.mediaObject.serialize(bundle);
|
||||
}
|
||||
bundle.putString("_wxobject_mediatagname", wXMediaMessage.mediaTagName);
|
||||
bundle.putString("_wxobject_message_action", wXMediaMessage.messageAction);
|
||||
bundle.putString("_wxobject_message_ext", wXMediaMessage.messageExt);
|
||||
return bundle;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IMediaObject {
|
||||
public static final int TYPE_APPBRAND = 33;
|
||||
public static final int TYPE_APPDATA = 7;
|
||||
public static final int TYPE_CARD_SHARE = 16;
|
||||
public static final int TYPE_DESIGNER_SHARED = 25;
|
||||
public static final int TYPE_DEVICE_ACCESS = 12;
|
||||
public static final int TYPE_EMOJI = 8;
|
||||
public static final int TYPE_EMOJILIST_SHARED = 27;
|
||||
public static final int TYPE_EMOTICON_GIFT = 11;
|
||||
public static final int TYPE_EMOTICON_SHARED = 15;
|
||||
public static final int TYPE_EMOTIONLIST_SHARED = 26;
|
||||
public static final int TYPE_FILE = 6;
|
||||
public static final int TYPE_GAME_VIDEO_FILE = 39;
|
||||
public static final int TYPE_GIFTCARD = 34;
|
||||
public static final int TYPE_IMAGE = 2;
|
||||
public static final int TYPE_LOCATION = 30;
|
||||
public static final int TYPE_LOCATION_SHARE = 17;
|
||||
public static final int TYPE_MALL_PRODUCT = 13;
|
||||
public static final int TYPE_MUSIC = 3;
|
||||
public static final int TYPE_NOTE = 24;
|
||||
public static final int TYPE_OLD_TV = 14;
|
||||
public static final int TYPE_OPENSDK_APPBRAND = 36;
|
||||
public static final int TYPE_PRODUCT = 10;
|
||||
public static final int TYPE_RECORD = 19;
|
||||
public static final int TYPE_TEXT = 1;
|
||||
public static final int TYPE_TV = 20;
|
||||
public static final int TYPE_UNKNOWN = 0;
|
||||
public static final int TYPE_URL = 5;
|
||||
public static final int TYPE_VIDEO = 4;
|
||||
public static final int TYPE_VIDEO_FILE = 38;
|
||||
|
||||
boolean checkArgs();
|
||||
|
||||
void serialize(Bundle bundle);
|
||||
|
||||
int type();
|
||||
|
||||
void unserialize(Bundle bundle);
|
||||
}
|
||||
|
||||
public WXMediaMessage() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public WXMediaMessage(IMediaObject iMediaObject) {
|
||||
this.mediaObject = iMediaObject;
|
||||
}
|
||||
|
||||
final boolean checkArgs() {
|
||||
String str;
|
||||
byte[] bArr;
|
||||
byte[] bArr2;
|
||||
byte[] bArr3;
|
||||
if (getType() == 8 && ((bArr3 = this.thumbData) == null || bArr3.length == 0)) {
|
||||
str = "checkArgs fail, thumbData should not be null when send emoji";
|
||||
} else if (getType() == 36 && ((bArr2 = this.thumbData) == null || bArr2.length > MINI_PROGRAM__THUMB_LENGHT)) {
|
||||
str = "checkArgs fail, thumbData should not be null or exceed 128kb";
|
||||
} else if (getType() == 36 || (bArr = this.thumbData) == null || bArr.length <= THUMB_LENGTH_LIMIT) {
|
||||
String str2 = this.title;
|
||||
if (str2 == null || str2.length() <= 512) {
|
||||
String str3 = this.description;
|
||||
if (str3 != null && str3.length() > 1024) {
|
||||
str = "checkArgs fail, description is invalid";
|
||||
} else if (this.mediaObject == null) {
|
||||
str = "checkArgs fail, mediaObject is null";
|
||||
} else {
|
||||
String str4 = this.mediaTagName;
|
||||
if (str4 == null || str4.length() <= 64) {
|
||||
String str5 = this.messageAction;
|
||||
if (str5 == null || str5.length() <= 2048) {
|
||||
String str6 = this.messageExt;
|
||||
if (str6 == null || str6.length() <= 2048) {
|
||||
return this.mediaObject.checkArgs();
|
||||
}
|
||||
str = "checkArgs fail, messageExt is too long";
|
||||
} else {
|
||||
str = "checkArgs fail, messageAction is too long";
|
||||
}
|
||||
} else {
|
||||
str = "checkArgs fail, mediaTagName is too long";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
str = "checkArgs fail, title is invalid";
|
||||
}
|
||||
} else {
|
||||
str = "checkArgs fail, thumbData is invalid";
|
||||
}
|
||||
Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
public final int getType() {
|
||||
IMediaObject iMediaObject = this.mediaObject;
|
||||
if (iMediaObject == null) {
|
||||
return 0;
|
||||
}
|
||||
return iMediaObject.type();
|
||||
}
|
||||
|
||||
public final void setThumbImage(Bitmap bitmap) {
|
||||
try {
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 85, byteArrayOutputStream);
|
||||
this.thumbData = byteArrayOutputStream.toByteArray();
|
||||
byteArrayOutputStream.close();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "setThumbImage exception:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import com.tencent.mm.opensdk.utils.d;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXMiniProgramObject implements WXMediaMessage.IMediaObject {
|
||||
private static final String TAG = "MicroMsg.SDK.WXMiniProgramObject";
|
||||
public String path;
|
||||
public String userName;
|
||||
public String webpageUrl;
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
if (d.h(this.webpageUrl)) {
|
||||
str = "webPageUrl is null";
|
||||
} else {
|
||||
if (!d.h(this.userName)) {
|
||||
return true;
|
||||
}
|
||||
str = "userName is null";
|
||||
}
|
||||
Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putString("_wxminiprogram_webpageurl", this.webpageUrl);
|
||||
bundle.putString("_wxminiprogram_username", this.userName);
|
||||
bundle.putString("_wxminiprogram_path", this.path);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 36;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.webpageUrl = bundle.getString("_wxminiprogram_webpageurl");
|
||||
this.userName = bundle.getString("_wxminiprogram_username");
|
||||
this.path = bundle.getString("_wxminiprogram_path");
|
||||
}
|
||||
}
|
59
sources/com/tencent/mm/opensdk/modelmsg/WXMusicObject.java
Normal file
59
sources/com/tencent/mm/opensdk/modelmsg/WXMusicObject.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXMusicObject implements WXMediaMessage.IMediaObject {
|
||||
private static final int LENGTH_LIMIT = 10240;
|
||||
private static final String TAG = "MicroMsg.SDK.WXMusicObject";
|
||||
public String musicDataUrl;
|
||||
public String musicLowBandDataUrl;
|
||||
public String musicLowBandUrl;
|
||||
public String musicUrl;
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2;
|
||||
String str3 = this.musicUrl;
|
||||
if ((str3 == null || str3.length() == 0) && ((str = this.musicLowBandUrl) == null || str.length() == 0)) {
|
||||
str2 = "both arguments are null";
|
||||
} else {
|
||||
String str4 = this.musicUrl;
|
||||
if (str4 == null || str4.length() <= LENGTH_LIMIT) {
|
||||
String str5 = this.musicLowBandUrl;
|
||||
if (str5 == null || str5.length() <= LENGTH_LIMIT) {
|
||||
return true;
|
||||
}
|
||||
str2 = "checkArgs fail, musicLowBandUrl is too long";
|
||||
} else {
|
||||
str2 = "checkArgs fail, musicUrl is too long";
|
||||
}
|
||||
}
|
||||
Log.e(TAG, str2);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putString("_wxmusicobject_musicUrl", this.musicUrl);
|
||||
bundle.putString("_wxmusicobject_musicLowBandUrl", this.musicLowBandUrl);
|
||||
bundle.putString("_wxmusicobject_musicDataUrl", this.musicDataUrl);
|
||||
bundle.putString("_wxmusicobject_musicLowBandDataUrl", this.musicLowBandDataUrl);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.musicUrl = bundle.getString("_wxmusicobject_musicUrl");
|
||||
this.musicLowBandUrl = bundle.getString("_wxmusicobject_musicLowBandUrl");
|
||||
this.musicDataUrl = bundle.getString("_wxmusicobject_musicDataUrl");
|
||||
this.musicLowBandDataUrl = bundle.getString("_wxmusicobject_musicLowBandDataUrl");
|
||||
}
|
||||
}
|
45
sources/com/tencent/mm/opensdk/modelmsg/WXTextObject.java
Normal file
45
sources/com/tencent/mm/opensdk/modelmsg/WXTextObject.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXTextObject implements WXMediaMessage.IMediaObject {
|
||||
private static final int LENGTH_LIMIT = 10240;
|
||||
private static final String TAG = "MicroMsg.SDK.WXTextObject";
|
||||
public String text;
|
||||
|
||||
public WXTextObject() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public WXTextObject(String str) {
|
||||
this.text = str;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
String str = this.text;
|
||||
if (str != null && str.length() != 0 && this.text.length() <= LENGTH_LIMIT) {
|
||||
return true;
|
||||
}
|
||||
Log.e(TAG, "checkArgs fail, text is invalid");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putString("_wxtextobject_text", this.text);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.text = bundle.getString("_wxtextobject_text");
|
||||
}
|
||||
}
|
@@ -0,0 +1,63 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import java.io.File;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXVideoFileObject implements WXMediaMessage.IMediaObject {
|
||||
private static final int FILE_SIZE_LIMIT = 10485760;
|
||||
private static final String TAG = "MicroMsg.SDK.WXVideoFileObject";
|
||||
public String filePath;
|
||||
|
||||
public WXVideoFileObject() {
|
||||
this.filePath = null;
|
||||
}
|
||||
|
||||
public WXVideoFileObject(String str) {
|
||||
this.filePath = str;
|
||||
}
|
||||
|
||||
private int getFileSize(String str) {
|
||||
if (str == null || str.length() == 0) {
|
||||
return 0;
|
||||
}
|
||||
File file = new File(str);
|
||||
if (file.exists()) {
|
||||
return (int) file.length();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2 = this.filePath;
|
||||
if (str2 == null || str2.length() == 0) {
|
||||
str = "checkArgs fail, filePath is null";
|
||||
} else {
|
||||
if (getFileSize(this.filePath) <= FILE_SIZE_LIMIT) {
|
||||
return true;
|
||||
}
|
||||
str = "checkArgs fail, video file size is too large";
|
||||
}
|
||||
Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putString("_wxvideofileobject_filePath", this.filePath);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 38;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.filePath = bundle.getString("_wxvideofileobject_filePath");
|
||||
}
|
||||
}
|
53
sources/com/tencent/mm/opensdk/modelmsg/WXVideoObject.java
Normal file
53
sources/com/tencent/mm/opensdk/modelmsg/WXVideoObject.java
Normal file
@@ -0,0 +1,53 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXVideoObject implements WXMediaMessage.IMediaObject {
|
||||
private static final int LENGTH_LIMIT = 10240;
|
||||
private static final String TAG = "MicroMsg.SDK.WXVideoObject";
|
||||
public String videoLowBandUrl;
|
||||
public String videoUrl;
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2;
|
||||
String str3 = this.videoUrl;
|
||||
if ((str3 == null || str3.length() == 0) && ((str = this.videoLowBandUrl) == null || str.length() == 0)) {
|
||||
str2 = "both arguments are null";
|
||||
} else {
|
||||
String str4 = this.videoUrl;
|
||||
if (str4 == null || str4.length() <= LENGTH_LIMIT) {
|
||||
String str5 = this.videoLowBandUrl;
|
||||
if (str5 == null || str5.length() <= LENGTH_LIMIT) {
|
||||
return true;
|
||||
}
|
||||
str2 = "checkArgs fail, videoLowBandUrl is too long";
|
||||
} else {
|
||||
str2 = "checkArgs fail, videoUrl is too long";
|
||||
}
|
||||
}
|
||||
Log.e(TAG, str2);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putString("_wxvideoobject_videoUrl", this.videoUrl);
|
||||
bundle.putString("_wxvideoobject_videoLowBandUrl", this.videoLowBandUrl);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.videoUrl = bundle.getString("_wxvideoobject_videoUrl");
|
||||
this.videoLowBandUrl = bundle.getString("_wxvideoobject_videoLowBandUrl");
|
||||
}
|
||||
}
|
50
sources/com/tencent/mm/opensdk/modelmsg/WXWebpageObject.java
Normal file
50
sources/com/tencent/mm/opensdk/modelmsg/WXWebpageObject.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package com.tencent.mm.opensdk.modelmsg;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXWebpageObject implements WXMediaMessage.IMediaObject {
|
||||
private static final int LENGTH_LIMIT = 10240;
|
||||
private static final String TAG = "MicroMsg.SDK.WXWebpageObject";
|
||||
public String canvasPageXml;
|
||||
public String extInfo;
|
||||
public String webpageUrl;
|
||||
|
||||
public WXWebpageObject() {
|
||||
}
|
||||
|
||||
public WXWebpageObject(String str) {
|
||||
this.webpageUrl = str;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public boolean checkArgs() {
|
||||
String str = this.webpageUrl;
|
||||
if (str != null && str.length() != 0 && this.webpageUrl.length() <= LENGTH_LIMIT) {
|
||||
return true;
|
||||
}
|
||||
Log.e(TAG, "checkArgs fail, webpageUrl is invalid");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void serialize(Bundle bundle) {
|
||||
bundle.putString("_wxwebpageobject_extInfo", this.extInfo);
|
||||
bundle.putString("_wxwebpageobject_webpageUrl", this.webpageUrl);
|
||||
bundle.putString("_wxwebpageobject_canvaspagexml", this.canvasPageXml);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public int type() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelmsg.WXMediaMessage.IMediaObject
|
||||
public void unserialize(Bundle bundle) {
|
||||
this.extInfo = bundle.getString("_wxwebpageobject_extInfo");
|
||||
this.webpageUrl = bundle.getString("_wxwebpageobject_webpageUrl");
|
||||
this.canvasPageXml = bundle.getString("_wxwebpageobject_canvaspagexml");
|
||||
}
|
||||
}
|
124
sources/com/tencent/mm/opensdk/modelpay/PayReq.java
Normal file
124
sources/com/tencent/mm/opensdk/modelpay/PayReq.java
Normal file
@@ -0,0 +1,124 @@
|
||||
package com.tencent.mm.opensdk.modelpay;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import com.tencent.mm.opensdk.utils.a;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PayReq extends BaseReq {
|
||||
private static final int EXTDATA_MAX_LENGTH = 1024;
|
||||
private static final String TAG = "MicroMsg.PaySdk.PayReq";
|
||||
public String appId;
|
||||
public String extData;
|
||||
public String nonceStr;
|
||||
public Options options;
|
||||
public String packageValue;
|
||||
public String partnerId;
|
||||
public String prepayId;
|
||||
public String sign;
|
||||
public String signType;
|
||||
public String timeStamp;
|
||||
|
||||
public static class Options {
|
||||
public static final int INVALID_FLAGS = -1;
|
||||
public String callbackClassName;
|
||||
public int callbackFlags = -1;
|
||||
|
||||
public void fromBundle(Bundle bundle) {
|
||||
this.callbackClassName = a.b(bundle, "_wxapi_payoptions_callback_classname");
|
||||
this.callbackFlags = a.a(bundle, "_wxapi_payoptions_callback_flags");
|
||||
}
|
||||
|
||||
public void toBundle(Bundle bundle) {
|
||||
bundle.putString("_wxapi_payoptions_callback_classname", this.callbackClassName);
|
||||
bundle.putInt("_wxapi_payoptions_callback_flags", this.callbackFlags);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public boolean checkArgs() {
|
||||
String str;
|
||||
String str2 = this.appId;
|
||||
if (str2 == null || str2.length() == 0) {
|
||||
str = "checkArgs fail, invalid appId";
|
||||
} else {
|
||||
String str3 = this.partnerId;
|
||||
if (str3 == null || str3.length() == 0) {
|
||||
str = "checkArgs fail, invalid partnerId";
|
||||
} else {
|
||||
String str4 = this.prepayId;
|
||||
if (str4 == null || str4.length() == 0) {
|
||||
str = "checkArgs fail, invalid prepayId";
|
||||
} else {
|
||||
String str5 = this.nonceStr;
|
||||
if (str5 == null || str5.length() == 0) {
|
||||
str = "checkArgs fail, invalid nonceStr";
|
||||
} else {
|
||||
String str6 = this.timeStamp;
|
||||
if (str6 == null || str6.length() == 0) {
|
||||
str = "checkArgs fail, invalid timeStamp";
|
||||
} else {
|
||||
String str7 = this.packageValue;
|
||||
if (str7 == null || str7.length() == 0) {
|
||||
str = "checkArgs fail, invalid packageValue";
|
||||
} else {
|
||||
String str8 = this.sign;
|
||||
if (str8 == null || str8.length() == 0) {
|
||||
str = "checkArgs fail, invalid sign";
|
||||
} else {
|
||||
String str9 = this.extData;
|
||||
if (str9 == null || str9.length() <= 1024) {
|
||||
return true;
|
||||
}
|
||||
str = "checkArgs fail, extData length too long";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.appId = a.b(bundle, "_wxapi_payreq_appid");
|
||||
this.partnerId = a.b(bundle, "_wxapi_payreq_partnerid");
|
||||
this.prepayId = a.b(bundle, "_wxapi_payreq_prepayid");
|
||||
this.nonceStr = a.b(bundle, "_wxapi_payreq_noncestr");
|
||||
this.timeStamp = a.b(bundle, "_wxapi_payreq_timestamp");
|
||||
this.packageValue = a.b(bundle, "_wxapi_payreq_packagevalue");
|
||||
this.sign = a.b(bundle, "_wxapi_payreq_sign");
|
||||
this.extData = a.b(bundle, "_wxapi_payreq_extdata");
|
||||
this.signType = a.b(bundle, "_wxapi_payreq_sign_type");
|
||||
this.options = new Options();
|
||||
this.options.fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public int getType() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseReq
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_payreq_appid", this.appId);
|
||||
bundle.putString("_wxapi_payreq_partnerid", this.partnerId);
|
||||
bundle.putString("_wxapi_payreq_prepayid", this.prepayId);
|
||||
bundle.putString("_wxapi_payreq_noncestr", this.nonceStr);
|
||||
bundle.putString("_wxapi_payreq_timestamp", this.timeStamp);
|
||||
bundle.putString("_wxapi_payreq_packagevalue", this.packageValue);
|
||||
bundle.putString("_wxapi_payreq_sign", this.sign);
|
||||
bundle.putString("_wxapi_payreq_extdata", this.extData);
|
||||
bundle.putString("_wxapi_payreq_sign_type", this.signType);
|
||||
Options options = this.options;
|
||||
if (options != null) {
|
||||
options.toBundle(bundle);
|
||||
}
|
||||
}
|
||||
}
|
44
sources/com/tencent/mm/opensdk/modelpay/PayResp.java
Normal file
44
sources/com/tencent/mm/opensdk/modelpay/PayResp.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.tencent.mm.opensdk.modelpay;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PayResp extends BaseResp {
|
||||
public String extData;
|
||||
public String prepayId;
|
||||
public String returnKey;
|
||||
|
||||
public PayResp() {
|
||||
}
|
||||
|
||||
public PayResp(Bundle bundle) {
|
||||
fromBundle(bundle);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public boolean checkArgs() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void fromBundle(Bundle bundle) {
|
||||
super.fromBundle(bundle);
|
||||
this.prepayId = bundle.getString("_wxapi_payresp_prepayid");
|
||||
this.returnKey = bundle.getString("_wxapi_payresp_returnkey");
|
||||
this.extData = bundle.getString("_wxapi_payresp_extdata");
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public int getType() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.modelbase.BaseResp
|
||||
public void toBundle(Bundle bundle) {
|
||||
super.toBundle(bundle);
|
||||
bundle.putString("_wxapi_payresp_prepayid", this.prepayId);
|
||||
bundle.putString("_wxapi_payresp_returnkey", this.returnKey);
|
||||
bundle.putString("_wxapi_payresp_extdata", this.extData);
|
||||
}
|
||||
}
|
33
sources/com/tencent/mm/opensdk/openapi/IWXAPI.java
Normal file
33
sources/com/tencent/mm/opensdk/openapi/IWXAPI.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.tencent.mm.opensdk.openapi;
|
||||
|
||||
import android.content.Intent;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.utils.ILog;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IWXAPI {
|
||||
void detach();
|
||||
|
||||
int getWXAppSupportAPI();
|
||||
|
||||
boolean handleIntent(Intent intent, IWXAPIEventHandler iWXAPIEventHandler);
|
||||
|
||||
boolean isWXAppInstalled();
|
||||
|
||||
boolean isWXAppSupportAPI();
|
||||
|
||||
boolean openWXApp();
|
||||
|
||||
boolean registerApp(String str);
|
||||
|
||||
boolean registerApp(String str, long j);
|
||||
|
||||
boolean sendReq(BaseReq baseReq);
|
||||
|
||||
boolean sendResp(BaseResp baseResp);
|
||||
|
||||
void setLogImpl(ILog iLog);
|
||||
|
||||
void unregisterApp();
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.tencent.mm.opensdk.openapi;
|
||||
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IWXAPIEventHandler {
|
||||
void onReq(BaseReq baseReq);
|
||||
|
||||
void onResp(BaseResp baseResp);
|
||||
}
|
307
sources/com/tencent/mm/opensdk/openapi/MMSharedPreferences.java
Normal file
307
sources/com/tencent/mm/opensdk/openapi/MMSharedPreferences.java
Normal file
@@ -0,0 +1,307 @@
|
||||
package com.tencent.mm.opensdk.openapi;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
import com.tencent.mm.opensdk.utils.c;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MMSharedPreferences implements SharedPreferences {
|
||||
private static final String TAG = "MicroMsg.SDK.SharedPreferences";
|
||||
private final ContentResolver cr;
|
||||
private final String[] columns = {FileDownloadModel.ID, "key", "type", "value"};
|
||||
private final HashMap<String, Object> values = new HashMap<>();
|
||||
private REditor editor = null;
|
||||
|
||||
private static class REditor implements SharedPreferences.Editor {
|
||||
private ContentResolver cr;
|
||||
private Map<String, Object> values = new HashMap();
|
||||
private Set<String> remove = new HashSet();
|
||||
private boolean clear = false;
|
||||
|
||||
public REditor(ContentResolver contentResolver) {
|
||||
this.cr = contentResolver;
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences.Editor
|
||||
public void apply() {
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences.Editor
|
||||
public SharedPreferences.Editor clear() {
|
||||
this.clear = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:17:0x0097 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:19:0x00ae A[SYNTHETIC] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:23:0x003f A[SYNTHETIC] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:24:0x0099 */
|
||||
@Override // android.content.SharedPreferences.Editor
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public boolean commit() {
|
||||
/*
|
||||
r10 = this;
|
||||
android.content.ContentValues r0 = new android.content.ContentValues
|
||||
r0.<init>()
|
||||
boolean r1 = r10.clear
|
||||
r2 = 0
|
||||
if (r1 == 0) goto L14
|
||||
android.content.ContentResolver r1 = r10.cr
|
||||
android.net.Uri r3 = com.tencent.mm.opensdk.utils.c.b.CONTENT_URI
|
||||
r4 = 0
|
||||
r1.delete(r3, r4, r4)
|
||||
r10.clear = r2
|
||||
L14:
|
||||
java.util.Set<java.lang.String> r1 = r10.remove
|
||||
java.util.Iterator r1 = r1.iterator()
|
||||
L1a:
|
||||
boolean r3 = r1.hasNext()
|
||||
java.lang.String r4 = "key = ?"
|
||||
r5 = 1
|
||||
if (r3 == 0) goto L35
|
||||
java.lang.Object r3 = r1.next()
|
||||
java.lang.String r3 = (java.lang.String) r3
|
||||
android.content.ContentResolver r6 = r10.cr
|
||||
android.net.Uri r7 = com.tencent.mm.opensdk.utils.c.b.CONTENT_URI
|
||||
java.lang.String[] r5 = new java.lang.String[r5]
|
||||
r5[r2] = r3
|
||||
r6.delete(r7, r4, r5)
|
||||
goto L1a
|
||||
L35:
|
||||
java.util.Map<java.lang.String, java.lang.Object> r1 = r10.values
|
||||
java.util.Set r1 = r1.entrySet()
|
||||
java.util.Iterator r1 = r1.iterator()
|
||||
L3f:
|
||||
boolean r3 = r1.hasNext()
|
||||
if (r3 == 0) goto Lc1
|
||||
java.lang.Object r3 = r1.next()
|
||||
java.util.Map$Entry r3 = (java.util.Map.Entry) r3
|
||||
java.lang.Object r6 = r3.getValue()
|
||||
java.lang.String r7 = "MicroMsg.SDK.PluginProvider.Resolver"
|
||||
if (r6 != 0) goto L5a
|
||||
java.lang.String r8 = "unresolve failed, null value"
|
||||
L55:
|
||||
com.tencent.mm.opensdk.utils.Log.e(r7, r8)
|
||||
r7 = 0
|
||||
goto L95
|
||||
L5a:
|
||||
boolean r8 = r6 instanceof java.lang.Integer
|
||||
if (r8 == 0) goto L60
|
||||
r7 = 1
|
||||
goto L95
|
||||
L60:
|
||||
boolean r8 = r6 instanceof java.lang.Long
|
||||
if (r8 == 0) goto L66
|
||||
r7 = 2
|
||||
goto L95
|
||||
L66:
|
||||
boolean r8 = r6 instanceof java.lang.String
|
||||
if (r8 == 0) goto L6c
|
||||
r7 = 3
|
||||
goto L95
|
||||
L6c:
|
||||
boolean r8 = r6 instanceof java.lang.Boolean
|
||||
if (r8 == 0) goto L72
|
||||
r7 = 4
|
||||
goto L95
|
||||
L72:
|
||||
boolean r8 = r6 instanceof java.lang.Float
|
||||
if (r8 == 0) goto L78
|
||||
r7 = 5
|
||||
goto L95
|
||||
L78:
|
||||
boolean r8 = r6 instanceof java.lang.Double
|
||||
if (r8 == 0) goto L7e
|
||||
r7 = 6
|
||||
goto L95
|
||||
L7e:
|
||||
java.lang.StringBuilder r8 = new java.lang.StringBuilder
|
||||
java.lang.String r9 = "unresolve failed, unknown type="
|
||||
r8.<init>(r9)
|
||||
java.lang.Class r9 = r6.getClass()
|
||||
java.lang.String r9 = r9.toString()
|
||||
r8.append(r9)
|
||||
java.lang.String r8 = r8.toString()
|
||||
goto L55
|
||||
L95:
|
||||
if (r7 != 0) goto L99
|
||||
r6 = 0
|
||||
goto Lac
|
||||
L99:
|
||||
java.lang.Integer r7 = java.lang.Integer.valueOf(r7)
|
||||
java.lang.String r8 = "type"
|
||||
r0.put(r8, r7)
|
||||
java.lang.String r6 = r6.toString()
|
||||
java.lang.String r7 = "value"
|
||||
r0.put(r7, r6)
|
||||
r6 = 1
|
||||
Lac:
|
||||
if (r6 == 0) goto L3f
|
||||
android.content.ContentResolver r6 = r10.cr
|
||||
android.net.Uri r7 = com.tencent.mm.opensdk.utils.c.b.CONTENT_URI
|
||||
java.lang.String[] r8 = new java.lang.String[r5]
|
||||
java.lang.Object r3 = r3.getKey()
|
||||
java.lang.String r3 = (java.lang.String) r3
|
||||
r8[r2] = r3
|
||||
r6.update(r7, r0, r4, r8)
|
||||
goto L3f
|
||||
Lc1:
|
||||
return r5
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.opensdk.openapi.MMSharedPreferences.REditor.commit():boolean");
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences.Editor
|
||||
public SharedPreferences.Editor putBoolean(String str, boolean z) {
|
||||
this.values.put(str, Boolean.valueOf(z));
|
||||
this.remove.remove(str);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences.Editor
|
||||
public SharedPreferences.Editor putFloat(String str, float f) {
|
||||
this.values.put(str, Float.valueOf(f));
|
||||
this.remove.remove(str);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences.Editor
|
||||
public SharedPreferences.Editor putInt(String str, int i) {
|
||||
this.values.put(str, Integer.valueOf(i));
|
||||
this.remove.remove(str);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences.Editor
|
||||
public SharedPreferences.Editor putLong(String str, long j) {
|
||||
this.values.put(str, Long.valueOf(j));
|
||||
this.remove.remove(str);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences.Editor
|
||||
public SharedPreferences.Editor putString(String str, String str2) {
|
||||
this.values.put(str, str2);
|
||||
this.remove.remove(str);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences.Editor
|
||||
public SharedPreferences.Editor putStringSet(String str, Set<String> set) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences.Editor
|
||||
public SharedPreferences.Editor remove(String str) {
|
||||
this.remove.add(str);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public MMSharedPreferences(Context context) {
|
||||
this.cr = context.getContentResolver();
|
||||
}
|
||||
|
||||
private Object getValue(String str) {
|
||||
try {
|
||||
Cursor query = this.cr.query(c.b.CONTENT_URI, this.columns, "key = ?", new String[]{str}, null);
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
Object a = query.moveToFirst() ? c.a.a(query.getInt(query.getColumnIndex("type")), query.getString(query.getColumnIndex("value"))) : null;
|
||||
query.close();
|
||||
return a;
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "getValue exception:" + e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences
|
||||
public boolean contains(String str) {
|
||||
return getValue(str) != null;
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences
|
||||
public SharedPreferences.Editor edit() {
|
||||
if (this.editor == null) {
|
||||
this.editor = new REditor(this.cr);
|
||||
}
|
||||
return this.editor;
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences
|
||||
public Map<String, ?> getAll() {
|
||||
try {
|
||||
Cursor query = this.cr.query(c.b.CONTENT_URI, this.columns, null, null, null);
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
int columnIndex = query.getColumnIndex("key");
|
||||
int columnIndex2 = query.getColumnIndex("type");
|
||||
int columnIndex3 = query.getColumnIndex("value");
|
||||
while (query.moveToNext()) {
|
||||
this.values.put(query.getString(columnIndex), c.a.a(query.getInt(columnIndex2), query.getString(columnIndex3)));
|
||||
}
|
||||
query.close();
|
||||
return this.values;
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "getAll exception:" + e.getMessage());
|
||||
return this.values;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences
|
||||
public boolean getBoolean(String str, boolean z) {
|
||||
Object value = getValue(str);
|
||||
return (value == null || !(value instanceof Boolean)) ? z : ((Boolean) value).booleanValue();
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences
|
||||
public float getFloat(String str, float f) {
|
||||
Object value = getValue(str);
|
||||
return (value == null || !(value instanceof Float)) ? f : ((Float) value).floatValue();
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences
|
||||
public int getInt(String str, int i) {
|
||||
Object value = getValue(str);
|
||||
return (value == null || !(value instanceof Integer)) ? i : ((Integer) value).intValue();
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences
|
||||
public long getLong(String str, long j) {
|
||||
Object value = getValue(str);
|
||||
return (value == null || !(value instanceof Long)) ? j : ((Long) value).longValue();
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences
|
||||
public String getString(String str, String str2) {
|
||||
Object value = getValue(str);
|
||||
return (value == null || !(value instanceof String)) ? str2 : (String) value;
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences
|
||||
public Set<String> getStringSet(String str, Set<String> set) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences
|
||||
public void registerOnSharedPreferenceChangeListener(SharedPreferences.OnSharedPreferenceChangeListener onSharedPreferenceChangeListener) {
|
||||
}
|
||||
|
||||
@Override // android.content.SharedPreferences
|
||||
public void unregisterOnSharedPreferenceChangeListener(SharedPreferences.OnSharedPreferenceChangeListener onSharedPreferenceChangeListener) {
|
||||
}
|
||||
}
|
22
sources/com/tencent/mm/opensdk/openapi/WXAPIFactory.java
Normal file
22
sources/com/tencent/mm/opensdk/openapi/WXAPIFactory.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.tencent.mm.opensdk.openapi;
|
||||
|
||||
import android.content.Context;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WXAPIFactory {
|
||||
private static final String TAG = "MicroMsg.PaySdk.WXFactory";
|
||||
|
||||
private WXAPIFactory() {
|
||||
throw new RuntimeException(WXAPIFactory.class.getSimpleName() + " should not be instantiated");
|
||||
}
|
||||
|
||||
public static IWXAPI createWXAPI(Context context, String str) {
|
||||
return createWXAPI(context, str, false);
|
||||
}
|
||||
|
||||
public static IWXAPI createWXAPI(Context context, String str, boolean z) {
|
||||
Log.d(TAG, "createWXAPI, appId = " + str + ", checkSignature = " + z);
|
||||
return new WXApiImplV10(context, str, z);
|
||||
}
|
||||
}
|
52
sources/com/tencent/mm/opensdk/openapi/WXApiImplComm.java
Normal file
52
sources/com/tencent/mm/opensdk/openapi/WXApiImplComm.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.tencent.mm.opensdk.openapi;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.Signature;
|
||||
import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
||||
import com.tencent.mm.opensdk.utils.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class WXApiImplComm {
|
||||
private static final String TAG = "MicroMsg.SDK.WXMsgImplComm";
|
||||
private static final String WX_APP_SIGNATURE = "308202eb30820254a00302010202044d36f7a4300d06092a864886f70d01010505003081b9310b300906035504061302383631123010060355040813094775616e67646f6e673111300f060355040713085368656e7a68656e31353033060355040a132c54656e63656e7420546563686e6f6c6f6779285368656e7a68656e2920436f6d70616e79204c696d69746564313a3038060355040b133154656e63656e74204775616e677a686f7520526573656172636820616e6420446576656c6f706d656e742043656e7465723110300e0603550403130754656e63656e74301e170d3131303131393134333933325a170d3431303131313134333933325a3081b9310b300906035504061302383631123010060355040813094775616e67646f6e673111300f060355040713085368656e7a68656e31353033060355040a132c54656e63656e7420546563686e6f6c6f6779285368656e7a68656e2920436f6d70616e79204c696d69746564313a3038060355040b133154656e63656e74204775616e677a686f7520526573656172636820616e6420446576656c6f706d656e742043656e7465723110300e0603550403130754656e63656e7430819f300d06092a864886f70d010101050003818d0030818902818100c05f34b231b083fb1323670bfbe7bdab40c0c0a6efc87ef2072a1ff0d60cc67c8edb0d0847f210bea6cbfaa241be70c86daf56be08b723c859e52428a064555d80db448cdcacc1aea2501eba06f8bad12a4fa49d85cacd7abeb68945a5cb5e061629b52e3254c373550ee4e40cb7c8ae6f7a8151ccd8df582d446f39ae0c5e930203010001300d06092a864886f70d0101050500038181009c8d9d7f2f908c42081b4c764c377109a8b2c70582422125ce545842d5f520aea69550b6bd8bfd94e987b75a3077eb04ad341f481aac266e89d3864456e69fba13df018acdc168b9a19dfd7ad9d9cc6f6ace57c746515f71234df3a053e33ba93ece5cd0fc15f3e389a3f365588a9fcb439e069d3629cd7732a13fff7b891499";
|
||||
|
||||
private WXApiImplComm() {
|
||||
throw new RuntimeException(WXApiImplComm.class.getSimpleName() + " should not be instantiated");
|
||||
}
|
||||
|
||||
public static boolean isIntentFromWx(Intent intent, String str) {
|
||||
String stringExtra;
|
||||
return (intent == null || (stringExtra = intent.getStringExtra(ConstantsAPI.Token.WX_TOKEN_KEY)) == null || !stringExtra.equals(str)) ? false : true;
|
||||
}
|
||||
|
||||
public static boolean validateAppSignature(Context context, Signature[] signatureArr, boolean z) {
|
||||
String str;
|
||||
if (z) {
|
||||
for (Signature signature : signatureArr) {
|
||||
String lowerCase = signature.toCharsString().toLowerCase();
|
||||
Log.d(TAG, "check signature:" + lowerCase);
|
||||
if (lowerCase.equals(WX_APP_SIGNATURE)) {
|
||||
str = "pass";
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
str = "ignore wechat app signature validation";
|
||||
Log.d(TAG, str);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean validateAppSignatureForPackage(Context context, String str, boolean z) {
|
||||
if (z) {
|
||||
try {
|
||||
return validateAppSignature(context, context.getPackageManager().getPackageInfo(str, 64).signatures, z);
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Log.d(TAG, "ignore wechat app signature validation");
|
||||
return true;
|
||||
}
|
||||
}
|
704
sources/com/tencent/mm/opensdk/openapi/WXApiImplV10.java
Normal file
704
sources/com/tencent/mm/opensdk/openapi/WXApiImplV10.java
Normal file
@@ -0,0 +1,704 @@
|
||||
package com.tencent.mm.opensdk.openapi;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.app.Service;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import com.tencent.mm.opensdk.channel.MMessageActV2;
|
||||
import com.tencent.mm.opensdk.channel.a.a;
|
||||
import com.tencent.mm.opensdk.channel.a.b;
|
||||
import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.modelbiz.AddCardToWXCardPackage;
|
||||
import com.tencent.mm.opensdk.modelbiz.ChooseCardFromWXCardPackage;
|
||||
import com.tencent.mm.opensdk.modelbiz.CreateChatroom;
|
||||
import com.tencent.mm.opensdk.modelbiz.HandleScanResult;
|
||||
import com.tencent.mm.opensdk.modelbiz.JoinChatroom;
|
||||
import com.tencent.mm.opensdk.modelbiz.OpenWebview;
|
||||
import com.tencent.mm.opensdk.modelbiz.SubscribeMessage;
|
||||
import com.tencent.mm.opensdk.modelmsg.GetMessageFromWX;
|
||||
import com.tencent.mm.opensdk.modelmsg.LaunchFromWX;
|
||||
import com.tencent.mm.opensdk.modelmsg.SendAuth;
|
||||
import com.tencent.mm.opensdk.modelmsg.SendMessageToWX;
|
||||
import com.tencent.mm.opensdk.modelmsg.ShowMessageFromWX;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXMiniProgramObject;
|
||||
import com.tencent.mm.opensdk.modelmsg.WXWebpageObject;
|
||||
import com.tencent.mm.opensdk.modelpay.PayResp;
|
||||
import com.tencent.mm.opensdk.utils.ILog;
|
||||
import com.tencent.mm.opensdk.utils.d;
|
||||
import com.tencent.open.SocialConstants;
|
||||
import com.tencent.wxop.stat.MtaSDkException;
|
||||
import com.tencent.wxop.stat.StatConfig;
|
||||
import com.tencent.wxop.stat.StatReportStrategy;
|
||||
import com.tencent.wxop.stat.StatService;
|
||||
import com.tencent.wxop.stat.common.StatConstants;
|
||||
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class WXApiImplV10 implements IWXAPI {
|
||||
private static final String TAG = "MicroMsg.SDK.WXApiImplV10";
|
||||
private static ActivityLifecycleCb activityCb;
|
||||
private static String wxappPayEntryClassname;
|
||||
private String appId;
|
||||
private boolean checkSignature;
|
||||
private Context context;
|
||||
private boolean detached = false;
|
||||
|
||||
private static final class ActivityLifecycleCb implements Application.ActivityLifecycleCallbacks {
|
||||
private static final int DELAYED = 800;
|
||||
private static final String TAG = "MicroMsg.SDK.WXApiImplV10.ActivityLifecycleCb";
|
||||
private Context context;
|
||||
private Handler handler;
|
||||
private boolean isForeground;
|
||||
private Runnable onPausedRunnable;
|
||||
private Runnable onResumedRunnable;
|
||||
|
||||
private ActivityLifecycleCb(Context context) {
|
||||
this.isForeground = false;
|
||||
this.handler = new Handler(Looper.getMainLooper());
|
||||
this.onPausedRunnable = new Runnable() { // from class: com.tencent.mm.opensdk.openapi.WXApiImplV10.ActivityLifecycleCb.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (WXApiImplV10.activityCb == null || !ActivityLifecycleCb.this.isForeground) {
|
||||
return;
|
||||
}
|
||||
Log.v(ActivityLifecycleCb.TAG, "WXStat trigger onBackground");
|
||||
StatService.trackCustomKVEvent(ActivityLifecycleCb.this.context, "onBackground_WX", null);
|
||||
ActivityLifecycleCb.this.isForeground = false;
|
||||
}
|
||||
};
|
||||
this.onResumedRunnable = new Runnable() { // from class: com.tencent.mm.opensdk.openapi.WXApiImplV10.ActivityLifecycleCb.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (WXApiImplV10.activityCb == null || ActivityLifecycleCb.this.isForeground) {
|
||||
return;
|
||||
}
|
||||
Log.v(ActivityLifecycleCb.TAG, "WXStat trigger onForeground");
|
||||
StatService.trackCustomKVEvent(ActivityLifecycleCb.this.context, "onForeground_WX", null);
|
||||
ActivityLifecycleCb.this.isForeground = true;
|
||||
}
|
||||
};
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public final void detach() {
|
||||
this.handler.removeCallbacks(this.onResumedRunnable);
|
||||
this.handler.removeCallbacks(this.onPausedRunnable);
|
||||
this.context = null;
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityCreated(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityDestroyed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityPaused(Activity activity) {
|
||||
Log.v(TAG, activity.getComponentName().getClassName() + " onActivityPaused");
|
||||
this.handler.removeCallbacks(this.onResumedRunnable);
|
||||
this.handler.postDelayed(this.onPausedRunnable, 800L);
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityResumed(Activity activity) {
|
||||
Log.v(TAG, activity.getComponentName().getClassName() + " onActivityResumed");
|
||||
this.handler.removeCallbacks(this.onPausedRunnable);
|
||||
this.handler.postDelayed(this.onResumedRunnable, 800L);
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityStarted(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public final void onActivityStopped(Activity activity) {
|
||||
}
|
||||
}
|
||||
|
||||
WXApiImplV10(Context context, String str, boolean z) {
|
||||
this.checkSignature = false;
|
||||
com.tencent.mm.opensdk.utils.Log.d(TAG, "<init>, appId = " + str + ", checkSignature = " + z);
|
||||
this.context = context;
|
||||
this.appId = str;
|
||||
this.checkSignature = z;
|
||||
}
|
||||
|
||||
private boolean checkSumConsistent(byte[] bArr, byte[] bArr2) {
|
||||
String str;
|
||||
if (bArr == null || bArr.length == 0 || bArr2 == null || bArr2.length == 0) {
|
||||
str = "checkSumConsistent fail, invalid arguments";
|
||||
} else {
|
||||
if (bArr.length == bArr2.length) {
|
||||
for (int i = 0; i < bArr.length; i++) {
|
||||
if (bArr[i] != bArr2[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
str = "checkSumConsistent fail, length is different";
|
||||
}
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean createChatroom(Context context, Bundle bundle) {
|
||||
Cursor query = context.getContentResolver().query(Uri.parse("content://com.tencent.mm.sdk.comm.provider/createChatroom"), null, null, new String[]{this.appId, bundle.getString("_wxapi_basereq_transaction", ""), bundle.getString("_wxapi_create_chatroom_group_id", ""), bundle.getString("_wxapi_create_chatroom_chatroom_name", ""), bundle.getString("_wxapi_create_chatroom_chatroom_nickname", ""), bundle.getString("_wxapi_create_chatroom_ext_msg", ""), bundle.getString("_wxapi_basereq_openid", "")}, null);
|
||||
if (query != null) {
|
||||
query.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean handleWxInternalRespType(String str, IWXAPIEventHandler iWXAPIEventHandler) {
|
||||
Uri parse;
|
||||
String queryParameter;
|
||||
com.tencent.mm.opensdk.utils.Log.i(TAG, "handleWxInternalRespType, extInfo = " + str);
|
||||
try {
|
||||
parse = Uri.parse("http://www.qq.com/s?" + str);
|
||||
queryParameter = parse.getQueryParameter("wx_internal_resptype");
|
||||
com.tencent.mm.opensdk.utils.Log.i(TAG, "handleWxInternalRespType, respType = " + queryParameter);
|
||||
} catch (Exception e) {
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "handleWxInternalRespType fail, ex = " + e.getMessage());
|
||||
}
|
||||
if (d.h(queryParameter)) {
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "handleWxInternalRespType fail, respType is null");
|
||||
return false;
|
||||
}
|
||||
if (!queryParameter.equals("subscribemessage")) {
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "handleWxInternalRespType fail, unknown resptype = " + queryParameter);
|
||||
return false;
|
||||
}
|
||||
SubscribeMessage.Resp resp = new SubscribeMessage.Resp();
|
||||
resp.openId = parse.getQueryParameter(SocialConstants.PARAM_OPEN_ID);
|
||||
resp.templateID = parse.getQueryParameter("template_id");
|
||||
resp.scene = d.i(parse.getQueryParameter("scene"));
|
||||
resp.action = parse.getQueryParameter("action");
|
||||
resp.reserved = parse.getQueryParameter("reserved");
|
||||
iWXAPIEventHandler.onResp(resp);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void initMta(Context context, String str) {
|
||||
String str2 = "AWXOP" + str;
|
||||
StatConfig.setAppKey(context, str2);
|
||||
StatConfig.setEnableSmartReporting(true);
|
||||
StatConfig.setStatSendStrategy(StatReportStrategy.PERIOD);
|
||||
StatConfig.setSendPeriodMinutes(60);
|
||||
StatConfig.setInstallChannel(context, "Wechat_Sdk");
|
||||
try {
|
||||
StatService.startStatService(context, str2, StatConstants.VERSION);
|
||||
} catch (MtaSDkException e) {
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "initMta exception:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private boolean joinChatroom(Context context, Bundle bundle) {
|
||||
Cursor query = context.getContentResolver().query(Uri.parse("content://com.tencent.mm.sdk.comm.provider/joinChatroom"), null, null, new String[]{this.appId, bundle.getString("_wxapi_basereq_transaction", ""), bundle.getString("_wxapi_join_chatroom_group_id", ""), bundle.getString("_wxapi_join_chatroom_chatroom_nickname", ""), bundle.getString("_wxapi_join_chatroom_ext_msg", ""), bundle.getString("_wxapi_basereq_openid", "")}, null);
|
||||
if (query != null) {
|
||||
query.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean sendAddCardToWX(Context context, Bundle bundle) {
|
||||
Cursor query = context.getContentResolver().query(Uri.parse("content://com.tencent.mm.sdk.comm.provider/addCardToWX"), null, null, new String[]{this.appId, bundle.getString("_wxapi_add_card_to_wx_card_list"), bundle.getString("_wxapi_basereq_transaction")}, null);
|
||||
if (query != null) {
|
||||
query.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean sendChooseCardFromWX(Context context, Bundle bundle) {
|
||||
Cursor query = context.getContentResolver().query(Uri.parse("content://com.tencent.mm.sdk.comm.provider/chooseCardFromWX"), null, null, new String[]{bundle.getString("_wxapi_choose_card_from_wx_card_app_id"), bundle.getString("_wxapi_choose_card_from_wx_card_location_id"), bundle.getString("_wxapi_choose_card_from_wx_card_sign_type"), bundle.getString("_wxapi_choose_card_from_wx_card_card_sign"), bundle.getString("_wxapi_choose_card_from_wx_card_time_stamp"), bundle.getString("_wxapi_choose_card_from_wx_card_nonce_str"), bundle.getString("_wxapi_choose_card_from_wx_card_card_id"), bundle.getString("_wxapi_choose_card_from_wx_card_card_type"), bundle.getString("_wxapi_choose_card_from_wx_card_can_multi_select"), bundle.getString("_wxapi_basereq_transaction")}, null);
|
||||
if (query != null) {
|
||||
query.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean sendHandleScanResult(Context context, Bundle bundle) {
|
||||
Cursor query = context.getContentResolver().query(Uri.parse("content://com.tencent.mm.sdk.comm.provider/handleScanResult"), null, null, new String[]{this.appId, bundle.getString("_wxapi_scan_qrcode_result")}, null);
|
||||
if (query != null) {
|
||||
query.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean sendJumpToBizProfileReq(Context context, Bundle bundle) {
|
||||
ContentResolver contentResolver = context.getContentResolver();
|
||||
Uri parse = Uri.parse("content://com.tencent.mm.sdk.comm.provider/jumpToBizProfile");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(bundle.getInt("_wxapi_jump_to_biz_profile_req_scene"));
|
||||
StringBuilder sb2 = new StringBuilder();
|
||||
sb2.append(bundle.getInt("_wxapi_jump_to_biz_profile_req_profile_type"));
|
||||
Cursor query = contentResolver.query(parse, null, null, new String[]{this.appId, bundle.getString("_wxapi_jump_to_biz_profile_req_to_user_name"), bundle.getString("_wxapi_jump_to_biz_profile_req_ext_msg"), sb.toString(), sb2.toString()}, null);
|
||||
if (query != null) {
|
||||
query.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean sendJumpToBizTempSessionReq(Context context, Bundle bundle) {
|
||||
ContentResolver contentResolver = context.getContentResolver();
|
||||
Uri parse = Uri.parse("content://com.tencent.mm.sdk.comm.provider/jumpToBizTempSession");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(bundle.getInt("_wxapi_jump_to_biz_webview_req_show_type"));
|
||||
Cursor query = contentResolver.query(parse, null, null, new String[]{this.appId, bundle.getString("_wxapi_jump_to_biz_webview_req_to_user_name"), bundle.getString("_wxapi_jump_to_biz_webview_req_session_from"), sb.toString()}, null);
|
||||
if (query != null) {
|
||||
query.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean sendJumpToBizWebviewReq(Context context, Bundle bundle) {
|
||||
ContentResolver contentResolver = context.getContentResolver();
|
||||
Uri parse = Uri.parse("content://com.tencent.mm.sdk.comm.provider/jumpToBizProfile");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(bundle.getInt("_wxapi_jump_to_biz_webview_req_scene"));
|
||||
Cursor query = contentResolver.query(parse, null, null, new String[]{this.appId, bundle.getString("_wxapi_jump_to_biz_webview_req_to_user_name"), bundle.getString("_wxapi_jump_to_biz_webview_req_ext_msg"), sb.toString()}, null);
|
||||
if (query != null) {
|
||||
query.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean sendOpenBusiLuckyMoney(Context context, Bundle bundle) {
|
||||
Cursor query = context.getContentResolver().query(Uri.parse("content://com.tencent.mm.sdk.comm.provider/openBusiLuckyMoney"), null, null, new String[]{this.appId, bundle.getString("_wxapi_open_busi_lucky_money_timeStamp"), bundle.getString("_wxapi_open_busi_lucky_money_nonceStr"), bundle.getString("_wxapi_open_busi_lucky_money_signType"), bundle.getString("_wxapi_open_busi_lucky_money_signature"), bundle.getString("_wxapi_open_busi_lucky_money_package")}, null);
|
||||
if (query != null) {
|
||||
query.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean sendOpenRankListReq(Context context, Bundle bundle) {
|
||||
Cursor query = context.getContentResolver().query(Uri.parse("content://com.tencent.mm.sdk.comm.provider/openRankList"), null, null, new String[0], null);
|
||||
if (query == null) {
|
||||
return true;
|
||||
}
|
||||
query.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean sendOpenWebview(Context context, Bundle bundle) {
|
||||
Cursor query = context.getContentResolver().query(Uri.parse("content://com.tencent.mm.sdk.comm.provider/openWebview"), null, null, new String[]{this.appId, bundle.getString("_wxapi_jump_to_webview_url"), bundle.getString("_wxapi_basereq_transaction")}, null);
|
||||
if (query != null) {
|
||||
query.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean sendPayReq(Context context, Bundle bundle) {
|
||||
if (wxappPayEntryClassname == null) {
|
||||
wxappPayEntryClassname = new MMSharedPreferences(context).getString("_wxapp_pay_entry_classname_", null);
|
||||
com.tencent.mm.opensdk.utils.Log.d(TAG, "pay, set wxappPayEntryClassname = " + wxappPayEntryClassname);
|
||||
if (wxappPayEntryClassname == null) {
|
||||
try {
|
||||
wxappPayEntryClassname = context.getPackageManager().getApplicationInfo("com.tencent.mm", PeripheralType.SERVO).metaData.getString("com.tencent.mm.BuildInfo.OPEN_SDK_PAY_ENTRY_CLASSNAME", null);
|
||||
} catch (Exception e) {
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "get from metaData failed : " + e.getMessage());
|
||||
}
|
||||
}
|
||||
if (wxappPayEntryClassname == null) {
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "pay fail, wxappPayEntryClassname is null");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
MMessageActV2.Args args = new MMessageActV2.Args();
|
||||
args.bundle = bundle;
|
||||
args.targetPkgName = "com.tencent.mm";
|
||||
args.targetClassName = wxappPayEntryClassname;
|
||||
return MMessageActV2.send(context, args);
|
||||
}
|
||||
|
||||
private boolean sendSubscribeMessage(Context context, BaseReq baseReq) {
|
||||
SubscribeMessage.Req req = (SubscribeMessage.Req) baseReq;
|
||||
Cursor query = context.getContentResolver().query(Uri.parse("content://com.tencent.mm.sdk.comm.provider/openTypeWebview"), null, null, new String[]{this.appId, "1", String.valueOf(req.scene), req.templateID, req.reserved}, null);
|
||||
if (query != null) {
|
||||
query.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.openapi.IWXAPI
|
||||
public final void detach() {
|
||||
Application application;
|
||||
com.tencent.mm.opensdk.utils.Log.d(TAG, "detach");
|
||||
this.detached = true;
|
||||
if (activityCb != null && Build.VERSION.SDK_INT >= 14) {
|
||||
Context context = this.context;
|
||||
if (context instanceof Activity) {
|
||||
application = ((Activity) context).getApplication();
|
||||
} else {
|
||||
if (context instanceof Service) {
|
||||
application = ((Service) context).getApplication();
|
||||
}
|
||||
activityCb.detach();
|
||||
}
|
||||
application.unregisterActivityLifecycleCallbacks(activityCb);
|
||||
activityCb.detach();
|
||||
}
|
||||
this.context = null;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.openapi.IWXAPI
|
||||
public final int getWXAppSupportAPI() {
|
||||
if (this.detached) {
|
||||
throw new IllegalStateException("getWXAppSupportAPI fail, WXMsgImpl has been detached");
|
||||
}
|
||||
if (!isWXAppInstalled()) {
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "open wx app failed, not installed or signature check failed");
|
||||
return 0;
|
||||
}
|
||||
int i = new MMSharedPreferences(this.context).getInt("_build_info_sdk_int_", 0);
|
||||
if (i != 0) {
|
||||
return i;
|
||||
}
|
||||
try {
|
||||
return this.context.getPackageManager().getApplicationInfo("com.tencent.mm", PeripheralType.SERVO).metaData.getInt("com.tencent.mm.BuildInfo.OPEN_SDK_VERSION", 0);
|
||||
} catch (Exception e) {
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "get from metaData failed : " + e.getMessage());
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.openapi.IWXAPI
|
||||
public final boolean handleIntent(Intent intent, IWXAPIEventHandler iWXAPIEventHandler) {
|
||||
try {
|
||||
} catch (Exception e) {
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "handleIntent fail, ex = " + e.getMessage());
|
||||
}
|
||||
if (!WXApiImplComm.isIntentFromWx(intent, ConstantsAPI.Token.WX_TOKEN_VALUE_MSG)) {
|
||||
com.tencent.mm.opensdk.utils.Log.i(TAG, "handleIntent fail, intent not from weixin msg");
|
||||
return false;
|
||||
}
|
||||
if (this.detached) {
|
||||
throw new IllegalStateException("handleIntent fail, WXMsgImpl has been detached");
|
||||
}
|
||||
String stringExtra = intent.getStringExtra(ConstantsAPI.CONTENT);
|
||||
int intExtra = intent.getIntExtra(ConstantsAPI.SDK_VERSION, 0);
|
||||
String stringExtra2 = intent.getStringExtra(ConstantsAPI.APP_PACKAGE);
|
||||
if (stringExtra2 != null && stringExtra2.length() != 0) {
|
||||
if (!checkSumConsistent(intent.getByteArrayExtra(ConstantsAPI.CHECK_SUM), b.a(stringExtra, intExtra, stringExtra2))) {
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "checksum fail");
|
||||
return false;
|
||||
}
|
||||
int intExtra2 = intent.getIntExtra("_wxapi_command_type", 0);
|
||||
com.tencent.mm.opensdk.utils.Log.i(TAG, "handleIntent, cmd = " + intExtra2);
|
||||
switch (intExtra2) {
|
||||
case 1:
|
||||
iWXAPIEventHandler.onResp(new SendAuth.Resp(intent.getExtras()));
|
||||
return true;
|
||||
case 2:
|
||||
iWXAPIEventHandler.onResp(new SendMessageToWX.Resp(intent.getExtras()));
|
||||
return true;
|
||||
case 3:
|
||||
iWXAPIEventHandler.onReq(new GetMessageFromWX.Req(intent.getExtras()));
|
||||
return true;
|
||||
case 4:
|
||||
ShowMessageFromWX.Req req = new ShowMessageFromWX.Req(intent.getExtras());
|
||||
String str = req.message.messageExt;
|
||||
if (str == null || !str.contains("wx_internal_resptype")) {
|
||||
iWXAPIEventHandler.onReq(req);
|
||||
return true;
|
||||
}
|
||||
boolean handleWxInternalRespType = handleWxInternalRespType(str, iWXAPIEventHandler);
|
||||
com.tencent.mm.opensdk.utils.Log.i(TAG, "handleIntent, extInfo contains wx_internal_resptype, ret = " + handleWxInternalRespType);
|
||||
return handleWxInternalRespType;
|
||||
case 5:
|
||||
iWXAPIEventHandler.onResp(new PayResp(intent.getExtras()));
|
||||
return true;
|
||||
case 6:
|
||||
iWXAPIEventHandler.onReq(new LaunchFromWX.Req(intent.getExtras()));
|
||||
return true;
|
||||
case 7:
|
||||
case 8:
|
||||
case 10:
|
||||
case 11:
|
||||
case 13:
|
||||
default:
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "unknown cmd = " + intExtra2);
|
||||
return false;
|
||||
case 9:
|
||||
iWXAPIEventHandler.onResp(new AddCardToWXCardPackage.Resp(intent.getExtras()));
|
||||
return true;
|
||||
case 12:
|
||||
iWXAPIEventHandler.onResp(new OpenWebview.Resp(intent.getExtras()));
|
||||
return true;
|
||||
case 14:
|
||||
iWXAPIEventHandler.onResp(new CreateChatroom.Resp(intent.getExtras()));
|
||||
return true;
|
||||
case 15:
|
||||
iWXAPIEventHandler.onResp(new JoinChatroom.Resp(intent.getExtras()));
|
||||
return true;
|
||||
case 16:
|
||||
iWXAPIEventHandler.onResp(new ChooseCardFromWXCardPackage.Resp(intent.getExtras()));
|
||||
return true;
|
||||
case 17:
|
||||
iWXAPIEventHandler.onResp(new HandleScanResult.Resp(intent.getExtras()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "invalid argument");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.openapi.IWXAPI
|
||||
public final boolean isWXAppInstalled() {
|
||||
if (this.detached) {
|
||||
throw new IllegalStateException("isWXAppInstalled fail, WXMsgImpl has been detached");
|
||||
}
|
||||
try {
|
||||
PackageInfo packageInfo = this.context.getPackageManager().getPackageInfo("com.tencent.mm", 64);
|
||||
if (packageInfo == null) {
|
||||
return false;
|
||||
}
|
||||
return WXApiImplComm.validateAppSignature(this.context, packageInfo.signatures, this.checkSignature);
|
||||
} catch (PackageManager.NameNotFoundException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.openapi.IWXAPI
|
||||
public final boolean isWXAppSupportAPI() {
|
||||
if (this.detached) {
|
||||
throw new IllegalStateException("isWXAppSupportAPI fail, WXMsgImpl has been detached");
|
||||
}
|
||||
return getWXAppSupportAPI() >= 620756998;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.openapi.IWXAPI
|
||||
public final boolean openWXApp() {
|
||||
String str;
|
||||
if (this.detached) {
|
||||
throw new IllegalStateException("openWXApp fail, WXMsgImpl has been detached");
|
||||
}
|
||||
if (isWXAppInstalled()) {
|
||||
try {
|
||||
this.context.startActivity(this.context.getPackageManager().getLaunchIntentForPackage("com.tencent.mm"));
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
str = "startActivity fail, exception = " + e.getMessage();
|
||||
}
|
||||
} else {
|
||||
str = "open wx app failed, not installed or signature check failed";
|
||||
}
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.openapi.IWXAPI
|
||||
public final boolean registerApp(String str) {
|
||||
return registerApp(str, 0L);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.openapi.IWXAPI
|
||||
public final boolean registerApp(String str, long j) {
|
||||
Application application;
|
||||
if (this.detached) {
|
||||
throw new IllegalStateException("registerApp fail, WXMsgImpl has been detached");
|
||||
}
|
||||
if (!WXApiImplComm.validateAppSignatureForPackage(this.context, "com.tencent.mm", this.checkSignature)) {
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "register app failed for wechat app signature check failed");
|
||||
return false;
|
||||
}
|
||||
com.tencent.mm.opensdk.utils.Log.d(TAG, "registerApp, appId = " + str);
|
||||
if (str != null) {
|
||||
this.appId = str;
|
||||
}
|
||||
if (activityCb == null && Build.VERSION.SDK_INT >= 14) {
|
||||
Context context = this.context;
|
||||
if (context instanceof Activity) {
|
||||
initMta(context, str);
|
||||
activityCb = new ActivityLifecycleCb(this.context);
|
||||
application = ((Activity) this.context).getApplication();
|
||||
} else if (context instanceof Service) {
|
||||
initMta(context, str);
|
||||
activityCb = new ActivityLifecycleCb(this.context);
|
||||
application = ((Service) this.context).getApplication();
|
||||
} else {
|
||||
com.tencent.mm.opensdk.utils.Log.w(TAG, "context is not instanceof Activity or Service, disable WXStat");
|
||||
}
|
||||
application.registerActivityLifecycleCallbacks(activityCb);
|
||||
}
|
||||
com.tencent.mm.opensdk.utils.Log.d(TAG, "registerApp, appId = " + str);
|
||||
if (str != null) {
|
||||
this.appId = str;
|
||||
}
|
||||
com.tencent.mm.opensdk.utils.Log.d(TAG, "register app " + this.context.getPackageName());
|
||||
a.C0015a c0015a = new a.C0015a();
|
||||
c0015a.W = "com.tencent.mm";
|
||||
c0015a.action = ConstantsAPI.ACTION_HANDLE_APP_REGISTER;
|
||||
c0015a.content = "weixin://registerapp?appid=" + this.appId;
|
||||
c0015a.X = j;
|
||||
return a.a(this.context, c0015a);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.openapi.IWXAPI
|
||||
public final boolean sendReq(BaseReq baseReq) {
|
||||
StringBuilder sb;
|
||||
String str;
|
||||
String str2;
|
||||
if (this.detached) {
|
||||
throw new IllegalStateException("sendReq fail, WXMsgImpl has been detached");
|
||||
}
|
||||
if (!WXApiImplComm.validateAppSignatureForPackage(this.context, "com.tencent.mm", this.checkSignature)) {
|
||||
str2 = "sendReq failed for wechat app signature check failed";
|
||||
} else {
|
||||
if (baseReq.checkArgs()) {
|
||||
com.tencent.mm.opensdk.utils.Log.i(TAG, "sendReq, req type = " + baseReq.getType());
|
||||
Bundle bundle = new Bundle();
|
||||
baseReq.toBundle(bundle);
|
||||
if (baseReq.getType() == 5) {
|
||||
return sendPayReq(this.context, bundle);
|
||||
}
|
||||
if (baseReq.getType() == 7) {
|
||||
return sendJumpToBizProfileReq(this.context, bundle);
|
||||
}
|
||||
if (baseReq.getType() == 8) {
|
||||
return sendJumpToBizWebviewReq(this.context, bundle);
|
||||
}
|
||||
if (baseReq.getType() == 10) {
|
||||
return sendJumpToBizTempSessionReq(this.context, bundle);
|
||||
}
|
||||
if (baseReq.getType() == 9) {
|
||||
return sendAddCardToWX(this.context, bundle);
|
||||
}
|
||||
if (baseReq.getType() == 16) {
|
||||
return sendChooseCardFromWX(this.context, bundle);
|
||||
}
|
||||
if (baseReq.getType() == 11) {
|
||||
return sendOpenRankListReq(this.context, bundle);
|
||||
}
|
||||
if (baseReq.getType() == 12) {
|
||||
return sendOpenWebview(this.context, bundle);
|
||||
}
|
||||
if (baseReq.getType() == 13) {
|
||||
return sendOpenBusiLuckyMoney(this.context, bundle);
|
||||
}
|
||||
if (baseReq.getType() == 14) {
|
||||
return createChatroom(this.context, bundle);
|
||||
}
|
||||
if (baseReq.getType() == 15) {
|
||||
return joinChatroom(this.context, bundle);
|
||||
}
|
||||
if (baseReq.getType() == 17) {
|
||||
return sendHandleScanResult(this.context, bundle);
|
||||
}
|
||||
if (baseReq.getType() == 18) {
|
||||
return sendSubscribeMessage(this.context, baseReq);
|
||||
}
|
||||
if (baseReq.getType() == 2 && bundle.getInt("_wxapi_sendmessagetowx_req_media_type") == 36) {
|
||||
SendMessageToWX.Req req = (SendMessageToWX.Req) baseReq;
|
||||
if (getWXAppSupportAPI() < 620756993) {
|
||||
WXWebpageObject wXWebpageObject = new WXWebpageObject();
|
||||
wXWebpageObject.webpageUrl = bundle.getString("_wxminiprogram_webpageurl");
|
||||
req.message.mediaObject = wXWebpageObject;
|
||||
} else {
|
||||
WXMiniProgramObject wXMiniProgramObject = (WXMiniProgramObject) req.message.mediaObject;
|
||||
wXMiniProgramObject.userName += "@app";
|
||||
String str3 = wXMiniProgramObject.path;
|
||||
if (!d.h(str3)) {
|
||||
String[] split = str3.split("\\?");
|
||||
if (split.length > 1) {
|
||||
sb = new StringBuilder();
|
||||
sb.append(split[0]);
|
||||
sb.append(".html?");
|
||||
str = split[1];
|
||||
} else {
|
||||
sb = new StringBuilder();
|
||||
sb.append(split[0]);
|
||||
str = ".html";
|
||||
}
|
||||
sb.append(str);
|
||||
wXMiniProgramObject.path = sb.toString();
|
||||
}
|
||||
}
|
||||
req.scene = 0;
|
||||
baseReq.toBundle(bundle);
|
||||
}
|
||||
MMessageActV2.Args args = new MMessageActV2.Args();
|
||||
args.bundle = bundle;
|
||||
args.content = "weixin://sendreq?appid=" + this.appId;
|
||||
args.targetPkgName = "com.tencent.mm";
|
||||
args.targetClassName = "com.tencent.mm.plugin.base.stub.WXEntryActivity";
|
||||
return MMessageActV2.send(this.context, args);
|
||||
}
|
||||
str2 = "sendReq checkArgs fail";
|
||||
}
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, str2);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.openapi.IWXAPI
|
||||
public final boolean sendResp(BaseResp baseResp) {
|
||||
String str;
|
||||
if (this.detached) {
|
||||
throw new IllegalStateException("sendResp fail, WXMsgImpl has been detached");
|
||||
}
|
||||
if (!WXApiImplComm.validateAppSignatureForPackage(this.context, "com.tencent.mm", this.checkSignature)) {
|
||||
str = "sendResp failed for wechat app signature check failed";
|
||||
} else {
|
||||
if (baseResp.checkArgs()) {
|
||||
Bundle bundle = new Bundle();
|
||||
baseResp.toBundle(bundle);
|
||||
MMessageActV2.Args args = new MMessageActV2.Args();
|
||||
args.bundle = bundle;
|
||||
args.content = "weixin://sendresp?appid=" + this.appId;
|
||||
args.targetPkgName = "com.tencent.mm";
|
||||
args.targetClassName = "com.tencent.mm.plugin.base.stub.WXEntryActivity";
|
||||
return MMessageActV2.send(this.context, args);
|
||||
}
|
||||
str = "sendResp checkArgs fail";
|
||||
}
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, str);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.openapi.IWXAPI
|
||||
public final void setLogImpl(ILog iLog) {
|
||||
com.tencent.mm.opensdk.utils.Log.setLogImpl(iLog);
|
||||
}
|
||||
|
||||
@Override // com.tencent.mm.opensdk.openapi.IWXAPI
|
||||
public final void unregisterApp() {
|
||||
if (this.detached) {
|
||||
throw new IllegalStateException("unregisterApp fail, WXMsgImpl has been detached");
|
||||
}
|
||||
if (!WXApiImplComm.validateAppSignatureForPackage(this.context, "com.tencent.mm", this.checkSignature)) {
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "unregister app failed for wechat app signature check failed");
|
||||
return;
|
||||
}
|
||||
com.tencent.mm.opensdk.utils.Log.d(TAG, "unregisterApp, appId = " + this.appId);
|
||||
String str = this.appId;
|
||||
if (str == null || str.length() == 0) {
|
||||
com.tencent.mm.opensdk.utils.Log.e(TAG, "unregisterApp fail, appId is empty");
|
||||
return;
|
||||
}
|
||||
com.tencent.mm.opensdk.utils.Log.d(TAG, "unregister app " + this.context.getPackageName());
|
||||
a.C0015a c0015a = new a.C0015a();
|
||||
c0015a.W = "com.tencent.mm";
|
||||
c0015a.action = ConstantsAPI.ACTION_HANDLE_APP_UNREGISTER;
|
||||
c0015a.content = "weixin://unregisterapp?appid=" + this.appId;
|
||||
a.a(this.context, c0015a);
|
||||
}
|
||||
}
|
14
sources/com/tencent/mm/opensdk/utils/ILog.java
Normal file
14
sources/com/tencent/mm/opensdk/utils/ILog.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.tencent.mm.opensdk.utils;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ILog {
|
||||
void d(String str, String str2);
|
||||
|
||||
void e(String str, String str2);
|
||||
|
||||
void i(String str, String str2);
|
||||
|
||||
void v(String str, String str2);
|
||||
|
||||
void w(String str, String str2);
|
||||
}
|
55
sources/com/tencent/mm/opensdk/utils/Log.java
Normal file
55
sources/com/tencent/mm/opensdk/utils/Log.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package com.tencent.mm.opensdk.utils;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Log {
|
||||
private static ILog logImpl;
|
||||
|
||||
public static void d(String str, String str2) {
|
||||
ILog iLog = logImpl;
|
||||
if (iLog == null) {
|
||||
android.util.Log.d(str, str2);
|
||||
} else {
|
||||
iLog.d(str, str2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void e(String str, String str2) {
|
||||
ILog iLog = logImpl;
|
||||
if (iLog == null) {
|
||||
android.util.Log.e(str, str2);
|
||||
} else {
|
||||
iLog.e(str, str2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void i(String str, String str2) {
|
||||
ILog iLog = logImpl;
|
||||
if (iLog == null) {
|
||||
android.util.Log.i(str, str2);
|
||||
} else {
|
||||
iLog.i(str, str2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setLogImpl(ILog iLog) {
|
||||
logImpl = iLog;
|
||||
}
|
||||
|
||||
public static void v(String str, String str2) {
|
||||
ILog iLog = logImpl;
|
||||
if (iLog == null) {
|
||||
android.util.Log.v(str, str2);
|
||||
} else {
|
||||
iLog.v(str, str2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void w(String str, String str2) {
|
||||
ILog iLog = logImpl;
|
||||
if (iLog == null) {
|
||||
android.util.Log.w(str, str2);
|
||||
} else {
|
||||
iLog.w(str, str2);
|
||||
}
|
||||
}
|
||||
}
|
30
sources/com/tencent/mm/opensdk/utils/a.java
Normal file
30
sources/com/tencent/mm/opensdk/utils/a.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.tencent.mm.opensdk.utils;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class a {
|
||||
public static int a(Bundle bundle, String str) {
|
||||
if (bundle == null) {
|
||||
return -1;
|
||||
}
|
||||
try {
|
||||
return bundle.getInt(str, -1);
|
||||
} catch (Exception e) {
|
||||
Log.e("MicroMsg.IntentUtil", "getIntExtra exception:" + e.getMessage());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public static String b(Bundle bundle, String str) {
|
||||
if (bundle == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return bundle.getString(str);
|
||||
} catch (Exception e) {
|
||||
Log.e("MicroMsg.IntentUtil", "getStringExtra exception:" + e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
26
sources/com/tencent/mm/opensdk/utils/b.java
Normal file
26
sources/com/tencent/mm/opensdk/utils/b.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.tencent.mm.opensdk.utils;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class b {
|
||||
public static final String e(byte[] bArr) {
|
||||
char[] cArr = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
||||
try {
|
||||
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
|
||||
messageDigest.update(bArr);
|
||||
byte[] digest = messageDigest.digest();
|
||||
char[] cArr2 = new char[digest.length * 2];
|
||||
int i = 0;
|
||||
for (byte b : digest) {
|
||||
int i2 = i + 1;
|
||||
cArr2[i] = cArr[(b >>> 4) & 15];
|
||||
i = i2 + 1;
|
||||
cArr2[i2] = cArr[b & 15];
|
||||
}
|
||||
return new String(cArr2);
|
||||
} catch (Exception unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
39
sources/com/tencent/mm/opensdk/utils/c.java
Normal file
39
sources/com/tencent/mm/opensdk/utils/c.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package com.tencent.mm.opensdk.utils;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.provider.BaseColumns;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class c {
|
||||
|
||||
public static final class a {
|
||||
public static Object a(int i, String str) {
|
||||
try {
|
||||
switch (i) {
|
||||
case 1:
|
||||
return Integer.valueOf(str);
|
||||
case 2:
|
||||
return Long.valueOf(str);
|
||||
case 3:
|
||||
return str;
|
||||
case 4:
|
||||
return Boolean.valueOf(str);
|
||||
case 5:
|
||||
return Float.valueOf(str);
|
||||
case 6:
|
||||
return Double.valueOf(str);
|
||||
default:
|
||||
Log.e("MicroMsg.SDK.PluginProvider.Resolver", "unknown type");
|
||||
return null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("MicroMsg.SDK.PluginProvider.Resolver", "resolveObj exception:" + e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final class b implements BaseColumns {
|
||||
public static final Uri CONTENT_URI = Uri.parse("content://com.tencent.mm.sdk.plugin.provider/sharedpref");
|
||||
}
|
||||
}
|
20
sources/com/tencent/mm/opensdk/utils/d.java
Normal file
20
sources/com/tencent/mm/opensdk/utils/d.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.tencent.mm.opensdk.utils;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class d {
|
||||
public static boolean h(String str) {
|
||||
return str == null || str.length() <= 0;
|
||||
}
|
||||
|
||||
public static int i(String str) {
|
||||
if (str != null) {
|
||||
try {
|
||||
if (str.length() > 0) {
|
||||
return Integer.parseInt(str);
|
||||
}
|
||||
} catch (Exception unused) {
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user