Skip to content

Commit 36eb8d5

Browse files
committed
android: remove Donate option in main menu
to comply with Google Play policy. Only applies to builds published on Google Play via the SUPERTUX_GOOGLE_PLAY CMake option.
1 parent ba2cc13 commit 36eb8d5

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

mk/android/app/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ android {
2828
minSdkVersion 21
2929

3030
// NOTE: Don't forget to bump the version code!
31-
versionCode 5
31+
versionCode 6
3232
versionName "0.7.0-beta.2"
3333

3434
ndkVersion "29.0.14206865"
@@ -52,6 +52,9 @@ android {
5252
"-Wno-dev"
5353
abiFilters rootProject.ext.cpuarch as String[]
5454
}
55+
if (rootProject.ext.googleplay) {
56+
android.defaultConfig.externalNativeBuild.cmake.arguments.add("-DSUPERTUX_GOOGLE_PLAY=ON")
57+
}
5558
android.defaultConfig.externalNativeBuild.cmake.arguments.addAll(rootProject.ext.cmake_args)
5659
}
5760
}

mk/android/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ for (String task : gradle.startParameter.getTaskNames()) {
88
}
99
}
1010

11+
ext.googleplay = hasProperty("googleplay")
12+
1113
if (hasProperty("cpuarch")) {
1214
ext.cpuarch = property("cpuarch").split()
1315
} else {

mk/cmake/SuperTux/Android.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
message(STATUS "ANDROID_ABI: ${ANDROID_ABI} :)")
22

3+
option(SUPERTUX_GOOGLE_PLAY NO "Build SuperTux for Google Play")
4+
35
if(NOT DEFINED ENV{ANDROID_NDK_HOME})
46
set(ndk_home "${SUPERTUX_NDK_HOME}")
57
else()
@@ -26,6 +28,10 @@ endif()
2628

2729
add_compile_options(-D__ANDROID__)
2830

31+
if(SUPERTUX_GOOGLE_PLAY)
32+
add_compile_definitions(GOOGLE_PLAY)
33+
endif()
34+
2935
set(ANDROID_STL "c++_shared")
3036
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${ndk_home}/build/cmake/android.toolchain.cmake)
3137
set(CMAKE_TOOLCHAIN_FILE ${vcpkg_root}/scripts/buildsystems/vcpkg.cmake)

src/supertux/menu/main_menu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ MainMenu::MainMenu()
6666
add_entry(MNID_LEVELEDITOR, _("Level Editor"));
6767
#endif
6868
add_entry(MNID_CREDITS, _("Credits"));
69-
#ifndef STEAM_BUILD
70-
// Links to external purchases are not allowed on Steam, including donations
69+
#if !defined(STEAM_BUILD) && !defined(GOOGLE_PLAY)
70+
// Links to external purchases are not allowed on Steam or Google Play, including donations
7171
add_entry(MNID_DONATE, _("Donate"));
7272
#endif
7373
#ifndef REMOVE_QUIT_BUTTON

0 commit comments

Comments
 (0)