@@ -286,7 +286,7 @@ dependencies {
|
||||
implementation(name: 'CTAccount_sdk_api_v3.7.0_all', ext: 'aar')
|
||||
|
||||
implementation 'com.github.fodroid:XRadioGroup:v1.5'
|
||||
implementation files('libs/msa_mdid_1.0.13.aar')
|
||||
implementation files('libs/miit_mdid_1.0.10.aar')
|
||||
|
||||
}
|
||||
|
||||
|
BIN
app/libs/miit_mdid_1.0.10.aar
Normal file
BIN
app/libs/miit_mdid_1.0.10.aar
Normal file
Binary file not shown.
Binary file not shown.
19
app/proguard-rules.pro
vendored
19
app/proguard-rules.pro
vendored
@@ -342,25 +342,6 @@
|
||||
public <fields>;
|
||||
}
|
||||
-keep class com.bun.miitmdid.core.** {*;}
|
||||
-keep class com.bun.** {*;}
|
||||
-keep class com.asus.msa.** {*;}
|
||||
-keep class com.heytap.openid.** {*;}
|
||||
-keep class com.huawei.android.hms.pps.** {*;}
|
||||
-keep class com.meizu.flyme.openidsdk.** {*;}
|
||||
-keep class com.samsung.android.deviceidservice.** {*;}
|
||||
-keep class com.zui.** {*;}
|
||||
-keep class com.huawei.hms.ads.** {*; }
|
||||
-keep interface com.huawei.hms.ads.** {*; }
|
||||
-keepattributes *Annotation*
|
||||
-dontskipnonpubliclibraryclassmembers
|
||||
-printconfiguration
|
||||
-keep,allowobfuscation @interface androidx.annotation.Keep
|
||||
|
||||
-keep @androidx.annotation.Keep class *
|
||||
-keepclassmembers class * {
|
||||
@androidx.annotation.Keep *;
|
||||
}
|
||||
|
||||
-dontwarn com.sdk.**
|
||||
-keep class com.sdk.** { *;}
|
||||
-dontwarn io.realm.**
|
||||
|
@@ -293,11 +293,7 @@ public class XChatApplication extends Application {
|
||||
super.attachBaseContext(base);
|
||||
// you must install multiDex whatever tinker is installed!
|
||||
MultiDex.install(base);
|
||||
try {
|
||||
JLibrary.InitEntry(base);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
JLibrary.InitEntry(base);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -6,9 +6,11 @@ import android.util.Log;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.bun.miitmdid.core.ErrorCode;
|
||||
import com.bun.miitmdid.core.IIdentifierListener;
|
||||
import com.bun.miitmdid.core.MdidSdk;
|
||||
import com.bun.miitmdid.core.MdidSdkHelper;
|
||||
import com.bun.supplier.IIdentifierListener;
|
||||
import com.bun.supplier.IdSupplier;
|
||||
import com.bun.miitmdid.supplier.IdSupplier;
|
||||
import com.yizhuan.erban.application.XChatApplication;
|
||||
|
||||
/**
|
||||
* Created by zheng on 2019/8/22.
|
||||
@@ -17,74 +19,81 @@ import com.bun.supplier.IdSupplier;
|
||||
public class MiitHelper implements IIdentifierListener {
|
||||
|
||||
private AppIdsUpdater _listener;
|
||||
public MiitHelper(AppIdsUpdater callback){
|
||||
_listener=callback;
|
||||
|
||||
public MiitHelper(AppIdsUpdater callback) {
|
||||
_listener = callback;
|
||||
}
|
||||
|
||||
|
||||
public void getDeviceIds(Context cxt){
|
||||
// JLibrary.InitEntry(cxt);
|
||||
|
||||
long timeb=System.currentTimeMillis();
|
||||
// int nres = CallFromReflect(cxt);
|
||||
int nres=DirectCall(cxt);
|
||||
long timee=System.currentTimeMillis();
|
||||
long offset=timee-timeb;
|
||||
if(nres == ErrorCode.INIT_ERROR_DEVICE_NOSUPPORT){//不支持的设备
|
||||
|
||||
}else if( nres == ErrorCode.INIT_ERROR_LOAD_CONFIGFILE){//加载配置文件出错
|
||||
|
||||
}else if(nres == ErrorCode.INIT_ERROR_MANUFACTURER_NOSUPPORT){//不支持的设备厂商
|
||||
|
||||
}else if(nres == ErrorCode.INIT_ERROR_RESULT_DELAY){//获取接口是异步的,结果会在回调中返回,回调执行的回调可能在工作线程
|
||||
|
||||
}else if(nres == ErrorCode.INIT_HELPER_CALL_ERROR){//反射调用出错
|
||||
|
||||
public void getDeviceIds(Context cxt) {
|
||||
long timeb = System.currentTimeMillis();
|
||||
int nres = CallFromReflect(cxt);
|
||||
// int nres=DirectCall(cxt);
|
||||
long timee = System.currentTimeMillis();
|
||||
long offset = timee - timeb;
|
||||
if (nres == ErrorCode.INIT_ERROR_DEVICE_NOSUPPORT) {//1008612 不支持的设备
|
||||
XChatApplication.setIsSupportOaid(false, nres);
|
||||
} else if (nres == ErrorCode.INIT_ERROR_LOAD_CONFIGFILE) {//1008613 加载配置文件出错
|
||||
XChatApplication.setIsSupportOaid(false, nres);
|
||||
} else if (nres == ErrorCode.INIT_ERROR_MANUFACTURER_NOSUPPORT) {//1008611 不支持的设备厂商
|
||||
XChatApplication.setIsSupportOaid(false, nres);
|
||||
} else if (nres == ErrorCode.INIT_ERROR_RESULT_DELAY) {//1008614 获取接口是异步的,结果会在回调中返回,回调执行的回调可能在工作线程
|
||||
//TODO 这种情况,还不清楚怎么解决呢。暂且先返false
|
||||
XChatApplication.setIsSupportOaid(false, nres);
|
||||
} else if (nres == ErrorCode.INIT_HELPER_CALL_ERROR) {//1008615 反射调用出错
|
||||
XChatApplication.setIsSupportOaid(false, nres);
|
||||
}
|
||||
Log.d(getClass().getSimpleName(),"return value: "+String.valueOf(nres));
|
||||
Log.d(getClass().getSimpleName(), "return value: " + String.valueOf(nres));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 通过反射调用,解决android 9以后的类加载升级,导至找不到so中的方法
|
||||
*
|
||||
* */
|
||||
private int CallFromReflect(Context cxt){
|
||||
return MdidSdkHelper.InitSdk(cxt,true,this);
|
||||
* 通过反射调用,解决android 9以后的类加载升级,导至找不到so中的方法
|
||||
*
|
||||
* */
|
||||
private int CallFromReflect(Context cxt) {
|
||||
return MdidSdkHelper.InitSdk(cxt, true, this);
|
||||
}
|
||||
|
||||
/*
|
||||
* 直接java调用,如果这样调用,在android 9以前没有题,在android 9以后会抛找不到so方法的异常
|
||||
* 解决办法是和JLibrary.InitEntry(cxt),分开调用,比如在A类中调用JLibrary.InitEntry(cxt),在B类中调用MdidSdk的方法
|
||||
* A和B不能存在直接和间接依赖关系,否则也会报错
|
||||
*
|
||||
* */
|
||||
private int DirectCall(Context cxt){
|
||||
/* MdidSdk sdk = new MdidSdk();
|
||||
return sdk.InitSdk(cxt,this);*/
|
||||
return 0;
|
||||
* 直接java调用,如果这样调用,在android 9以前没有题,在android 9以后会抛找不到so方法的异常
|
||||
* 解决办法是和JLibrary.InitEntry(cxt),分开调用,比如在A类中调用JLibrary.InitEntry(cxt),在B类中调用MdidSdk的方法
|
||||
* A和B不能存在直接和间接依赖关系,否则也会报错
|
||||
*
|
||||
* */
|
||||
private int DirectCall(Context cxt) {
|
||||
MdidSdk sdk = new MdidSdk();
|
||||
return sdk.InitSdk(cxt, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void OnSupport(boolean isSupport, IdSupplier _supplier) {
|
||||
if(_supplier==null) {
|
||||
if (_supplier == null) {
|
||||
return;
|
||||
}
|
||||
String oaid=_supplier.getOAID();
|
||||
/* String oaid=_supplier.getOaid();
|
||||
String vaid=_supplier.getVAID();
|
||||
String aaid=_supplier.getAAID();
|
||||
String udid=_supplier.getUDID();
|
||||
StringBuilder builder=new StringBuilder();
|
||||
builder.append("support: ").append(isSupport?"true":"false").append("\n");
|
||||
builder.append("UDID: ").append(udid).append("\n");
|
||||
builder.append("OAID: ").append(oaid).append("\n");
|
||||
builder.append("VAID: ").append(vaid).append("\n");
|
||||
builder.append("AAID: ").append(aaid).append("\n");
|
||||
String idstext=builder.toString();
|
||||
if(_listener!=null){
|
||||
_listener.OnIdsAvalid(idstext);
|
||||
String idstext=builder.toString();*/
|
||||
|
||||
XChatApplication.setIsSupportOaid(isSupport);
|
||||
|
||||
String oaid = _supplier.getOAID();
|
||||
_supplier.shutDown(); //关闭接口
|
||||
if (_listener != null) {
|
||||
_listener.OnIdsAvalid(oaid);
|
||||
}
|
||||
}
|
||||
public interface AppIdsUpdater{
|
||||
|
||||
public interface AppIdsUpdater {
|
||||
void OnIdsAvalid(@NonNull String ids);
|
||||
}
|
||||
|
||||
|
@@ -13,12 +13,9 @@ import lombok.Getter;
|
||||
*/
|
||||
public class OpenSignInAttachment extends CustomAttachment {
|
||||
|
||||
@Getter
|
||||
private ImNotice imNotice;
|
||||
|
||||
public ImNotice getImNotice() {
|
||||
return imNotice;
|
||||
}
|
||||
|
||||
public OpenSignInAttachment(int first, int second) {
|
||||
super(first, second);
|
||||
}
|
||||
|
@@ -8,26 +8,11 @@ import lombok.Data;
|
||||
* 提醒,{@link com.yizhuan.xchat_android_core.im.custom.bean.OpenSignInAttachment}
|
||||
* create by lvzebiao @2019/3/20
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ImNotice implements Serializable {
|
||||
|
||||
private String title;
|
||||
|
||||
private String content;
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user