Add proguard rules for SDL2
Some checks are pending
Build (Android) / CMake (push) Waiting to run
Build (Android) / Android.mk (push) Waiting to run
Build (C/P Actions) / FreeBSD (push) Waiting to run
Build (Emscripten) / emscripten (push) Waiting to run
Build (iOS/tvOS) / iOS (push) Waiting to run
Build (iOS/tvOS) / tvOS (push) Waiting to run
Build / Intel Compiler (Ubuntu 20.04) (push) Waiting to run
Build / Intel oneAPI (Ubuntu 20.04) (push) Waiting to run
Build / MacOS (autotools) (push) Waiting to run
Build / Ubuntu 20.04 (autotools) (push) Waiting to run
Build / Ubuntu 22.04 (autotools) (push) Waiting to run
Build / MacOS (CMake) (push) Waiting to run
Build / iOS (CMake) (push) Waiting to run
Build / tvOS (CMake) (push) Waiting to run
Build / Windows (clang32) (push) Waiting to run
Build / Windows (clang64) (push) Waiting to run
Build / Windows (mingw32) (push) Waiting to run
Build / Windows (ucrt64) (push) Waiting to run
Build / Windows (mingw64) (push) Waiting to run
Build / Ubuntu 20.04 (CMake) (push) Waiting to run
Build / Ubuntu 22.04 (CMake) (push) Waiting to run
Build (MSVC) / GDK (x64) (push) Waiting to run
Build (MSVC) / UWP (x64) (push) Waiting to run
Build (MSVC) / Windows (ARM) (push) Waiting to run
Build (MSVC) / Windows (ARM64) (push) Waiting to run
Build (MSVC) / Windows (x64) (push) Waiting to run
Build (MSVC) / Windows (x86) (push) Waiting to run
Build (MSVC) / Windows (clang-cl x64) (push) Waiting to run
Build (MSVC) / Windows (clang-cl x86) (push) Waiting to run
Build (MSVC) / Windows static VCRT (x64) (push) Waiting to run
Build (MSVC) / Windows static VCRT (x86) (push) Waiting to run
Build (Nintendo 3DS) / n3ds (push) Waiting to run
Build (Sony Playstation 2) / ps2 (push) Waiting to run
Build (Sony Playstation Portable) / psp (push) Waiting to run
Build (RISC OS) / CMake (push) Waiting to run
Build (RISC OS) / autotools (push) Waiting to run
Build (Sony Playstation Vita) / GLES (PVR_PSP2 + gl4es4vita) (push) Waiting to run
Build (Sony Playstation Vita) / GLES (pib) (push) Waiting to run
Build (OpenWatcom) / OS/2 (push) Waiting to run
Build (OpenWatcom) / Windows (push) Waiting to run

Based on existing work by @AntTheAlchemist on SDL3 branch.
This commit is contained in:
Alibek Omarov 2024-11-20 17:29:54 +03:00 committed by Sam Lantinga
parent e924f12a7b
commit f9c50e1bf7

View file

@ -15,3 +15,84 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLInputConnection {
void nativeCommitText(java.lang.String, int);
void nativeGenerateScancodeForUnichar(char);
}
-keep,includedescriptorclasses class org.libsdl.app.SDLActivity {
# for some reason these aren't compatible with allowoptimization modifier
boolean supportsRelativeMouse();
void setWindowStyle(boolean);
}
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLActivity {
java.lang.String nativeGetHint(java.lang.String); # Java-side doesn't use this, so it gets minified, but C-side still tries to register it
boolean onNativeSoftReturnKey();
void onNativeKeyboardFocusLost();
boolean isScreenKeyboardShown();
android.util.DisplayMetrics getDisplayDPI();
java.lang.String clipboardGetText();
boolean clipboardHasText();
void clipboardSetText(java.lang.String);
int createCustomCursor(int[], int, int, int, int);
void destroyCustomCursor(int);
android.content.Context getContext();
boolean getManifestEnvironmentVariables();
android.view.Surface getNativeSurface();
void initTouch();
boolean isAndroidTV();
boolean isChromebook();
boolean isDeXMode();
boolean isTablet();
void manualBackButton();
int messageboxShowMessageBox(int, java.lang.String, java.lang.String, int[], int[], java.lang.String[], int[]);
void minimizeWindow();
int openURL(java.lang.String);
void requestPermission(java.lang.String, int);
int showToast(java.lang.String, int, int, int, int);
boolean sendMessage(int, int);
boolean setActivityTitle(java.lang.String);
boolean setCustomCursor(int);
void setOrientation(int, int, boolean, java.lang.String);
boolean setRelativeMouseEnabled(boolean);
boolean setSystemCursor(int);
boolean shouldMinimizeOnFocusLoss();
boolean showTextInput(int, int, int, int);
}
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.HIDDeviceManager {
boolean initialize(boolean, boolean);
boolean openDevice(int);
int sendOutputReport(int, byte[]);
int sendFeatureReport(int, byte[]);
boolean getFeatureReport(int, byte[]);
void closeDevice(int);
}
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLAudioManager {
int[] getAudioOutputDevices();
int[] getAudioInputDevices();
int[] audioOpen(int, int, int, int, int);
void audioWriteFloatBuffer(float[]);
void audioWriteShortBuffer(short[]);
void audioWriteByteBuffer(byte[]);
void audioClose();
int[] captureOpen(int, int, int, int, int);
int captureReadFloatBuffer(float[], boolean);
int captureReadShortBuffer(short[], boolean);
int captureReadByteBuffer(byte[], boolean);
void captureClose();
void audioSetThreadPriority(boolean, int);
native int nativeSetupJNI();
native void removeAudioDevice(boolean, int);
native void addAudioDevice(boolean, int);
}
-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLControllerManager {
void pollInputDevices();
void pollHapticDevices();
void hapticRun(int, float, int);
void hapticStop(int);
}