Skip to content

Commit

Permalink
Merge pull request #66 from appodeal/release/3.3.1
Browse files Browse the repository at this point in the history
[APDM-374] Release Appodeal Unity Plugin v3.3.1
  • Loading branch information
DmitriiFeshchenko committed Jun 4, 2024
2 parents b2259d4 + f888c84 commit 6118e45
Show file tree
Hide file tree
Showing 333 changed files with 7,748 additions and 3,186 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

*The full changelog can always be obtained at [Appodeal website](https://docs.appodeal.com/unity/changelog).*

### 3.3.1 (June 04, 2024)

+ Updated Appodeal Android SDK to v3.3.1
+ Updated Appodeal iOS SDK to v3.3.1
+ Implemented Dependency Manager tool
+ Changed skadnetwork ids parsing logic
+ Bumped minimal supported Unity version to v2021.3

### 3.3.0 (April 30, 2024)

+ Updated Appodeal Android SDK to v3.3.0
Expand Down
26 changes: 5 additions & 21 deletions Editor/AssetExtractors/AndroidLibraryInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,25 @@
using UnityEditor;
using UnityEngine;
using AppodealStack.UnityEditor.Utils;
using AppodealStack.UnityEditor.InternalResources;

// ReSharper Disable CheckNamespace
// ReSharper Disable once CheckNamespace
namespace AppodealStack.UnityEditor.AssetExtractors
{
internal static class AndroidLibraryInstaller
{
public static bool InstallAndroidLibrary()
{
return !PluginPreferences.Instance.IsAndroidLibraryImported && CopyAndroidLibraryFromPackage();
}

private static bool CopyAndroidLibraryFromPackage()
{
string source = $"{AppodealEditorConstants.PackagePath}/Runtime/Plugins/Android/appodeal.androidlib~";
string destination = $"Assets/{AppodealEditorConstants.AppodealAndroidLibPath}";
if (Directory.Exists(AppodealEditorConstants.AppodealAndroidLibDir)) return false;

string source = $"{AppodealEditorConstants.PackageDir}/Runtime/Plugins/Android/appodeal.androidlib~";
if (!Directory.Exists(source))
{
Debug.LogError($"[Appodeal] Directory not found: '{source}'. Please, contact support@apppodeal.com about this issue.");
Debug.LogError($"[Appodeal] Directory was not found: '{source}'. Please, contact support@apppodeal.com about this issue.");
return false;
}

Directory.CreateDirectory("Assets/Plugins/Android");

if (Directory.Exists(destination))
{
FileUtil.DeleteFileOrDirectory(destination);
FileUtil.DeleteFileOrDirectory($"{destination}.meta");
}

FileUtil.CopyFileOrDirectory(source, destination);

PluginPreferences.Instance.IsAndroidLibraryImported = true;
PluginPreferences.SaveAsync();
FileUtil.CopyFileOrDirectory(source, AppodealEditorConstants.AppodealAndroidLibDir);

return true;
}
Expand Down
23 changes: 11 additions & 12 deletions Editor/AssetExtractors/ApdAssetPostprocessor.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
using System.IO;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using UnityEditor;
using AppodealStack.UnityEditor.InternalResources;
using AppodealStack.UnityEditor.Utils;

// ReSharper Disable CheckNamespace
// ReSharper Disable once CheckNamespace
namespace AppodealStack.UnityEditor.AssetExtractors
{
internal class ApdAssetPostprocessor : AssetPostprocessor
{
#if UNITY_2021_3_OR_NEWER
[SuppressMessage("ReSharper", "UnusedMember.Local")]
[SuppressMessage("ReSharper", "UnusedParameter.Local")]
[SuppressMessage("ReSharper", "Unity.IncorrectMethodSignature")]
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths, bool didDomainReload)
{
#else
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
{
const string prefsPath = "Assets/Appodeal/Editor/InternalResources/PluginPreferences.asset";
if (File.Exists(prefsPath) && AssetDatabase.LoadAssetAtPath<PluginPreferences>(prefsPath) == null) return;
#if APPODEAL_DEV
return;
#endif
if (deletedAssets.Any(asset => asset.Contains(AppodealEditorConstants.PackageDir))) return;

if (AndroidLibraryInstaller.InstallAndroidLibrary() | AppodealAdaptersInstaller.InstallAdapters())
{
AssetDatabase.Refresh();
}

AssetDatabase.SaveAssetIfDirty(PluginPreferences.Instance);

}
}
}
46 changes: 18 additions & 28 deletions Editor/AssetExtractors/AppodealAdaptersInstaller.cs
Original file line number Diff line number Diff line change
@@ -1,47 +1,37 @@
using System.IO;
using System.Linq;
using System;
using System.IO;
using UnityEditor;
using UnityEngine;
using AppodealStack.UnityEditor.Utils;
using AppodealStack.UnityEditor.InternalResources;

// ReSharper Disable CheckNamespace
// ReSharper Disable once CheckNamespace
namespace AppodealStack.UnityEditor.AssetExtractors
{
internal static class AppodealAdaptersInstaller
{
public static bool InstallAdapters()
{
return !PluginPreferences.Instance.AreAdaptersImported && CopyAdaptersFromPackage();
}
if (File.Exists(AppodealEditorConstants.DependenciesFilePath)) return false;

private static bool CopyAdaptersFromPackage()
{
var depsDir = new DirectoryInfo($"{AppodealEditorConstants.PackagePath}/{AppodealEditorConstants.DependenciesPath}");
if (!depsDir.Exists)
try
{
Debug.LogError($"[Appodeal] Directory not found: '{depsDir}'. Please, contact support@apppodeal.com about this issue.");
return false;
}
var depsFileInfo = new FileInfo(AppodealEditorConstants.BundledDependenciesFilePath);
if (!depsFileInfo.Exists)
{
Debug.LogError($"[Appodeal] File was not found: '{depsFileInfo.FullName}'. Please, contact support@apppodeal.com about this issue.");
return false;
}

Directory.CreateDirectory(AppodealEditorConstants.DependenciesDir);
FileUtil.ReplaceFile(depsFileInfo.FullName, AppodealEditorConstants.DependenciesFilePath);

var deps = depsDir.GetFiles("*Dependencies.txt", SearchOption.AllDirectories);
if (deps.Length < 1)
return true;
}
catch (Exception e)
{
Debug.LogError($"[Appodeal] No Adapters were found on path '{depsDir}'. Please, contact support@apppodeal.com about this issue.");
Debug.LogException(e);
return false;
}

string outputDir = $"{AppodealEditorConstants.PluginPath}/{AppodealEditorConstants.DependenciesPath}";

FileUtil.DeleteFileOrDirectory(outputDir);
Directory.CreateDirectory(outputDir);

deps.ToList().ForEach(dep => FileUtil.ReplaceFile(dep.FullName, $"{outputDir}/{dep.Name.Replace(".txt", ".xml")}"));

PluginPreferences.Instance.AreAdaptersImported = true;
PluginPreferences.SaveAsync();

return true;
}
}
}
18 changes: 0 additions & 18 deletions Editor/Dependencies/AdNetworkDependencies/AmazonDependencies.txt

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions Editor/Dependencies/AdNetworkDependencies/AppLovinDependencies.txt

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions Editor/Dependencies/AdNetworkDependencies/AppodealDependencies.txt

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions Editor/Dependencies/AdNetworkDependencies/BidonDependencies.txt

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions Editor/Dependencies/AdNetworkDependencies/BigoAdsDependencies.txt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions Editor/Dependencies/AdNetworkDependencies/IABDependencies.txt

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions Editor/Dependencies/AdNetworkDependencies/InMobiDependencies.txt

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6118e45

Please sign in to comment.