You've already forked Commercialization.topon
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| caf057bb97 | |||
| 41f75ad3d0 | |||
| c07a7e5f4a | |||
| 120d3315fc |
@@ -22,7 +22,7 @@ MonoBehaviour:
|
|||||||
PluginFileName: AnyThinkCore.unitypackage
|
PluginFileName: AnyThinkCore.unitypackage
|
||||||
PluginFilePaths: []
|
PluginFilePaths: []
|
||||||
LatestVersions:
|
LatestVersions:
|
||||||
Unity: 2.0.1
|
Unity: 2.0.2
|
||||||
Android: 6.2.72
|
Android: 6.2.72
|
||||||
Ios: 6.2.68
|
Ios: 6.2.68
|
||||||
CurrentVersions:
|
CurrentVersions:
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#if UNITY_ANDROID
|
#if UNITY_ANDROID
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
@@ -59,14 +61,36 @@ namespace Topon_Adapter.Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
var queries = CreateQueries ();
|
var queries = CreateQueries ();
|
||||||
|
|
||||||
|
var xManifestElements = elementManifest.Descendants ();
|
||||||
|
var xApplicationElements = elementApplication.Descendants ();
|
||||||
|
var useQueries = xManifestElements.Where (element => element.Name.LocalName.Equals ("package"));
|
||||||
|
XElement tencentElement = GetElementByName (useQueries, "com.tencent.mm");
|
||||||
|
if (tencentElement == null)
|
||||||
|
{
|
||||||
elementManifest.Add (queries);
|
elementManifest.Add (queries);
|
||||||
|
}
|
||||||
|
|
||||||
|
var wxElements = xApplicationElements.Where (element => element.Name.LocalName.Equals ("activity"));
|
||||||
|
XElement wxElement = GetElementByName (wxElements, ".wxapi.WXEntryActivity");
|
||||||
|
if (wxElement != null)
|
||||||
|
{
|
||||||
|
wxElement.Remove ();
|
||||||
|
}
|
||||||
|
|
||||||
elementApplication.Add (CreateActivityXML ());
|
elementApplication.Add (CreateActivityXML ());
|
||||||
|
|
||||||
|
|
||||||
var elementlauncherManifest = launcherManifest.Element ("manifest");
|
var elementlauncherManifest = launcherManifest.Element ("manifest");
|
||||||
var elementlauncherApplication = elementlauncherManifest.Element ("application");
|
var elementlauncherApplication = elementlauncherManifest.Element ("application");
|
||||||
|
|
||||||
|
var csjElements = elementlauncherApplication.Descendants ().Where (element => element.Name.LocalName.Equals ("provider"));
|
||||||
|
XElement csjElement = GetElementByName (csjElements, "com.bytedance.sdk.openadsdk.TTFileProvider");
|
||||||
|
if (csjElement == null)
|
||||||
|
{
|
||||||
//增加穿山甲配置
|
//增加穿山甲配置
|
||||||
elementlauncherApplication.Add (CreateCSJGromore ());
|
elementlauncherApplication.Add (CreateCSJGromore ());
|
||||||
|
}
|
||||||
|
|
||||||
// Save the updated manifest file.
|
// Save the updated manifest file.
|
||||||
manifest.Save (manifestPath);
|
manifest.Save (manifestPath);
|
||||||
@@ -78,7 +102,6 @@ namespace Topon_Adapter.Editor
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static XElement CreateActivityXML ()
|
public static XElement CreateActivityXML ()
|
||||||
{
|
{
|
||||||
|
|
||||||
var metaData = new XElement ("activity");
|
var metaData = new XElement ("activity");
|
||||||
metaData.Add (new XAttribute (AndroidNamespace + "name", ".wxapi.WXEntryActivity"));
|
metaData.Add (new XAttribute (AndroidNamespace + "name", ".wxapi.WXEntryActivity"));
|
||||||
metaData.Add (new XAttribute (AndroidNamespace + "label", "@string/app_name"));
|
metaData.Add (new XAttribute (AndroidNamespace + "label", "@string/app_name"));
|
||||||
@@ -98,6 +121,22 @@ namespace Topon_Adapter.Editor
|
|||||||
return metaData;
|
return metaData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static XElement GetElementByName (IEnumerable<XElement> elements, string name)
|
||||||
|
{
|
||||||
|
foreach (var element in elements)
|
||||||
|
{
|
||||||
|
var attributes = element.Attributes ();
|
||||||
|
if (attributes.Any (attribute => attribute.Name.Namespace.Equals (AndroidNamespace)
|
||||||
|
&& attribute.Name.LocalName.Equals ("name")
|
||||||
|
&& attribute.Value.Equals (name)))
|
||||||
|
{
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static XElement CreateCSJGromore ()
|
public static XElement CreateCSJGromore ()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.commercialization.topon",
|
"name": "com.commercialization.topon",
|
||||||
"displayName": "Commercialization.topon",
|
"displayName": "Commercialization.topon",
|
||||||
"description": "基于topon的广告sdk封装,依赖基础商业化模块",
|
"description": "基于topon的广告sdk封装,依赖基础商业化模块",
|
||||||
"version": "1.0.16",
|
"version": "1.0.19",
|
||||||
"unity": "2021.1",
|
"unity": "2021.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user