• 大小: 6M
    文件类型: .zip
    金币: 2
    下载: 0 次
    发布日期: 2024-01-20
  • 语言: Java
  • 标签: 其他  

资源简介

Android_Oaid.zip

资源截图

代码片段和文件信息

package com.mdid.msa;

import android.content.Context;
import android.support.annotation.NonNull;
import android.util.Log;

import com.bun.miitmdid.core.ErrorCode;
import com.bun.miitmdid.core.MdidSdkHelper;
import com.bun.supplier.IIdentifierListener;
import com.bun.supplier.IdSupplier;

/**
 * Created by caict on 2020/6/8.
 */

public class DemoHelper implements IIdentifierListener {

    private AppIdsUpdater _listener;
    public DemoHelper(AppIdsUpdater callback){
        _listener=callback;

    }

    public void getDeviceIds(Context cxt){

        long timeb=System.currentTimeMillis();
        // 方法调用
        int nres = CallFromReflect(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){//反射调用出错

        }
        Log.d(getClass().getSimpleName()“return value: “+String.valueOf(nres));

    }

    /*
    * 方法调用
    * 
    * */
    private int CallFromReflect(Context cxt){
        return MdidSdkHelper.InitSdk(cxttruethis);
    }

     /*
    * 获取相应id
    * 
    * */
    @Override
    public void OnSupport(boolean isSupport IdSupplier _supplier) {
        if(_supplier==null) {
            return;
        }
        String oaid=_supplier.getOAID();
        String vaid=_supplier.getVAID();
        String aaid=_supplier.getAAID();
        StringBuilder builder=new StringBuilder();
        builder.append(“support: “).append(isSupport?“true“:“false“).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);
        }
    }

    public interface AppIdsUpdater{
        void OnIdsAvalid(@NonNull  String ids);
    }

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-11-02 02:54  Android_Oaid\
     文件         269  2020-11-02 02:54  __MACOSX\._Android_Oaid
     文件       10244  2020-11-02 02:54  Android_Oaid\.DS_Store
     文件         120  2020-11-02 02:54  __MACOSX\Android_Oaid\._.DS_Store
     目录           0  2020-11-02 02:54  Android_Oaid\SdkDemo\
     文件         400  2020-11-02 02:54  __MACOSX\Android_Oaid\._SdkDemo
     目录           0  2020-11-02 02:54  Android_Oaid\oaid_sdk_1.0.23\
     文件         269  2020-11-02 02:54  __MACOSX\Android_Oaid\._oaid_sdk_1.0.23
     文件       10244  2020-11-02 02:54  Android_Oaid\SdkDemo\.DS_Store
     文件         269  2020-11-02 02:54  __MACOSX\Android_Oaid\SdkDemo\._.DS_Store
     目录           0  2020-11-02 02:54  Android_Oaid\SdkDemo\app\
     文件         269  2020-11-02 02:54  __MACOSX\Android_Oaid\SdkDemo\._app
     文件         938  2020-08-26 00:41  Android_Oaid\SdkDemo\SdkDemo.iml
     文件         269  2020-08-26 00:41  __MACOSX\Android_Oaid\SdkDemo\._SdkDemo.iml
     文件         367  2020-08-26 00:25  Android_Oaid\SdkDemo\local.properties
     文件         269  2020-08-26 00:25  __MACOSX\Android_Oaid\SdkDemo\._local.properties
     目录           0  2020-05-21 07:41  Android_Oaid\SdkDemo\gradle\
     文件         269  2020-05-21 07:41  __MACOSX\Android_Oaid\SdkDemo\._gradle
     文件        5296  2020-05-21 07:41  Android_Oaid\SdkDemo\gradlew
     文件         269  2020-05-21 07:41  __MACOSX\Android_Oaid\SdkDemo\._gradlew
     文件         208  2020-05-21 07:41  Android_Oaid\SdkDemo\.gitignore
     文件         269  2020-05-21 07:41  __MACOSX\Android_Oaid\SdkDemo\._.gitignore
     文件         564  2020-05-21 07:41  Android_Oaid\SdkDemo\build.gradle
     文件         269  2020-05-21 07:41  __MACOSX\Android_Oaid\SdkDemo\._build.gradle
     目录           0  2020-05-21 07:41  Android_Oaid\SdkDemo\.gradle\
     文件         269  2020-05-21 07:41  __MACOSX\Android_Oaid\SdkDemo\._.gradle
     文件        1073  2020-05-21 07:41  Android_Oaid\SdkDemo\gradle.properties
     文件         269  2020-05-21 07:41  __MACOSX\Android_Oaid\SdkDemo\._gradle.properties
     文件        2260  2020-05-21 07:41  Android_Oaid\SdkDemo\gradlew.bat
     文件         269  2020-05-21 07:41  __MACOSX\Android_Oaid\SdkDemo\._gradlew.bat
     文件          42  2020-05-21 07:41  Android_Oaid\SdkDemo\settings.gradle
............此处省略308个文件信息

评论

共有 条评论