From 1cae52bbacc9a9d2bdd7fd13d7cd545cf3729378 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 25 Feb 2024 08:40:47 -0800 Subject: [PATCH] Added JNI native methods to proguard-rules.pro (thanks @AntTheAlchemist!) Fixes https://github.com/libsdl-org/SDL/issues/3563 --- android-project/app/proguard-rules.pro | 68 ++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/android-project/app/proguard-rules.pro b/android-project/app/proguard-rules.pro index eaf0e916c..0cb79dc8e 100644 --- a/android-project/app/proguard-rules.pro +++ b/android-project/app/proguard-rules.pro @@ -15,3 +15,71 @@ #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} + +-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLActivity { + void manualBackButton(); + boolean setActivityTitle(java.lang.String); + void setWindowStyle(boolean); + void setOrientation(int, int, boolean, java.lang.String); + void minimizeWindow(); + boolean shouldMinimizeOnFocusLoss(); + boolean isScreenKeyboardShown(); + boolean supportsRelativeMouse(); + boolean setRelativeMouseEnabled(boolean); + boolean sendMessage(int, int); + android.content.Context getContext(); + boolean isAndroidTV(); + boolean isTablet(); + boolean isChromebook(); + boolean isDeXMode(); + boolean getManifestEnvironmentVariables(); + boolean showTextInput(int, int, int, int); + android.view.Surface getNativeSurface(); + void initTouch(); + int messageboxShowMessageBox(int, java.lang.String, java.lang.String, int[], int[], java.lang.String[], int[]); + boolean clipboardHasText(); + java.lang.String clipboardGetText(); + void clipboardSetText(java.lang.String); + int createCustomCursor(int[], int, int, int, int); + void destroyCustomCursor(int); + boolean setCustomCursor(int); + boolean setSystemCursor(int); + void requestPermission(java.lang.String, int); + int openURL(java.lang.String); + int showToast(java.lang.String, int, int, int, int); + native java.lang.String nativeGetHint(java.lang.String); +} + +-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.HIDDeviceManager { + boolean initialize(boolean, boolean); + boolean openDevice(int); + int writeReport(int, byte[], boolean); + boolean readReport(int, byte[], boolean); + void closeDevice(int); +} + +-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLAudioManager { + void registerAudioDeviceCallback(); + void unregisterAudioDeviceCallback(); + int[] audioOpen(int, int, int, int, int); + void audioWriteFloatBuffer(float[]); + void audioWriteShortBuffer(short[]); + void audioWriteByteBuffer(byte[]); + int[] captureOpen(int, int, int, int, int); + int captureReadFloatBuffer(float[], boolean); + int captureReadShortBuffer(short[], boolean); + int captureReadByteBuffer(byte[], boolean); + void audioClose(); + void captureClose(); + void audioSetThreadPriority(boolean, int); + int nativeSetupJNI(); + void removeAudioDevice(boolean, int); + void addAudioDevice(boolean, java.lang.String, int); +} + +-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLControllerManager { + void pollInputDevices(); + void pollHapticDevices(); + void hapticRun(int, float, int); + void hapticStop(int); +}