Add Android APK inspection and device verification gates
This commit is contained in:
@@ -67,6 +67,17 @@ namespace MagnetismHeroes.Editor
|
||||
Debug.Log("[Integration] Main connected to GameApp.");
|
||||
}
|
||||
|
||||
public static void ConfigureAndroid()
|
||||
{
|
||||
PlayerSettings.SetScriptingBackend(UnityEditor.Build.NamedBuildTarget.Android, ScriptingImplementation.IL2CPP);
|
||||
PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARM64;
|
||||
PlayerSettings.Android.buildApkPerCpuArchitecture = false;
|
||||
PlayerSettings.defaultInterfaceOrientation = UIOrientation.LandscapeLeft;
|
||||
PlayerSettings.Android.forceInternetPermission = false;
|
||||
AssetDatabase.SaveAssets();
|
||||
Debug.Log("[AndroidConfiguration] ARM64 IL2CPP, landscape, no forced Internet permission.");
|
||||
}
|
||||
|
||||
public static void BuildAndroid()
|
||||
{
|
||||
string apkPath = Environment.GetEnvironmentVariable("MAGNETISM_APK_PATH");
|
||||
@@ -79,6 +90,8 @@ namespace MagnetismHeroes.Editor
|
||||
});
|
||||
Debug.Log($"[AndroidBuild] {report.summary.result}: {report.summary.totalSize} bytes, {report.summary.totalErrors} errors.");
|
||||
if (report.summary.result != BuildResult.Succeeded) throw new InvalidOperationException("Android build did not succeed.");
|
||||
File.WriteAllLines(apkPath + ".packed-assets.txt", report.packedAssets
|
||||
.SelectMany(asset => asset.contents).Select(asset => asset.sourceAssetPath).Distinct().OrderBy(path => path));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user