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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user