Skip to content

Commit

Permalink
feat:update upm
Browse files Browse the repository at this point in the history
  • Loading branch information
dango2887 committed Oct 9, 2024
0 parents commit 023329d
Show file tree
Hide file tree
Showing 30 changed files with 402 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Mobile.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Mobile/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Mobile/Editor/NativeDependencies.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" ?>
<dependencies>
<androidPackages>
<repositories>
<repository>https://repo.maven.apache.org/maven2</repository>
</repositories>
<androidPackage spec="com.taptap.sdk:tap-update:4.4.0"/>
</androidPackages>
</dependencies>
3 changes: 3 additions & 0 deletions Mobile/Editor/NativeDependencies.xml.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions Mobile/Editor/TapAndroidProvider.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"Version": 1,
"Use": true,
"AndroidGradleContext": [
{
"locationType": 1,
"unityVersionCompatibleType": 1,
"templateType": 6,
"processType": 1,
"locationParam": "ADDITIONAL_PROPERTIES",
"processContent": [
"android.useAndroidX=true"
]
},
{
"locationType": 2,
"unityVersionCompatibleType": 0,
"templateType": 5,
"processType": 2,
"locationParam": "classpath 'com.android.tools.build:gradle:3.\\d{1}.\\d{1}'",
"processContent": [
"classpath 'com.android.tools.build:gradle:4.0.1'"
]
},
{
"locationType": 2,
"unityVersionCompatibleType": 0,
"templateType": 5,
"processType": 2,
"locationParam": "classpath 'com.android.tools.build:gradle:4.0.0'",
"processContent": [
"classpath 'com.android.tools.build:gradle:4.0.1'"
]
},
{
"locationType": 2,
"unityVersionCompatibleType": 0,
"templateType": 5,
"processType": 2,
"locationParam": "classpath 'com.android.tools.build:gradle:3.\\d{1}.\\d{1}'",
"processContent": [
"classpath 'com.android.tools.build:gradle:4.0.1'"
]
},
{
"locationType": 2,
"unityVersionCompatibleType": 0,
"templateType": 5,
"processType": 2,
"locationParam": "classpath 'com.android.tools.build:gradle:4.0.0'",
"processContent": [
"classpath 'com.android.tools.build:gradle:4.0.1'"
]
}
],
"Priority": 2,
"ModuleName": "TapTap.Update"
}
7 changes: 7 additions & 0 deletions Mobile/Editor/TapAndroidProvider.txt.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Mobile/Editor/TapSDK.Update.Mobile.Editor.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "TapSDK.Update.Mobile.Editor",
"references": [
"GUID:56f3da7a178484843974054bafe77e73"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
7 changes: 7 additions & 0 deletions Mobile/Editor/TapSDK.Update.Mobile.Editor.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions Mobile/Editor/TapUpdateMobileProcessBuild.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using UnityEditor.Build.Reporting;
using TapSDK.Core.Editor;

namespace TapSDK.Update.Mobile.Editor {
public class TapUpdateMobileProcessBuild : SDKLinkProcessBuild {
public override int callbackOrder => 0;

public override string LinkPath => "TapSDK/Update/link.xml";

public override LinkedAssembly[] LinkedAssemblies => new LinkedAssembly[] {
// new LinkedAssembly { Fullname = "TapSDK.Update.Runtime" },
new LinkedAssembly { Fullname = "TapSDK.Update.Mobile.Runtime" }
};

public override Func<BuildReport, bool> IsTargetPlatform => (report) => {
return BuildTargetUtils.IsSupportMobile(report.summary.platform);
};
}
}
11 changes: 11 additions & 0 deletions Mobile/Editor/TapUpdateMobileProcessBuild.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Mobile/Runtime.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions Mobile/Runtime/TapSDK.Update.Mobile.Runtime.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "TapSDK.Update.Mobile.Runtime",
"references": [
"GUID:89a99d04b975e4813bb096587570e125",
"GUID:7d5ef2062f3704e1ab74aac0e4d5a1a7",
"GUID:10560023d8780423cb943c7a324b69f2",
"GUID:70428f3d1346341e18f02c35874af89a"
],
"includePlatforms": [
"Android",
"iOS"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
7 changes: 7 additions & 0 deletions Mobile/Runtime/TapSDK.Update.Mobile.Runtime.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions Mobile/Runtime/TapUpdateMobile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System.Collections.Generic;
using TapSDK.Core;
using System;
using TapSDK.Update.Internal;

namespace TapSDK.Update.Mobile {
public class TapUpdateMobile : ITapUpdateBridge {
public static string TAP_UPDATE_SERVICE = "BridgeUpdateService";

public static string TDS_UPDATE_SERVICE_CLZ = "com.taptap.sdk.update.enginebridge.BridgeUpdateService";

public static string TDS_UPDATE_SERVICE_IMPL = "com.taptap.sdk.update.enginebridge.BridgeUpdateServiceImpl";

public TapUpdateMobile() {
EngineBridge.GetInstance().Register(TDS_UPDATE_SERVICE_CLZ, TDS_UPDATE_SERVICE_IMPL);
}

public void Init(string clientId, string clientToken) {}

public void UpdateGame(Action onCancel) {
#if UNITY_ANDROID
var command = new Command.Builder()
.Service(TAP_UPDATE_SERVICE)
.Method("updateGame")
.Callback(true)
.OnceTime(false)
.CommandBuilder();
EngineBridge.GetInstance().CallHandler(command, (result) => {
UnityEngine.Debug.LogFormat("TapUpdate::UpdateGame result:{0}", result.ToJSON());
if (result.code == Result.RESULT_SUCCESS && result.content.ToLower().Contains("cancel")) {
onCancel?.Invoke();
return;
}
});
#else
throw new NotImplementedException("TapUpdate::UpdateGame Only Support On Android");
#endif
}
}
}
11 changes: 11 additions & 0 deletions Mobile/Runtime/TapUpdateMobile.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Runtime.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Runtime/Internal.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Runtime/Internal/ITapUpdateBridge.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace TapSDK.Update.Internal {
public interface ITapUpdateBridge {
void Init(string clientId, string clientToken);
void UpdateGame(Action onCancel);
}
}
11 changes: 11 additions & 0 deletions Runtime/Internal/ITapUpdateBridge.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions Runtime/Internal/TapUpdateInitTask.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using TapSDK.Core;
using TapSDK.Core.Internal.Init;
using TapSDK.Update;

namespace TapSDK.Update.Internal.Init {
public sealed class TapUpdateInitTask : IInitTask {
public int Order => 14;

public void Init(TapTapSdkOptions coreOption){
#if !UNITY_EDITOR && UNITY_ANDROID
TapTapUpdate.Init(coreOption.clientId, coreOption.clientToken);
#endif

}

public void Init(TapTapSdkOptions coreOption, TapTapSdkBaseOptions[] otherOptions)
{
#if !UNITY_EDITOR && UNITY_ANDROID
TapTapUpdate.Init(coreOption.clientId, coreOption.clientToken);
#endif
}


}
}
11 changes: 11 additions & 0 deletions Runtime/Internal/TapUpdateInitTask.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Runtime/Public.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions Runtime/Public/TapTapUpdate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using TapSDK.Update.Internal;
using TapSDK.Core.Internal.Utils;
using TapSDK.Core;
using System;

namespace TapSDK.Update {
public class TapTapUpdate {

public static readonly string Version = "4.4.0";

static readonly ITapUpdateBridge update;

static TapTapUpdate() {
update = BridgeUtils.CreateBridgeImplementation(typeof(ITapUpdateBridge), "TapSDK.Update")
as ITapUpdateBridge;
}

internal static void Init(string clientId, string clientToken)
{
update.Init(clientId, clientToken);
}

public static void UpdateGame(Action onCancel) {
update.UpdateGame(onCancel);
}
}
}
11 changes: 11 additions & 0 deletions Runtime/Public/TapTapUpdate.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 023329d

Please sign in to comment.