Skip to content

Commit 746dc3e

Browse files
authored
Merge pull request #44 from tux4kids/feature/16kb-page-size-support
Feature/16kb page size support
2 parents 478a68d + 3fe8e07 commit 746dc3e

File tree

11 files changed

+37
-11
lines changed

11 files changed

+37
-11
lines changed

app/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ else {
99

1010
android {
1111
namespace 'org.tuxpaint'
12-
compileSdkVersion 34
12+
compileSdkVersion 35
1313
defaultConfig {
1414
minSdkVersion 21
15-
targetSdkVersion 34
15+
targetSdkVersion 35
1616
externalNativeBuild {
1717
ndkBuild {
1818
arguments "APP_PLATFORM=android-21"
1919
abiFilters 'arm64-v8a'
20+
// Add 16KB page size alignment support - use ldFlags instead of cFlags
21+
arguments "APP_LDFLAGS+=-Wl,-z,max-page-size=16384"
2022
}
2123
}
2224
}

app/src/main/jni/Application.mk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
APP_ABI := arm64-v8a
22
APP_PLATFORM := android-16
3-
APP_CFLAGS += -Wno-error=format-security
3+
APP_CFLAGS += -Wno-error=format-security -Wno-error=cast-function-type-strict -Wno-error
44
APP_STL := c++_shared
5-
APP_CPPFLAGS += -fexceptions
5+
APP_CPPFLAGS += -fexceptions -Wno-error=cast-function-type-strict -Wno-error
6+
APP_CXXFLAGS += -Wno-error=cast-function-type-strict -Wno-error
67
APP_ALLOW_MISSING_DEPS := true
8+
# Add 16KB page size alignment support for Google Play Store 2025 requirements
9+
APP_LDFLAGS += -Wl,-z,max-page-size=16384
710

app/src/main/jni/SDL2/src/sensor/android/SDL_androidsensor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static void SDL_ANDROID_SensorUpdate(SDL_Sensor *sensor)
161161
ASensorEvent event;
162162
struct android_poll_source *source;
163163

164-
if (ALooper_pollAll(0, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
164+
if (ALooper_pollOnce(0, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
165165
SDL_zero(event);
166166
while (ASensorEventQueue_getEvents(sensor->hwdata->eventqueue, &event, 1) > 0) {
167167
SDL_PrivateSensorUpdate(sensor, 0, event.data, SDL_arraysize(event.data));

app/src/main/jni/SDL2_ttf/external/harfbuzz/Android.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ LOCAL_C_INCLUDES = \
6161
LOCAL_STATIC_LIBRARIES += freetype
6262

6363
#LOCAL_CFLAGS += -DHB_NO_MT -DHAVE_OT -DHAVE_UCDN -fPIC
64-
LOCAL_CFLAGS += -DHAVE_CONFIG_H -fPIC
64+
LOCAL_CFLAGS += -DHAVE_CONFIG_H -fPIC -Wno-cast-function-type-strict -Wno-error -Wno-cast-function-type -w
65+
LOCAL_CXXFLAGS += -Wno-cast-function-type-strict -Wno-error -Wno-cast-function-type -Wno-cast-function-type-strict -w
66+
LOCAL_CPPFLAGS += -Wno-cast-function-type-strict -Wno-error -Wno-cast-function-type -w
6567

6668
LOCAL_EXPORT_C_INCLUDES = $(LOCAL_PATH)/src/
6769

app/src/main/jni/cairo-1.14.0/Android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ LOCAL_CFLAGS := \
99
-D_REENTRANT \
1010
-DCAIRO_NO_MUTEX=1 \
1111
-Wno-attributes \
12+
-Wno-error=int-conversion \
1213
$(NULL)
1314

1415
LOCAL_C_INCLUDES := \

app/src/main/jni/glib-2.77.0/Android.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,9 @@ LOCAL_CFLAGS := \
477477
-DGIO_COMPILATION \
478478
-DGIO_MODULE_DIR=\"/mnt/sdcard/Android/data/org.tuxpaint/files/glib\" \
479479
-DXDG_PREFIX=_gio_xdg \
480-
-marm \
480+
-UHAVE_STRERROR_R \
481+
-USTRERROR_R_CHAR_P \
482+
-Wno-error=int-conversion \
481483
$(NULL)
482484

483485
LOCAL_SHARED_LIBRARIES := \

app/src/main/jni/tuxpaint/Android.mk

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ MY_DEFS := \
7878
-DHAVE_STRCASESTR \
7979
$(MY_NOSOUNDFLAG) $(MY_NOSVGFLAG) $(MY_NOPANGOFLAG)
8080

81+
LOCAL_C_INCLUDES := \
82+
$(LOCAL_PATH)/../SDL2/src/events \
83+
$(LOCAL_PATH)/../libimagequant \
84+
$(LOCAL_PATH)/src/mouse \
85+
$(LOCAL_PATH)/../fribidi-1.0.13 \
86+
$(NULL)
87+
8188
LOCAL_CFLAGS := \
8289
$(MY_CFLAGS) \
8390
$(MY_DEFS)
@@ -86,6 +93,11 @@ LOCAL_LDLIBS := \
8693
-lz -llog -lGLESv1_CM -lGLESv2 -landroid \
8794
$(NULL)
8895

96+
# Add 16KB page size alignment support for Google Play Store 2025 requirements
97+
LOCAL_LDFLAGS := \
98+
-Wl,-z,max-page-size=16384 \
99+
$(NULL)
100+
89101
LOCAL_SHARED_LIBRARIES := SDL2 SDL2_image SDL2_mixer SDL2_ttf SDL2_Pango tuxpaint_intl tuxpaint_fribidi tuxpaint_png tuxpaint_rsvg tuxpaint_cairo tp_android_assets_fopen libimagequant SDL2_gfx tuxpaint_pango tuxpaint_fontconfig tuxpaint_glib tuxpaint_xml2
90102

91103
include $(BUILD_SHARED_LIBRARY)
@@ -98,6 +110,8 @@ $(foreach _magic, $(MAGIC_NAMES),\
98110
$(eval LOCAL_MODULE := $(_magic))\
99111
$(eval LOCAL_C_INCLUDES := $(LOCAL_PATH)/src $(LOCAL_PATH)/../SDL2_gfx-1.0.4/)\
100112
$(eval MAGIC_CFLAGS:=-g3 -O2 -fno-common -W -Wstrict-prototypes -Wmissing-prototypes -Wall)\
113+
$(eval LOCAL_CFLAGS := $(MAGIC_CFLAGS))\
114+
$(eval LOCAL_LDFLAGS := -Wl,-z,max-page-size=16384)\
101115
$(eval LOCAL_SRC_FILES := magic/src/$(_magic).c)\
102116
$(eval LOCAL_SHARED_LIBRARIES := SDL2 SDL2_image SDL2_mixer SDL2_ttf tuxpaint_intl SDL2_gfx)\
103117
$(eval include $(BUILD_SHARED_LIBRARY))\

app/src/main/jni/tuxpaint/src/i18n.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252

5353
#ifdef __ANDROID__
5454
#include "SDL2/SDL.h"
55+
#include "../../../SDL2/src/core/android/SDL_android.h"
5556
#include "jni.h"
5657
// since setlocale on the Android is not supported well,
5758
// setlocale cannot get current default locale of the device.

app/src/main/jni/tuxpaint/src/tuxpaint.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ extern status_t haiku_trash(const char *f);
358358
#define AUTOSAVE_GOING_BACKGROUND
359359
#include "android_print.h"
360360
#include "android_assets.h"
361+
#include "SDL_mouse_c.h"
361362
int entered_background = 0;
362363

363364
#else
@@ -31871,15 +31872,15 @@ static void convert_motion_to_wheel(SDL_Event event)
3187131872
{
3187231873
while (motion_dy - high > 0)
3187331874
{
31874-
SDL_SendMouseWheel(NULL, event.motion.which, 0, 1);
31875+
SDL_SendMouseWheel(NULL, event.motion.which, 0.0f, 1.0f, SDL_MOUSEWHEEL_NORMAL);
3187531876
motion_dy -= high;
3187631877
}
3187731878
}
3187831879
else
3187931880
{
3188031881
while (motion_dy + high < 0)
3188131882
{
31882-
SDL_SendMouseWheel(NULL, event.motion.which, 0, -1);
31883+
SDL_SendMouseWheel(NULL, event.motion.which, 0.0f, -1.0f, SDL_MOUSEWHEEL_NORMAL);
3188331884
motion_dy += high;
3188431885
}
3188531886
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
google()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:8.2.1'
9+
classpath 'com.android.tools.build:gradle:8.7.3'
1010

1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files

0 commit comments

Comments
 (0)