From debe09abdced7f6047e98a67d8a53393c3f8c6c2 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期一, 25 七月 2022 11:58:24 +0800 Subject: [PATCH] 0312 取消电话权限 --- SdkProject/library/src/main/java/com/secondworld/sdk/utils/DeviceUtil.java | 108 +++++++++++++++++++++++++++-------------------------- 1 files changed, 55 insertions(+), 53 deletions(-) diff --git a/SdkProject/library/src/main/java/com/secondworld/sdk/utils/DeviceUtil.java b/SdkProject/library/src/main/java/com/secondworld/sdk/utils/DeviceUtil.java index 81ac489..7eaf7cf 100644 --- a/SdkProject/library/src/main/java/com/secondworld/sdk/utils/DeviceUtil.java +++ b/SdkProject/library/src/main/java/com/secondworld/sdk/utils/DeviceUtil.java @@ -67,10 +67,11 @@ } public static String getAndroidId() { - String ANDROID_ID = Settings.System.getString(GameAppProxy.app.getContentResolver(), Settings.System.ANDROID_ID); - if (ANDROID_ID == null || ANDROID_ID.equals("9774d56d682e549c")) - return ""; - return ANDROID_ID; +// String ANDROID_ID = Settings.System.getString(GameAppProxy.app.getContentResolver(), Settings.System.ANDROID_ID); +// if (ANDROID_ID == null || ANDROID_ID.equals("9774d56d682e549c")) +// return ""; +// return ANDROID_ID; + return ""; } /** @@ -103,55 +104,56 @@ * @return */ public static String getLocalMac() { - String mac = SPUtils.get().getString(SPUtils.MAC, ""); - if (!mac.trim().isEmpty()) - return mac; - try { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - String interfaceName = "wlan0"; - Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); - NetworkInterface intf = null; - while (interfaces.hasMoreElements()) { - intf = interfaces.nextElement(); - if (!intf.getName().equalsIgnoreCase(interfaceName)) - continue; - byte[] addresses = intf.getHardwareAddress(); - if (mac != null) { - StringBuilder buf = new StringBuilder(); - for (byte aMac : addresses) { - buf.append(String.format("%02X:", aMac)); - } - if (buf.length() > 0) { - buf.deleteCharAt(buf.length() - 1); - } - mac = buf.toString(); - } - break; - } - } else { - WifiManager wifi = (WifiManager) GameAppProxy.app.getSystemService(Context.WIFI_SERVICE); - if (wifi != null) { - WifiInfo wifiInfo = wifi.getConnectionInfo(); - if (wifiInfo != null) { - mac = wifiInfo.getMacAddress(); - } - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - - mac = mac.toUpperCase(Locale.ENGLISH); - - if (mac.equals(FAKE_MAC)) - mac = ""; - - SPUtils.get() - .edit() - .putString(SPUtils.MAC, mac.trim()) - .apply(); - - return mac; + return ""; +// String mac = SPUtils.get().getString(SPUtils.MAC, ""); +// if (!mac.trim().isEmpty()) +// return mac; +// try { +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { +// String interfaceName = "wlan0"; +// Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); +// NetworkInterface intf = null; +// while (interfaces.hasMoreElements()) { +// intf = interfaces.nextElement(); +// if (!intf.getName().equalsIgnoreCase(interfaceName)) +// continue; +// byte[] addresses = intf.getHardwareAddress(); +// if (mac != null) { +// StringBuilder buf = new StringBuilder(); +// for (byte aMac : addresses) { +// buf.append(String.format("%02X:", aMac)); +// } +// if (buf.length() > 0) { +// buf.deleteCharAt(buf.length() - 1); +// } +// mac = buf.toString(); +// } +// break; +// } +// } else { +// WifiManager wifi = (WifiManager) GameAppProxy.app.getSystemService(Context.WIFI_SERVICE); +// if (wifi != null) { +// WifiInfo wifiInfo = wifi.getConnectionInfo(); +// if (wifiInfo != null) { +// mac = wifiInfo.getMacAddress(); +// } +// } +// } +// } catch (Throwable e) { +// e.printStackTrace(); +// } +// +// mac = mac.toUpperCase(Locale.ENGLISH); +// +// if (mac.equals(FAKE_MAC)) +// mac = ""; +// +// SPUtils.get() +// .edit() +// .putString(SPUtils.MAC, mac.trim()) +// .apply(); +// +// return mac; } -- Gitblit v1.8.0