|  |  |  | 
|---|
|  |  |  | import android.os.Build; | 
|---|
|  |  |  | import android.provider.Settings; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.secondworld.sdk.GameApp; | 
|---|
|  |  |  | import com.secondworld.sdk.GameAppProxy; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.net.NetworkInterface; | 
|---|
|  |  |  | import java.util.Enumeration; | 
|---|
|  |  |  | 
|---|
|  |  |  | public static final String FAKE_MAC = "02:00:00:00:00:00"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static long getVersionCode() { | 
|---|
|  |  |  | long appVersionCode = 0; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | PackageInfo packageInfo = GameApp.I.getApplicationContext() | 
|---|
|  |  |  | PackageInfo packageInfo = GameAppProxy.app.getApplicationContext() | 
|---|
|  |  |  | .getPackageManager() | 
|---|
|  |  |  | .getPackageInfo(GameApp.I.getPackageName(), 0); | 
|---|
|  |  |  | .getPackageInfo(GameAppProxy.app.getPackageName(), 0); | 
|---|
|  |  |  | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { | 
|---|
|  |  |  | appVersionCode = packageInfo.getLongVersionCode(); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | 
|---|
|  |  |  | public static String getVersionName() { | 
|---|
|  |  |  | String appVersionName = ""; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | PackageInfo packageInfo = GameApp.I.getApplicationContext() | 
|---|
|  |  |  | PackageInfo packageInfo = GameAppProxy.app.getApplicationContext() | 
|---|
|  |  |  | .getPackageManager() | 
|---|
|  |  |  | .getPackageInfo(GameApp.I.getPackageName(), 0); | 
|---|
|  |  |  | .getPackageInfo(GameAppProxy.app.getPackageName(), 0); | 
|---|
|  |  |  | appVersionName = packageInfo.versionName; | 
|---|
|  |  |  | } catch (PackageManager.NameNotFoundException e) { | 
|---|
|  |  |  | LogUtil.e("getAppVersionName", e); | 
|---|
|  |  |  | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static long getTotalRAMSize() { | 
|---|
|  |  |  | ActivityManager manager = (ActivityManager) GameApp.I.getSystemService(Context.ACTIVITY_SERVICE); | 
|---|
|  |  |  | ActivityManager manager = (ActivityManager) GameAppProxy.app.getSystemService(Context.ACTIVITY_SERVICE); | 
|---|
|  |  |  | ActivityManager.MemoryInfo info = new ActivityManager.MemoryInfo(); | 
|---|
|  |  |  | manager.getMemoryInfo(info); | 
|---|
|  |  |  | return info.totalMem; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static String getAndroidId() { | 
|---|
|  |  |  | String ANDROID_ID = Settings.System.getString(GameApp.I.getContentResolver(), Settings.System.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; | 
|---|
|  |  |  | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | WifiManager wifi = (WifiManager) GameApp.I.getSystemService(Context.WIFI_SERVICE); | 
|---|
|  |  |  | WifiManager wifi = (WifiManager) GameAppProxy.app.getSystemService(Context.WIFI_SERVICE); | 
|---|
|  |  |  | if (wifi != null) { | 
|---|
|  |  |  | WifiInfo wifiInfo = wifi.getConnectionInfo(); | 
|---|
|  |  |  | if (wifiInfo != null) { | 
|---|