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