You've already forked Commercialization.topon
Compare commits
3 Commits
master
...
master_noG
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d26ebf941 | |||
| 97f5d4bf90 | |||
| f682534bc3 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -9,6 +9,7 @@ Build/
|
||||
AssetBundle/
|
||||
UserSettings/
|
||||
|
||||
|
||||
# Uncomment this line if you wish to ignore the asset store tools plugin
|
||||
# [Aa]ssets/AssetStoreTools*
|
||||
|
||||
@@ -54,4 +55,5 @@ sysinfo.txt
|
||||
|
||||
# Crashlytics generated file
|
||||
crashlytics-build.properties
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
.vscode/
|
||||
|
||||
@@ -40,6 +40,16 @@ namespace AnyThinkAds.Api
|
||||
public readonly int abtest_id;
|
||||
|
||||
public readonly string reward_custom_data;
|
||||
public readonly int placement_type;
|
||||
public readonly string shared_placement_id;
|
||||
public readonly string bid_floor;
|
||||
public readonly int dismiss_type;
|
||||
public readonly int ad_source_type;
|
||||
public readonly string ad_source_custom_ext;
|
||||
public readonly string network_name;
|
||||
public readonly string show_custom_ext;
|
||||
public readonly string e_c;
|
||||
public readonly int s_id;
|
||||
|
||||
private string callbackJson;
|
||||
|
||||
@@ -94,6 +104,16 @@ namespace AnyThinkAds.Api
|
||||
|
||||
reward_custom_data = jsonData.ContainsKey("reward_custom_data") ? (string)jsonData["reward_custom_data"] : "";
|
||||
|
||||
placement_type = int.Parse(jsonData.ContainsKey("placement_type") ? jsonData["placement_type"].ToString() : "0");
|
||||
shared_placement_id = jsonData.ContainsKey("shared_placement_id") ? jsonData["shared_placement_id"].ToString() : "";
|
||||
bid_floor = jsonData.ContainsKey("bid_floor") ? jsonData["bid_floor"].ToString() : "";
|
||||
dismiss_type = int.Parse(jsonData.ContainsKey("dismiss_type") ? jsonData["dismiss_type"].ToString() : "0");
|
||||
ad_source_type = int.Parse(jsonData.ContainsKey("ad_source_type") ? jsonData["ad_source_type"].ToString() : "0");
|
||||
ad_source_custom_ext = jsonData.ContainsKey("ad_source_custom_ext") ? jsonData["ad_source_custom_ext"].ToString() : "";
|
||||
network_name = jsonData.ContainsKey("network_name") ? jsonData["network_name"].ToString() : "";
|
||||
show_custom_ext = jsonData.ContainsKey("show_custom_ext") ? jsonData["show_custom_ext"].ToString() : "";
|
||||
e_c = jsonData.ContainsKey("e_c") ? jsonData["e_c"].ToString() : "";
|
||||
s_id = int.Parse(jsonData.ContainsKey("s_id") ? jsonData["s_id"].ToString() : "0");
|
||||
}
|
||||
catch (System.Exception e) {
|
||||
System.Console.WriteLine("Exception caught: {0}", e);
|
||||
@@ -150,6 +170,16 @@ namespace AnyThinkAds.Api
|
||||
dataDictionary.Add("custom_rule", custom_rule);
|
||||
dataDictionary.Add("ext_info", ext_info);
|
||||
dataDictionary.Add("reward_custom_data", reward_custom_data);
|
||||
dataDictionary.Add("placement_type", placement_type);
|
||||
dataDictionary.Add("shared_placement_id", shared_placement_id);
|
||||
dataDictionary.Add("bid_floor", bid_floor);
|
||||
dataDictionary.Add("dismiss_type", dismiss_type);
|
||||
dataDictionary.Add("ad_source_type", ad_source_type);
|
||||
dataDictionary.Add("ad_source_custom_ext", ad_source_custom_ext);
|
||||
dataDictionary.Add("network_name", network_name);
|
||||
dataDictionary.Add("show_custom_ext", show_custom_ext);
|
||||
dataDictionary.Add("e_c", e_c);
|
||||
dataDictionary.Add("s_id", s_id);
|
||||
|
||||
return dataDictionary;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -69,11 +69,7 @@
|
||||
}
|
||||
NSString *defaultAdSourceConfig = extra[@"default_adSource_config"];
|
||||
NSLog(@"ATSplashAdWrapper::extra = %@", extra);
|
||||
[[ATAdManager sharedManager] loadADWithPlacementID:placementID
|
||||
extra:extra
|
||||
delegate:self
|
||||
containerView:nil
|
||||
defaultAdSourceConfig:defaultAdSourceConfig];
|
||||
[[ATAdManager sharedManager] loadADWithPlacementID:placementID extra:extra delegate:self containerView:nil];
|
||||
}
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1eb5504d21825439e88a559575ad04cc
|
||||
guid: 76ac3b69f465f4b7d946b3f0df2a3d8d
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88b0cd13e8e208a4bab324fdd90b4067
|
||||
guid: 0193284827ad2400c815083bfdb59425
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6683d6161bbc4c8197604496a19d97e
|
||||
guid: 84e928ce9a03c451382a9bbadf2de1b5
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24799c2c36aae4a9a85ea3abf219c7a1
|
||||
guid: b69ea18f5f800432fb1be4c20db6c464
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"csj","version":"6.4.1.1","country":1,"path":"Assets/AnyThinkPlugin/Script/IntegrationManager/Editor/../../..//AnyThinkAds\\Plugins/Android/China/mediation/csj"}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f975c7fd05f6e684da8f4bec52c2c75a
|
||||
guid: f9e3eb9a77788a54a83ca1ca1f9c2e06
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f4a0fb45277676429a81bc79f9252f1
|
||||
guid: 23e424a0879774c0d9be59057061c712
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
{"name":"gdt","version":"4.600.1470","country":1,"path":"Assets/AnyThinkPlugin/Script/IntegrationManager/Editor/../../..//AnyThinkAds\\Plugins/Android/China/mediation/gdt"}
|
||||
{"name":"gdt","version":"4.603.1473","country":1,"path":"Assets/AnyThinkPlugin/Script/IntegrationManager/Editor/../../..//AnyThinkAds\\Plugins/Android/China/mediation/gdt"}
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb976b2d4ab1a48e29c20b3bb380ab67
|
||||
guid: 9efd0b28f0b6145b999c511961746e94
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1 +1 @@
|
||||
{"name":"kuaishou","version":"3.3.67.1","country":1,"path":"Assets/AnyThinkPlugin/Script/IntegrationManager/Editor/../../..//AnyThinkAds\\Plugins/Android/China/mediation/kuaishou"}
|
||||
{"name":"kuaishou","version":"3.3.69.4","country":1,"path":"Assets/AnyThinkPlugin/Script/IntegrationManager/Editor/../../..//AnyThinkAds\\Plugins/Android/China/mediation/kuaishou"}
|
||||
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be4b35e05f4464a3a9d47e5a421f2c46
|
||||
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 +1 @@
|
||||
{"name":"tap","version":"3.16.3.31","country":1,"path":"Assets/AnyThinkPlugin/Script/IntegrationManager/Editor/../../..//AnyThinkAds\\Plugins/Android/China/mediation/tap"}
|
||||
{"name":"tap","version":"3.16.3.34","country":1,"path":"Assets/AnyThinkPlugin/Script/IntegrationManager/Editor/../../..//AnyThinkAds\\Plugins/Android/China/mediation/tap"}
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f718cca21da6c364cb5b369d0bed9cff
|
||||
guid: 968bcc6a91a6a5543bc7e455ada1b7ef
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e50d797179f3d284ab428f94ea344342
|
||||
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.
@@ -0,0 +1,32 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1114d7069dbda64c88d1e55a8139d2a
|
||||
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,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3730fc3181b36f54ea5593b0609aa846
|
||||
guid: 79e7d078a28b97e4aa88261277efdc65
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -1,5 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf2aafbf181354d4a8c0616ad17df2d4
|
||||
guid: f4a837cf60e40c84690ece85b75c748e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c8ce81554dbcd4e9896ee0f1cb782685
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: faf88f547152a4fa0b48ea5d4e233b85
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<iosPods>
|
||||
<iosPod name="AnyThinkiOS" version="" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4fc1bcc62310548f4a6bddd58180eef9
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"status": 1,
|
||||
"file_name": "AnyThinkHotFixPlugin_1.0.1.unitypackage",
|
||||
"hot_fix_version": "1.0.1",
|
||||
"download_url": "https://topon-sdk-release.oss-cn-hangzhou.aliyuncs.com/Unity_Release/plugin/2.1.3/hotfix/1.0.1/AnyThinkHotFixPlugin_1.0.1.unitypackage",
|
||||
"file_name": "AnyThinkHotFixPlugin_1.0.2.unitypackage",
|
||||
"hot_fix_version": "1.0.2",
|
||||
"download_url": "https://topon-sdk-release.oss-cn-hangzhou.aliyuncs.com/Unity_Release/plugin/2.1.3/hotfix/1.0.2/AnyThinkHotFixPlugin_1.0.2.unitypackage",
|
||||
"plugin_version": "2.1.3"
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
{"curCountry":1,"china":{"android_version":"6.4.08","ios_version":"","androidXSetting":1,"country":1,"android_admob_app_id":"","ios_admob_app_id":""},"nonchina":{"android_version":"","ios_version":"","androidXSetting":0,"country":2,"android_admob_app_id":"","ios_admob_app_id":""}}
|
||||
{"curCountry":1,"china":{"android_version":"6.4.17","ios_version":"6.3.68","androidXSetting":1,"country":1,"android_admob_app_id":"","ios_admob_app_id":""},"nonchina":{"android_version":"","ios_version":"","androidXSetting":0,"country":2,"android_admob_app_id":"","ios_admob_app_id":""}}
|
||||
@@ -1,33 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f8ba47e7e6684db4fbba23e147b0e34f
|
||||
folderAsset: yes
|
||||
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,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.alex.gromore.res">
|
||||
|
||||
</manifest>
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5cdaa0a8dde8495782a285555245f421
|
||||
timeCreated: 1695622122
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
|
||||
<paths>
|
||||
<cache-path
|
||||
name="tt_internal_cache_download"
|
||||
path="Download" />
|
||||
<external-files-path
|
||||
name="tt_external_files_download"
|
||||
path="Download" />
|
||||
<external-path
|
||||
name="tt_external_root"
|
||||
path="." />
|
||||
<external-path
|
||||
name="tt_external_download"
|
||||
path="Download" />
|
||||
<files-path
|
||||
name="tt_internal_file_download"
|
||||
path="Download" />
|
||||
</paths>
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
|
||||
<paths>
|
||||
<cache-path
|
||||
name="tt_internal_cache_download"
|
||||
path="Download" />
|
||||
<external-files-path
|
||||
name="tt_external_files_download"
|
||||
path="Download" />
|
||||
<external-path
|
||||
name="tt_external_root"
|
||||
path="." />
|
||||
<external-path
|
||||
name="tt_external_download"
|
||||
path="Download" />
|
||||
<files-path
|
||||
name="tt_internal_file_download"
|
||||
path="Download" />
|
||||
</paths>
|
||||
@@ -17,7 +17,7 @@ namespace Topon_Adapter.Editor
|
||||
|
||||
public void OnPostGenerateGradleAndroidProject (string path)
|
||||
{
|
||||
ProcessAndroidManifest (path);
|
||||
// ProcessAndroidManifest (path);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Topon_Adapter.Editor
|
||||
if (launcherElement == null)
|
||||
{
|
||||
//增加穿山甲配置
|
||||
elementlauncherApplication.Add (CreateCSJGromore ());
|
||||
// elementlauncherApplication.Add (CreateCSJGromore ());
|
||||
}
|
||||
|
||||
var elementMainManifest = manifest.Element ("manifest");
|
||||
|
||||
232
Assets/Topon_Adapter/Editor/AD_BuildAndroidProcess.cs~
Normal file
232
Assets/Topon_Adapter/Editor/AD_BuildAndroidProcess.cs~
Normal file
@@ -0,0 +1,232 @@
|
||||
#if UNITY_ANDROID
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Android;
|
||||
|
||||
namespace Topon_Adapter.Editor
|
||||
{
|
||||
public class AD_BuildAndroidProcess : IPostGenerateGradleAndroidProject
|
||||
{
|
||||
private static readonly XNamespace AndroidNamespace = "http://schemas.android.com/apk/res/android";
|
||||
private static readonly XNamespace ToolsNamespace = "http://schemas.android.com/tools";
|
||||
|
||||
|
||||
public void OnPostGenerateGradleAndroidProject (string path)
|
||||
{
|
||||
ProcessAndroidManifest (path);
|
||||
}
|
||||
|
||||
|
||||
public static void ProcessAndroidManifest (string path)
|
||||
{
|
||||
#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);
|
||||
launcherManifest = XDocument.Load (launcherManifestPath);
|
||||
}
|
||||
#pragma warning disable 0168
|
||||
catch (IOException exception)
|
||||
#pragma warning restore 0168
|
||||
{
|
||||
ATLog.log ("[BuildAndroidProcess] AndroidManifest.xml is missing.");
|
||||
return;
|
||||
}
|
||||
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
var resXmlPath = Path.Combine(path, "src/main/res/xml");
|
||||
#else
|
||||
var resXmlPath = Path.Combine(path, "unityLibrary/src/main/res/xml");
|
||||
#endif
|
||||
if (!Directory.Exists(resXmlPath))
|
||||
{
|
||||
Directory.CreateDirectory(resXmlPath);
|
||||
}
|
||||
// var fromScriptableObject = MonoScript.FromScriptableObject(this);
|
||||
var xmlPath = GetScriptsPath("AD_BuildAndroidProcess");
|
||||
saveFile($"{xmlPath}/alex_tt_file_path.xml", resXmlPath);
|
||||
saveFile($"{xmlPath}/anythink_bk_tt_file_path.xml", resXmlPath);
|
||||
|
||||
// Get the `manifest` element.
|
||||
var elementManifest = manifest.Element ("manifest");
|
||||
if (elementManifest == null)
|
||||
{
|
||||
ATLog.log ("[BuildAndroidProcess] AndroidManifest.xml is invalid.");
|
||||
return;
|
||||
}
|
||||
|
||||
var elementApplication = elementManifest.Element ("application");
|
||||
if (elementApplication == null)
|
||||
{
|
||||
ATLog.log ("[BuildAndroidProcess] AndroidManifest.xml is invalid.");
|
||||
return;
|
||||
}
|
||||
|
||||
ToSingleTop (elementManifest);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
var wxElements = xApplicationElements.Where (element => element.Name.LocalName.Equals ("activity"));
|
||||
XElement wxElement = GetElementByName (wxElements, ".wxapi.WXEntryActivity");
|
||||
if (wxElement != null)
|
||||
{
|
||||
wxElement.Remove ();
|
||||
}
|
||||
|
||||
elementApplication.Add (CreateActivityXML ());
|
||||
|
||||
|
||||
var elementlauncherManifest = launcherManifest.Element ("manifest");
|
||||
var elementlauncherApplication = elementlauncherManifest.Element ("application");
|
||||
|
||||
var launcherElements = elementlauncherApplication.Descendants ().Where (element => element.Name.LocalName.Equals ("provider"));
|
||||
XElement launcherElement = GetElementByName (launcherElements, "com.bytedance.sdk.openadsdk.TTFileProvider");
|
||||
if (launcherElement == null)
|
||||
{
|
||||
//增加穿山甲配置
|
||||
// elementlauncherApplication.Add (CreateCSJGromore ());
|
||||
}
|
||||
|
||||
var elementMainManifest = manifest.Element ("manifest");
|
||||
var elementMainApplication = elementMainManifest.Element ("application");
|
||||
|
||||
var mainElements = elementMainApplication.Descendants ().Where (element => element.Name.LocalName.Equals ("provider"));
|
||||
XElement mainElement = GetElementByName (mainElements, "com.bytedance.sdk.openadsdk.TTFileProvider");
|
||||
if (mainElement == null)
|
||||
{
|
||||
//增加穿山甲配置
|
||||
// elementMainApplication.Add (CreateCSJGromore ());
|
||||
}
|
||||
|
||||
// Save the updated manifest file.
|
||||
manifest.Save (manifestPath);
|
||||
launcherManifest.Save (launcherManifestPath);
|
||||
}
|
||||
|
||||
public static void saveFile(string filePathName , string toFilesPath)
|
||||
{
|
||||
FileInfo file = new FileInfo(filePathName);
|
||||
string newFileName = file.Name;
|
||||
file.CopyTo(toFilesPath + "/" + newFileName, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加微信开放平台的适配
|
||||
/// </summary>
|
||||
public static XElement CreateActivityXML ()
|
||||
{
|
||||
var metaData = new XElement ("activity");
|
||||
metaData.Add (new XAttribute (AndroidNamespace + "name", ".wxapi.WXEntryActivity"));
|
||||
metaData.Add (new XAttribute (AndroidNamespace + "label", "@string/app_name"));
|
||||
metaData.Add (new XAttribute (AndroidNamespace + "theme", "@android:style/Theme.Translucent.NoTitleBar"));
|
||||
metaData.Add (new XAttribute (AndroidNamespace + "exported", "true"));
|
||||
metaData.Add (new XAttribute (AndroidNamespace + "taskAffinity", Application.identifier));
|
||||
metaData.Add (new XAttribute (AndroidNamespace + "launchMode", "singleTop"));
|
||||
return metaData;
|
||||
}
|
||||
|
||||
public static XElement CreateQueries ()
|
||||
{
|
||||
var metaData = new XElement ("queries");
|
||||
var packageData = new XElement ("package");
|
||||
packageData.Add (new XAttribute (AndroidNamespace + "name", "com.tencent.mm"));
|
||||
metaData.Add (packageData);
|
||||
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 string GetScriptsPath (string scriptName)
|
||||
{
|
||||
string[] path = UnityEditor.AssetDatabase.FindAssets(scriptName);
|
||||
if(path.Length >1)
|
||||
{
|
||||
// Debug.LogError("有同名文件"+_scriptName+"获取路径失败");
|
||||
return null;
|
||||
}
|
||||
//将字符串中得脚本名字和后缀统统去除掉
|
||||
string _path = AssetDatabase.GUIDToAssetPath(path[0]).Replace((@"/" +scriptName +".cs"),"");
|
||||
return _path;
|
||||
}
|
||||
|
||||
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/anythink_bk_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/anythink_bk_tt_file_path"));
|
||||
providerData.Add (metaData);
|
||||
return providerData;
|
||||
}
|
||||
|
||||
public static void ToSingleTop (XElement manifest)
|
||||
{
|
||||
|
||||
var elements = manifest.Descendants ().Where (element => element.Name.LocalName.Equals ("activity"));
|
||||
// 如果这个activity已经有了 android:launchMode="singleTask",则不再添加
|
||||
XElement elementByName = GetElementByName (elements , "com.unity3d.player.UnityPlayerActivity");
|
||||
//此处将 android:launchMode="singleTask" 改为 android:launchMode="singleTop"
|
||||
// elementByName.Add (new XAttribute (AndroidNamespace + "launchMode", "singleTop"));
|
||||
elementByName.Attribute ( AndroidNamespace + "launchMode")?.SetValue ("singleTop");
|
||||
}
|
||||
|
||||
public int callbackOrder { get; }
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"com.foldcc.cc-framework.commercialization" : "http://private.lightyears.ltd:18640/foldcc/CC-Framework.Commercialization.git#1.0.9",
|
||||
"com.foldcc.cc-framework.commercialization": "http://private.lightyears.ltd:18640/foldcc/CC-Framework.Commercialization.git#1.0.9",
|
||||
"com.unity.collab-proxy": "1.17.6",
|
||||
"com.unity.feature.2d": "1.0.0",
|
||||
"com.unity.ide.cursor": "http://private.lightyears.ltd:18650/foldcc/com.unity.ide.cursor.git",
|
||||
"com.unity.ide.rider": "3.0.16",
|
||||
"com.unity.ide.visualstudio": "2.0.16",
|
||||
"com.unity.ide.vscode": "1.2.5",
|
||||
|
||||
@@ -131,6 +131,15 @@
|
||||
"com.unity.2d.tilemap.extras": "2.2.3"
|
||||
}
|
||||
},
|
||||
"com.unity.ide.cursor": {
|
||||
"version": "http://private.lightyears.ltd:18650/foldcc/com.unity.ide.cursor.git",
|
||||
"depth": 0,
|
||||
"source": "git",
|
||||
"dependencies": {
|
||||
"com.unity.test-framework": "1.1.9"
|
||||
},
|
||||
"hash": "2c0153a9bab1abc783e5599fa2d2cc3c69d5e389"
|
||||
},
|
||||
"com.unity.ide.rider": {
|
||||
"version": "3.0.16",
|
||||
"depth": 0,
|
||||
|
||||
Reference in New Issue
Block a user