SDK android.exe: fix "access denied" error.

Issue was a typo and the script was setting the
files as read-only (instead of clearing the r-o
attribute, it was setting it) before trying to
copy them.

Also reverted the code that hides the launched
app window so that the sdkmanager actually be
visible.

SDK Bug: 5683762

Change-Id: Id23302981f84b227361c6208fe6ef512e0ac2de3
diff --git a/sdkmanager/win_android/utils.cpp b/sdkmanager/win_android/utils.cpp
index 6da1893..bef1aa7 100755
--- a/sdkmanager/win_android/utils.cpp
+++ b/sdkmanager/win_android/utils.cpp
@@ -59,7 +59,7 @@
     ZeroMemory(&startup, sizeof(startup));

     startup.cb          = sizeof(startup);

     startup.dwFlags     = STARTF_USESHOWWINDOW;

-    startup.wShowWindow = SW_HIDE|SW_MINIMIZE;

+    startup.wShowWindow = SW_SHOWDEFAULT;

 

     int ret = CreateProcessA(

             (LPSTR) app,                                /* program path */

@@ -67,7 +67,7 @@
             NULL,                  /* process handle is not inheritable */

             NULL,                   /* thread handle is not inheritable */

             TRUE,                          /* yes, inherit some handles */

-            CREATE_NO_WINDOW,                /* we don't want a console */

+            0,                                          /* create flags */

             NULL,                     /* use parent's environment block */

             workDir,                 /* use parent's starting directory */

             &startup,                 /* startup info, i.e. std handles */

@@ -142,13 +142,14 @@
 // Because this runs as a 32-bit app, Windows automagically remaps some

 // folder under the hood (e.g. "Programs Files(x86)" is mapped as "Program Files").

 // This prevents the app from correctly searching for java.exe in these folders.

-// The registry is also remapped.

+// The registry is also remapped. This method disables this redirection.

+// Caller should restore the redirection later by using revertWow64FsRedirection().

 PVOID disableWow64FsRedirection() {

 

     // The call we want to make is the following:

     //    PVOID oldWow64Value;

     //    Wow64DisableWow64FsRedirection(&oldWow64Value);

-    // However that method may not exist (e.g. on non-64 systems) so

+    // However that method may not exist (e.g. on XP non-64 systems) so

     // we must not call it directly.

 

     PVOID oldWow64Value = 0;

@@ -173,7 +174,7 @@
 

     // The call we want to make is the following:

     //    Wow64RevertWow64FsRedirection(oldWow64Value);

-    // However that method may not exist (e.g. on non-64 systems) so

+    // However that method may not exist (e.g. on XP non-64 systems) so

     // we must not call it directly.

 

     HMODULE hmod = LoadLibrary("kernel32.dll");