diff --git a/src/Console.hx b/src/Console.hx index 7c1f2204..72f4bb8e 100644 --- a/src/Console.hx +++ b/src/Console.hx @@ -39,10 +39,7 @@ class Console { entries = []; consumers = []; timeSinceStart = haxe.Timer.stamp(); - #if hl - if (!FileSystem.exists(Settings.settingsDir)) { - FileSystem.createDirectory(Settings.settingsDir); - } + #if (hl && !android) consoleFileHandle = sys.io.File.write(haxe.io.Path.join([Settings.settingsDir, "console.log"]), false); #end } @@ -58,7 +55,7 @@ class Console { function addEntry(type:String, msg:String) { var e = new ConsoleEntry(getTime(), type, msg); entries.push(e); - #if hl + #if (hl && !android) consoleFileHandle.writeString('[${e.time}] ${e.text}\n'); #end for (c in consumers) { diff --git a/src/Settings.hx b/src/Settings.hx index 30e31e30..f0cdcd2d 100644 --- a/src/Settings.hx +++ b/src/Settings.hx @@ -205,6 +205,10 @@ class Settings { var i = 4; return hl.Bytes.fromValue("null", i); } + + @:hlNative("std", "sys_special") static function sys_special(key:hl.Bytes):hl.Bytes { + return null; + } #end public static function applySettings() { @@ -321,6 +325,9 @@ class Settings { #if hl settingsExists = FileSystem.exists(Path.join([settingsDir, "settings.json"])); #end + #if android + settingsDir = @:privateAccess String.fromUCS2(sys_special(@:privateAccess Sys.getPath("android_internal_storage_path"))); + #end #if js var localStorage = js.Browser.getLocalStorage(); if (localStorage != null) {