diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Logger.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Logger.java index 168f83d145..bcd5fb4776 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Logger.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Logger.java @@ -15,6 +15,7 @@ public class Logger { public static native void begin(String logFilePath); /** Small listener for anything listening to the log */ + @Keep public interface eventLogListener { void onEventLogged(String text); } diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/MainActivity.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/MainActivity.java index 50eb96e747..92a25e9887 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/MainActivity.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/MainActivity.java @@ -36,6 +36,7 @@ import android.widget.ListView; import android.widget.Toast; +import androidx.annotation.Keep; import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; import androidx.core.content.ContextCompat; @@ -442,6 +443,7 @@ public static void switchKeyboardState() { if(touchCharInput != null) touchCharInput.switchKeyboardState(); } + @Keep public static void openLink(String link) { Context ctx = touchpad.getContext(); // no more better way to obtain a context statically ((Activity)ctx).runOnUiThread(() -> { @@ -461,6 +463,7 @@ public static void openLink(String link) { } }); } + @SuppressWarnings("unused") //TODO: actually use it public static void openPath(String path) { Context ctx = touchpad.getContext(); // no more better way to obtain a context statically @@ -473,6 +476,7 @@ public static void openPath(String path) { }); } + @Keep public static void querySystemClipboard() { Tools.runOnUiThread(()->{ ClipData clipData = GLOBAL_CLIPBOARD.getPrimaryClip(); @@ -491,6 +495,7 @@ public static void querySystemClipboard() { }); } + @Keep public static void putClipboardData(String data, String mimeType) { Tools.runOnUiThread(()-> { ClipData clipData = null; diff --git a/app_pojavlauncher/src/main/java/org/lwjgl/glfw/CallbackBridge.java b/app_pojavlauncher/src/main/java/org/lwjgl/glfw/CallbackBridge.java index ff553bc03b..f3ebc6e356 100644 --- a/app_pojavlauncher/src/main/java/org/lwjgl/glfw/CallbackBridge.java +++ b/app_pojavlauncher/src/main/java/org/lwjgl/glfw/CallbackBridge.java @@ -2,8 +2,10 @@ import net.kdt.pojavlaunch.*; import android.content.*; +import android.util.Log; import android.view.Choreographer; +import androidx.annotation.Keep; import androidx.annotation.Nullable; import java.util.ArrayList; @@ -102,6 +104,7 @@ public static boolean isGrabbing() { // Called from JRE side @SuppressWarnings("unused") + @Keep public static @Nullable String accessAndroidClipboard(int type, String copy) { switch (type) { case CLIPBOARD_COPY: @@ -164,6 +167,7 @@ public static void setModifiers(int keyCode, boolean isDown){ //Called from JRE side @SuppressWarnings("unused") + @Keep private static void onGrabStateChanged(final boolean grabbing) { isGrabbing = grabbing; sChoreographer.postFrameCallbackDelayed((time) -> {