Skip to content

Commit

Permalink
check path
Browse files Browse the repository at this point in the history
  • Loading branch information
noodle1983 committed Sep 2, 2024
1 parent 8385e86 commit dc129bd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Assets/AndroidIl2cppPatchDemo/Editor/AndroidBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ static bool Exec(string filename, string args)
public static bool ValidateConfig()
{
string sdkPath = EditorPrefs.GetString("AndroidSdkRoot", "");
if (string.IsNullOrEmpty(sdkPath)) { sdkPath = DEFAULT_SDK_PATH; }
if (string.IsNullOrEmpty(sdkPath) || !Directory.Exists(sdkPath)) { sdkPath = DEFAULT_SDK_PATH; }
if (string.IsNullOrEmpty(sdkPath) || !Directory.Exists(sdkPath))
{
Debug.LogError("sdk path is empty! please config via menu path:Edit/Preference->External tools.");
return false;
}

string jdkPath = EditorPrefs.GetString("JdkPath", "");
if (string.IsNullOrEmpty(jdkPath)) { jdkPath = DEFAULT_JDK_PATH; }
if (string.IsNullOrEmpty(jdkPath) || !Directory.Exists(jdkPath)) { jdkPath = DEFAULT_JDK_PATH; }
if (string.IsNullOrEmpty(jdkPath) || !Directory.Exists(jdkPath))
{
Debug.LogError("jdk path is empty! please config via menu path:Edit/Preference->External tools.");
Expand All @@ -92,7 +92,7 @@ public static bool ValidateConfig()

string ndkPath = EditorPrefs.GetString("AndroidNdkRootR16b", "");
if (string.IsNullOrEmpty(ndkPath)) { ndkPath = EditorPrefs.GetString("AndroidNdkRoot", ""); }
if (string.IsNullOrEmpty(ndkPath)) { ndkPath = DEFAULT_NDK_PATH; }
if (string.IsNullOrEmpty(ndkPath) || !Directory.Exists(ndkPath)) { ndkPath = DEFAULT_NDK_PATH; }
if (string.IsNullOrEmpty(ndkPath) || !Directory.Exists(ndkPath))
{
Debug.LogError("ndk path is empty! please config via menu path:Edit/Preference->External tools.");
Expand Down Expand Up @@ -162,7 +162,7 @@ public static bool ExportGradleProject()
public static bool BuildIl2cppSoLib()
{
string jdkPath = EditorPrefs.GetString("JdkPath", "");
if (string.IsNullOrEmpty(jdkPath)) { jdkPath = DEFAULT_JDK_PATH; }
if (string.IsNullOrEmpty(jdkPath) || !Directory.Exists(jdkPath)) { jdkPath = DEFAULT_JDK_PATH; }
if (string.IsNullOrEmpty(jdkPath) || !Directory.Exists(jdkPath))
{
Debug.LogError("jdk path is empty! please config via menu path:Edit/Preference->External tools.");
Expand Down Expand Up @@ -308,7 +308,7 @@ public static bool GenerateBinPatches()
public static bool GenerateBuildScripts()
{
string jdkPath = EditorPrefs.GetString("JdkPath", "");
if (string.IsNullOrEmpty(jdkPath)) { jdkPath = DEFAULT_JDK_PATH; }
if (string.IsNullOrEmpty(jdkPath) || !Directory.Exists(jdkPath)) { jdkPath = DEFAULT_JDK_PATH; }
if (string.IsNullOrEmpty(jdkPath) || !Directory.Exists(jdkPath))
{
Debug.LogError("jdk path is empty! please config via menu path:Edit/Preference->External tools.");
Expand Down

0 comments on commit dc129bd

Please sign in to comment.