Skip to content

Commit

Permalink
fix(build): allow proguard profile to launch
Browse files Browse the repository at this point in the history
It is still plagued with bugs, but it might stay handy the day we need to push some limits
  • Loading branch information
Mathias-Boulay committed Dec 6, 2024
1 parent 1e7b005 commit 42a0e58
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(() -> {
Expand All @@ -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
Expand All @@ -473,6 +476,7 @@ public static void openPath(String path) {
});
}

@Keep
public static void querySystemClipboard() {
Tools.runOnUiThread(()->{
ClipData clipData = GLOBAL_CLIPBOARD.getPrimaryClip();
Expand All @@ -491,6 +495,7 @@ public static void querySystemClipboard() {
});
}

@Keep
public static void putClipboardData(String data, String mimeType) {
Tools.runOnUiThread(()-> {
ClipData clipData = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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) -> {
Expand Down

0 comments on commit 42a0e58

Please sign in to comment.