Skip to content

Commit

Permalink
荣耀真机验证荣耀广告标识符SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
liyujiang-gzu committed Dec 6, 2023
1 parent 036d318 commit 80da36d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
22 changes: 10 additions & 12 deletions app/src/main/java/com/github/gzuliyujiang/fallback/DemoApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,16 @@ public class DemoApp extends Application {
private boolean privacyPolicyAgreed = false;

static {
if (BuildConfig.DEBUG) {
// 开启日志打印,默认是关闭的,启动本应用会打印如下类似的日志:
// IMEI/MEID not allowed on Android 10+
// android.content.pm.PackageManager$NameNotFoundException: com.mdid.msa
// Google Play Service has been found: com.github.gzuliyujiang.oaid.impl.GmsImpl
// Service has been bound: Intent { act=com.google.android.gms.ads.identifier.service.START pkg=com.google.android.gms }
// Service has been connected: com.google.android.gms.ads.identifier.service.AdvertisingIdService
// OAID/AAID acquire success: 3f398576-c70a-455c-95ab-1fe35a9ae175
// Client id is OAID/AAID: 3f398576-c70a-455c-95ab-1fe35a9ae175
// Service has been unbound: com.google.android.gms.ads.identifier.service.AdvertisingIdService
OAIDLog.enable();
}
// 开启日志打印,默认是关闭的,启动本应用会打印如下类似的日志:
// IMEI/MEID not allowed on Android 10+
// android.content.pm.PackageManager$NameNotFoundException: com.mdid.msa
// Google Play Service has been found: com.github.gzuliyujiang.oaid.impl.GmsImpl
// Service has been bound: Intent { act=com.google.android.gms.ads.identifier.service.START pkg=com.google.android.gms }
// Service has been connected: com.google.android.gms.ads.identifier.service.AdvertisingIdService
// OAID/AAID acquire success: 3f398576-c70a-455c-95ab-1fe35a9ae175
// Client id is OAID/AAID: 3f398576-c70a-455c-95ab-1fe35a9ae175
// Service has been unbound: com.google.android.gms.ads.identifier.service.AdvertisingIdService
OAIDLog.enable();
}

@Override
Expand Down
Binary file modified demo.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ public static String getOAID() {
* @param getter 回调
*/
public static void getOAID(Context context, IGetter getter) {
OAIDFactory.create(context).doGet(getter);
IOAID ioaid = OAIDFactory.create(context);
OAIDLog.print("OAID implements class: " + ioaid.getClass().getName());
ioaid.doGet(getter);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*
* @author 贵州山野羡民(1032694760@qq.com)
* @since 2021/9/1 10:06
* @noinspection unused
*/
public final class DeviceIdentifier {
private static volatile boolean registered = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void print(Object log) {
if (log == null) {
log = "<null>";
}
Log.d(TAG, log.toString());
Log.i(TAG, log.toString());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ private static IOAID createManufacturerImpl(Context context) {
return new AsusImpl(context);
}
if (OAIDRom.isHonor()) {
HonorImpl honorImpl = new HonorImpl(context);
if (honorImpl.supported()) {
HonorImpl honor = new HonorImpl(context);
if (honor.supported()) {
// 支持的话(Magic UI 4.0,5.0,6.0及MagicOS 7.0或以上)直接使用荣耀的实现,否则尝试华为的实现
return honorImpl;
return honor;
}
}
if (OAIDRom.isHuawei() || OAIDRom.isEmui()) {
Expand All @@ -86,9 +86,8 @@ private static IOAID createManufacturerImpl(Context context) {
OppoImpl oppo = new OppoImpl(context);
if (oppo.supported()) {
return oppo;
} else {
return new OppoExtImpl(context);
}
return new OppoExtImpl(context);
}
if (OAIDRom.isCoolpad(context)) {
return new CoolpadImpl(context);
Expand Down
Binary file modified screenshot/oaid_honor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 80da36d

Please sign in to comment.