You've already forked Commercialization.topon
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a24a3292c |
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 204d1c2a7960e48ceaee45173764f175
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,32 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 90dd56ba21d3f46ce8799318c4c697f6
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,32 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1be98f3eccf7b457983f9ffec542cf50
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b533b0baca6984f16a738a8aa8e025e1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 943b13c22974c4fe7ba4c6d1244a21d7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><dependencies>
|
||||
<iosPods>
|
||||
<iosPod name="AnyThinkiOS/AnyThinkTTAdapter" version="6.2.68" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d946ae84d7ee45dea6ccc6a9175ea8f
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -8,6 +8,9 @@
|
||||
maven {
|
||||
url "https://artifact.bytedance.com/repository/pangle" // Assets/AnyThinkAds/Plugins/Android/China/Editor/Gromore/Dependencies.xml:6
|
||||
}
|
||||
maven {
|
||||
url "https://jfrog.anythinktech.com/artifactory/debugger" // Assets/Topon_Adapter/Editor/ToponTestDependencies.xml:6
|
||||
}
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
@@ -20,13 +23,9 @@ dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
// Android Resolver Dependencies Start
|
||||
implementation 'com.android.support:appcompat-v7:28.0.0' // Assets/AnyThinkAds/Plugins/Android/China/Editor/Dependencies.xml:3
|
||||
implementation 'com.android.support:design:28.0.0' // Assets/AnyThinkAds/Plugins/Android/China/mediation/kuaishou/Editor/Dependencies.xml:3
|
||||
implementation 'com.github.bumptech.glide:glide:4.9.0' // Assets/AnyThinkAds/Plugins/Android/China/mediation/tap/Editor/Dependencies.xml:6
|
||||
implementation 'com.anythink.sdk:debugger-ui:1.0.0' // Assets/Topon_Adapter/Editor/ToponTestDependencies.xml:8
|
||||
implementation 'com.pangle.cn:mediation-sdk:5.6.1.6' // Assets/AnyThinkAds/Plugins/Android/China/Editor/Gromore/Dependencies.xml:8
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.12.1' // Assets/AnyThinkAds/Plugins/Android/China/mediation/tap/Editor/Dependencies.xml:5
|
||||
implementation 'com.tencent.mm.opensdk:wechat-sdk-android:6.8.0' // Assets/Topon_Adapter/Editor/WXDependencies.xml:3
|
||||
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1' // Assets/AnyThinkAds/Plugins/Android/China/mediation/tap/Editor/Dependencies.xml:4
|
||||
implementation 'io.reactivex.rxjava2:rxjava:2.0.1' // Assets/AnyThinkAds/Plugins/Android/China/mediation/tap/Editor/Dependencies.xml:3
|
||||
// Android Resolver Dependencies End
|
||||
**DEPS**}
|
||||
|
||||
|
||||
@@ -23,14 +23,17 @@ namespace Topon_Adapter.Editor
|
||||
{
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
var manifestPath = Path.Combine(path, "src/main/AndroidManifest.xml");
|
||||
var launcherManifestPath = Path.Combine(path, "../launcher/src/main/AndroidManifest.xml");
|
||||
#else
|
||||
var manifestPath = Path.Combine(path, "unityLibrary/src/main/AndroidManifest.xml");
|
||||
#endif
|
||||
// var manifestPath = Path.Combine(path, "src/main/AndroidManifest.xml");
|
||||
XDocument manifest;
|
||||
XDocument launcherManifest;
|
||||
try
|
||||
{
|
||||
manifest = XDocument.Load(manifestPath);
|
||||
manifest = XDocument.Load(manifestPath);
|
||||
launcherManifest = XDocument.Load (launcherManifestPath);
|
||||
}
|
||||
#pragma warning disable 0168
|
||||
catch (IOException exception)
|
||||
@@ -55,11 +58,19 @@ namespace Topon_Adapter.Editor
|
||||
return;
|
||||
}
|
||||
|
||||
elementManifest.Add(CreateQueries());
|
||||
var queries = CreateQueries();
|
||||
elementManifest.Add(queries);
|
||||
elementApplication.Add(CreateActivityXML());
|
||||
|
||||
|
||||
var elementlauncherManifest = launcherManifest.Element("manifest");
|
||||
var elementlauncherApplication = elementlauncherManifest.Element("application");
|
||||
//增加穿山甲配置
|
||||
elementlauncherApplication.Add (CreateCSJGromore ());
|
||||
|
||||
// Save the updated manifest file.
|
||||
manifest.Save(manifestPath);
|
||||
launcherManifest.Save (launcherManifestPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -87,6 +98,37 @@ namespace Topon_Adapter.Editor
|
||||
return metaData;
|
||||
}
|
||||
|
||||
|
||||
public static XElement CreateCSJGromore ()
|
||||
{
|
||||
// ReSharper disable once InvalidXmlDocComment
|
||||
/**
|
||||
*<provider
|
||||
android:name="com.bytedance.sdk.openadsdk.TTFileProvider"
|
||||
android:authorities="${applicationId}.TTFileProvider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true"
|
||||
tools:replace="android:authorities">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/alex_tt_file_path" />
|
||||
</provider>
|
||||
*
|
||||
*/
|
||||
var providerData = new XElement("provider");
|
||||
|
||||
providerData.Add (new XAttribute (AndroidNamespace + "name" , "com.bytedance.sdk.openadsdk.TTFileProvider"));
|
||||
providerData.Add (new XAttribute (AndroidNamespace + "authorities" , "${applicationId}.TTFileProvider"));
|
||||
providerData.Add (new XAttribute (AndroidNamespace + "exported" , "false"));
|
||||
providerData.Add (new XAttribute (AndroidNamespace + "grantUriPermissions" , "true"));
|
||||
providerData.Add (new XAttribute (ToolsNamespace + "replace" , "android:authorities"));
|
||||
var metaData = new XElement("meta-data");
|
||||
metaData.Add (new XAttribute (AndroidNamespace+"name" , "android.support.FILE_PROVIDER_PATHS"));
|
||||
metaData.Add (new XAttribute (AndroidNamespace+"resource" , "@xml/alex_tt_file_path"));
|
||||
providerData.Add (metaData);
|
||||
return providerData;
|
||||
}
|
||||
|
||||
public int callbackOrder { get; }
|
||||
}
|
||||
}
|
||||
|
||||
11
Topon_Adapter/Editor/ToponTestDependencies.xml
Normal file
11
Topon_Adapter/Editor/ToponTestDependencies.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<androidPackages>
|
||||
<repositories>
|
||||
<repository>https://jfrog.anythinktech.com/artifactory/debugger</repository>
|
||||
</repositories>
|
||||
|
||||
<androidPackage spec="com.anythink.sdk:debugger-ui:1.0.0"/>
|
||||
|
||||
</androidPackages>
|
||||
</dependencies>
|
||||
3
Topon_Adapter/Editor/ToponTestDependencies.xml.meta
Normal file
3
Topon_Adapter/Editor/ToponTestDependencies.xml.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a130901ed98e40898c3917a08e126996
|
||||
timeCreated: 1697702311
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using AnyThinkAds.Api;
|
||||
using Runtime.ADAggregator;
|
||||
using UnityEngine;
|
||||
|
||||
public class ToponAdController : IAdController
|
||||
{
|
||||
@@ -14,8 +15,13 @@ public class ToponAdController : IAdController
|
||||
_adConfig = adConfig;
|
||||
// ATSdkUtil.
|
||||
ATSDKAPI.setChannel(args[0].ToString());
|
||||
ATSDKAPI.setLogDebug(args.Length > 1 && (bool)args[1]);
|
||||
var isDebug = args.Length > 1 && (bool)args[1];
|
||||
ATSDKAPI.setLogDebug(isDebug);
|
||||
ATSDKAPI.initSDK(adConfig.Id , adConfig.Key);
|
||||
if (isDebug)
|
||||
{
|
||||
ShowAndroidTest ();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetListener(Action<bool> adMaskAction ,Action<string, string> logEventAction)
|
||||
@@ -49,4 +55,25 @@ public class ToponAdController : IAdController
|
||||
{
|
||||
_maskAction?.Invoke(isOpen);
|
||||
}
|
||||
|
||||
private void ShowAndroidTest ()
|
||||
{
|
||||
// com.anythink.debug.api.ATDebuggerUITest.showDebuggerUI(this);
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#elif UNITY_ANDROID
|
||||
//获取Unity的Activity Class
|
||||
using (AndroidJavaClass activityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
{
|
||||
//获取对应的实例化对象,这两句都是固定写法
|
||||
using (AndroidJavaObject activityContext = activityClass.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
//拿到我自己的工具类并实例化
|
||||
var testUtils = new AndroidJavaClass("com.anythink.debug.api.ATDebuggerUITest");
|
||||
//向工具类里的Init方法传入Unity的activity对象用于初始化工具类
|
||||
testUtils.CallStatic("showDebuggerUI", activityContext);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "com.commercialization.topon",
|
||||
"displayName": "Commercialization.topon",
|
||||
"description": "基于topon的广告sdk封装,依赖基础商业化模块",
|
||||
"version": "1.0.15",
|
||||
"version": "1.0.16",
|
||||
"unity": "2021.1",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user