Apply rules to .preload file name (#227)
author최종헌/Common Platform Lab(SR)/Engineer/삼성전자 <j-h.choi@samsung.com>
Thu, 7 May 2020 04:40:28 +0000 (13:40 +0900)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Thu, 7 May 2020 04:40:28 +0000 (13:40 +0900)
Change-Id: I2adb4deab7d10a680c8d08fa7d631ffe1d267380

Managed/Tizen.Runtime/Tizen.Runtime.cs

index 6a87da2..580c44f 100644 (file)
@@ -25,11 +25,16 @@ namespace Tizen.Runtime
         const string preloadPath = "/usr/share/dotnet.tizen/preload/";
         public static void Preload()
         {
-            string[] paths = Directory.GetFiles(preloadPath);
+            string[] paths = Directory.GetFiles(preloadPath, "*.preload");
             Array.Sort(paths);
             foreach (string path in paths)
             {
-                if (Path.GetExtension(path) != ".preload")
+                // ex) Tizen.preload / 0A.Tizen.preload / A0.Tizen.preload / .0.Tizen.preload / .00.Tizen.preload
+                if (!char.IsNumber(Path.GetFileName(path), 0) || !char.IsNumber(Path.GetFileName(path), 1))
+                    continue;
+
+                // ex) 000.Tizen.preload / 0.Tizen.preload
+                if (Path.GetFileName(path).IndexOf('.') != 2)
                     continue;
 
                 try