SdkProject/library/src/main/java/com/secondworld/universalsdk/BaseApplication.java
File was deleted SdkProject/library/src/main/java/com/secondworld/universalsdk/EngineHandler.java
File was deleted SdkProject/library/src/main/java/com/secondworld/universalsdk/GameActivity.java
New file @@ -0,0 +1,6 @@ package com.secondworld.universalsdk; import com.unity3d.player.UnityPlayerActivity; public class GameActivity extends UnityPlayerActivity { } SdkProject/library/src/main/java/com/secondworld/universalsdk/GameApp.java
New file @@ -0,0 +1,37 @@ package com.secondworld.universalsdk; import android.app.Application; import android.os.Handler; import com.secondworld.universalsdk.utils.DeviceUtil; import com.secondworld.universalsdk.utils.LogUtil; import com.unity3d.player.UnityPlayer; public class GameApp extends Application { public static GameApp APP; @Override public void onCreate() { super.onCreate(); APP = this; InitSdk(); } public void InitSdk() { LogUtil.Init(this); H2EngineSDK.initCommandMap(); } public static void AppExit() { if (UnityPlayer.currentActivity != null) UnityPlayer.currentActivity.finish(); new Handler().postDelayed(new Runnable() { @Override public void run() { android.os.Process.killProcess(android.os.Process.myPid());// 杀进程 } }, 1000); } } SdkProject/library/src/main/java/com/secondworld/universalsdk/ThreadExecutor.java
New file @@ -0,0 +1,9 @@ package com.secondworld.universalsdk; public class ThreadExecutor { public static ThreadExecutor I = new ThreadExecutor(); } SdkProject/library/src/main/java/com/secondworld/universalsdk/UnityOperator.java
New file @@ -0,0 +1,12 @@ package com.secondworld.universalsdk; import com.unity3d.player.UnityPlayer; import org.json.JSONObject; import java.util.Map; public class UnityOperator { } SdkProject/library/src/main/java/com/secondworld/universalsdk/utils/CodeA2U.java
File was renamed from SdkProject/library/src/main/java/com/secondworld/universalsdk/CodeA2U.java @@ -1,4 +1,4 @@ package com.secondworld.universalsdk; package com.secondworld.universalsdk.utils; /** * Created by Administrator on 2018/7/18 0018. SdkProject/library/src/main/java/com/secondworld/universalsdk/utils/CodeU2A.java
File was renamed from SdkProject/library/src/main/java/com/secondworld/universalsdk/CodeU2A.java @@ -1,4 +1,4 @@ package com.secondworld.universalsdk; package com.secondworld.universalsdk.utils; /** * Created by Administrator on 2018/7/18 0018. @@ -57,4 +57,20 @@ * 拷贝游戏资源 */ int CopyOneAsset = 12; /** * 每个渠道各自的处理 */ int FreePlatformInit = 100; int FreePlatformLogin = 101; int FreePlatformLogout = 102; int FreePlatformSwitchAccount = 103; int FreePlatformPay = 104; int PayFinished = 105; int CreateRole = 106; int RoleLogin = 107; int RoleLevelUp = 108; int TencentLogin = 109; } SdkProject/library/src/main/java/com/secondworld/universalsdk/utils/DeviceUtil.java
New file @@ -0,0 +1,23 @@ package com.secondworld.universalsdk.utils; import android.app.ActivityManager; import android.content.Context; import com.secondworld.universalsdk.GameApp; public class DeviceUtil { /** * 获取当前设备总运行内存 * 单位为 byte * @return */ public static long GetTotalRAMSize() { ActivityManager manager = (ActivityManager) GameApp.APP.getSystemService(Context.ACTIVITY_SERVICE); ActivityManager.MemoryInfo info = new ActivityManager.MemoryInfo(); manager.getMemoryInfo(info); return info.totalMem; } } SdkProject/library/src/main/java/com/secondworld/universalsdk/utils/LogUtil.java
File was renamed from SdkProject/library/src/main/java/com/secondworld/universalsdk/LogUtil.java @@ -1,7 +1,9 @@ package com.secondworld.universalsdk; package com.secondworld.universalsdk.utils; import android.content.Context; import android.util.Log; import com.secondworld.universalsdk.BuildConfig; import java.io.File; import java.text.SimpleDateFormat; @@ -91,4 +93,8 @@ print(Level.ERROR, tag, msg, false); } public static void e(String tag, Exception e) { print(Level.ERROR, tag, Log.getStackTraceString(e), false); } } SdkProject/library/src/main/java/com/secondworld/universalsdk/utils/StaticDefine.java
New file @@ -0,0 +1,19 @@ package com.secondworld.universalsdk.utils; /** * Created by Administrator on 2018/6/14 0014. */ public interface StaticDefine { String UnityGameObjectName = "SDKUtility"; String UnityHandleFuncName = "HandleSdkMessage"; String LS_KEY_VERSION = "H2Engine_App_Version"; String LS_KEY_COPIED = "H2Engine_Copy_Finished"; String LS_KEY_IMEI = "H2Engine_DEVICE_IMEI"; String LS_KEY_MAC = "H2Engine_DEVICE_MAC"; String LS_KEY_ANDROID_ID = "H2Engine_DEVICE_ANDROID_ID"; String LS_KEY_TENCENT_LOGINPARAM = "H2Engine_TENCENT_LOGIN_PARAM"; }