diff --git a/.gitea/workflows/compile.yaml b/.gitea/workflows/compile.yaml index dfe1bd1..f955aa3 100644 --- a/.gitea/workflows/compile.yaml +++ b/.gitea/workflows/compile.yaml @@ -3,7 +3,7 @@ run-name: Build the project on: [push] jobs: - build: + build-appimage: runs-on: ubuntu-latest steps: - name: Check out repository code @@ -13,18 +13,54 @@ jobs: ref: main fetch-depth: 0 - name: Install system dependencies - run: apt update && apt install -y flatpak-builder flatpak python3-aiohttp python3-tenacity libostree-1-1 python3-gi gir1.2-ostree-1.0 wget - - name: Add flathub repo and install flatpak dependencies - run: flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo + run: apt update && apt install -y wget python3 python3-pip + - name: Install Python dependencies via pip + run: python -m venv venv && ./venv/bin/pip install lddwrap - name: Build project - run: flatpak-builder --install-deps-from flathub build-flatpak com.experimentalcraft.NekoPlayer.yml --repo ./flatpak-repo + run: ./build-appimage.sh - name: Download uploading script - run: wget https://raw.githubusercontent.com/flatpak/flat-manager/9401efbdc0d6bd489507d8401c567ba219d735d5/flat-manager-client -O flat-manager-client && chmod +x flat-manager-client - - name: Upload to flatpak repo - run: ./flat-manager-client -v --token $FLATPAK_TOKEN push --commit --publish $(./flat-manager-client -v --token $FLATPAK_TOKEN create http://192.168.122.249:8080 beta) ./flatpak-repo/ - env: - FLATPAK_TOKEN: ${{ secrets.FLATPAK_TOKEN }} - #- uses: actions/upload-artifact@v3 - # with: - # name: build - # path: builddir/player + - uses: actions/upload-artifact@v3 + with: + name: build + path: build/Looper.AppImage + build-gentoo: + run-on: gentoo + steps: + - name: Build binary package + run: emerge -v media-sound/looper + build-android: + run-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v3 + with: + submodules: recursive + ref: main + fetch-depth: 0 + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 17 + - name: Setup Android SDK + uses: android-actions/setup-android@v2.0.10 + - name: Build Debug apk + run: ./setup-android-build.sh && cd sdl-android-project && ./gradlew assembleDebug --stacktrace + - name: Build Debug bundle + run: cd sdl-android-project && ./gradlew bundleDebug --stacktrace + - name: Get debug file aab path + id: debugAab + run: echo "aabfile=$(find sdl-android-project/app/build/outputs/bundle/debug/*.aab)" >> $GITHUB_OUTPUT + - name: Get debug file apk path + id: debugApk + run: echo "apkfile=$(find sdl-android-project/app/build/outputs/apk/debug/*.apk)" >> $GITHUB_OUTPUT + - name: Zip Files + uses: papeloto/action-zip@v1 + with: + files: ${{ steps.debugAab.outputs.aabfile }} ${{ steps.debugApk.outputs.apkfile }} + dest: ${{ steps.debugApk.outputs.apkfile }}.zip + - name: Upload Debug build to Artifacts + uses: actions/upload-artifact@v3 + with: + name: debug-artifacts + path: ${{ steps.debugApk.outputs.apkFile }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 29d9a7c..87aea33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,6 +120,11 @@ if(DEFINED ANDROID_NDK) set(USE_G719 OFF CACHE BOOL "" FORCE) set(USE_VORBIS OFF CACHE BOOL "" FORCE) set(BUILD_FMT ON CACHE BOOL "" FORCE) + set(protobuf_INSTALL OFF CACHE BOOL "" FORCE) + set(protobuf_BUILD_PROTOBUF_BINARIES ON CACHE BOOL "" FORE) + set(protobuf_BUILD_PROTOC_BINARIES OFF CACHE BOOL "" FORCE) + set(utf8_range_ENABLE_INSTALL OFF CACHE BOOL "" FORCE) + set(protobuf_BUILD_TESTS OFF CACHE BOOL "" FORCE) endif() if (BUILD_SDL) set(SDL_SHARED OFF CACHE BOOL "" FORCE) @@ -320,12 +325,6 @@ if(BUILD_SOUNDTOUCH) add_subdirectory(subprojects/soundtouch) set(SOUNDTOUCH_TARGET SoundTouch) endif() -if(BUILD_PROTOBUF) - add_subdirectory(subprojects/protobuf) -else() - find_package(protobuf REQUIRED) - find_package(absl CONFIG REQUIRED) -endif() if(USE_LIBINTL_LITE) add_subdirectory(subprojects/libintl-lite) set(LIBINTL_LIBRARY intl CACHE INTERNAL "") @@ -339,7 +338,7 @@ if (DEFINED ANDROID_NDK) add_subdirectory(subprojects/oboe) target_link_libraries(liblooper PUBLIC oboe) endif() -target_link_libraries(liblooper PUBLIC ${Protobuf_LIBRARY_RELEASE} fmt::fmt) +target_link_libraries(liblooper PUBLIC fmt::fmt) target_include_directories(liblooper PUBLIC ${LIBINTL_INCDIRS}) target_link_libraries(liblooper PUBLIC ${LIBINTL_LIBRARY}) if(DEFINED EMSCRIPTEN) @@ -368,6 +367,13 @@ else() endif() target_link_libraries(liblooper PUBLIC ${SDL2_TARGET} SDL2main ${SDL_MIXER_X_TARGET} ${SOUNDTOUCH_TARGET} libvgmstream libvgmstream_shared ${JSONCPP_TARGET}) endif() +if(BUILD_PROTOBUF) + add_subdirectory(subprojects/protobuf) +else() + find_package(protobuf REQUIRED) + find_package(absl CONFIG REQUIRED) +endif() + if (${ENABLE_DBUS}) target_link_libraries(liblooper PUBLIC SDBusCpp::sdbus-c++) target_compile_definitions(liblooper PUBLIC DBUS_ENABLED) diff --git a/config.hpp b/config.hpp index 90692c9..57be9a7 100644 --- a/config.hpp +++ b/config.hpp @@ -1,6 +1,6 @@ #pragma once #include -#if defined(__EMSCRIPTEN__)||defined(__ANDROID__) +#if defined(__EMSCRIPTEN__) #define NO_THREADS #endif @@ -19,4 +19,7 @@ #else #define SAMPLE_FMT SDL_SAMPLE_FMT #define USE_SDL -#endif \ No newline at end of file +#endif +#ifdef USE_SDL +#define LockAudioDevice SDL_LockAudioDevice +#endif diff --git a/file_backend.hpp b/file_backend.hpp index ddba7ec..d9431e8 100644 --- a/file_backend.hpp +++ b/file_backend.hpp @@ -128,11 +128,11 @@ class AndroidFile : public File { bool is_open() override; }; #endif -#ifdef __ANDROID__ -#define FILE_TYPE AndroidFile -#else +//#ifdef __ANDROID__ +//#define FILE_TYPE AndroidFile +//#else #define FILE_TYPE MemFile -#endif +//#endif STREAMFILE *get_sf_from_file(File *file); SDL_RWops *get_sdl_file(File *file); File *open_file(const char *fname); diff --git a/libnames.patch b/libnames.patch new file mode 100644 index 0000000..e93a1df --- /dev/null +++ b/libnames.patch @@ -0,0 +1,8 @@ +272c272 +< "SDL2", +--- +> "looper", +277c277 +< "main" +--- +> // "main" diff --git a/log.cpp b/log.cpp index 7f82b22..d8073eb 100644 --- a/log.cpp +++ b/log.cpp @@ -32,6 +32,7 @@ namespace Looper::Log { } } else { #ifdef __ANDROID__ + bool is_newline = chr == '\n' || chr == '\r'; if (!is_newline) { line += chr; } else { @@ -225,7 +226,7 @@ namespace Looper::Log { LogStream *_init_logging_normal(int id) { std::string name = get_log_name_by_idx(id); #ifdef __ANDROID__ - std::map stream_files = { + std::map stream_files = { {-1, ANDROID_LOG_DEBUG}, {0, ANDROID_LOG_INFO}, {1, ANDROID_LOG_WARN}, diff --git a/main.cpp b/main.cpp index 2a23403..395d726 100644 --- a/main.cpp +++ b/main.cpp @@ -263,7 +263,8 @@ int main(int argc, char **argv) { return looper_run_as_executable(app.remaining(false)); } } catch (CLI::CallForHelp) { - looper_run_as_executable(std::vector({"--help"})); + return looper_run_as_executable(std::vector({"--help"})); } free(executable_path); + return 255; } diff --git a/playback.cpp b/playback.cpp index 3db224e..608b45e 100644 --- a/playback.cpp +++ b/playback.cpp @@ -78,15 +78,35 @@ oboe::DataCallbackResult PlaybackInstance::onAudioReady( oboe::AudioStream *audioStream, void *audioData, int32_t numFrames) { - SDLCallbackInner((Uint8*)audioData, numFrames * audioStream->getBytesPerFrame()); + audio_playback_mutex.lock(); + if (!audio_playback_paused.load()) { + SDLCallbackInner((Uint8*)audioData, numFrames * audioStream->getBytesPerFrame()); + } else { + memset(audioData, 0, numFrames * audioStream->getBytesPerFrame()); + } + audio_playback_mutex.unlock(); return oboe::DataCallbackResult::Continue; } #endif +void PlaybackInstance::LockAudioDevice() { +#ifdef USE_SDL + SDL_LockAudioDevice(device); +#else + audio_playback_mutex.lock(); +#endif +} +void PlaybackInstance::UnlockAudioDevice() { +#ifdef USE_SDL + SDL_UnlockAudioDevice(device) +#else + audio_playback_mutex.unlock(); +#endif +} void PlaybackInstance::SDLCallback(void *userdata, Uint8 *stream, int len) { ((PlaybackInstance*)userdata)->SDLCallbackInner(stream, len); } void PlaybackInstance::Load(const char *file, int idx) { - SDL_LockAudioDevice(device); + LockAudioDevice(); load_finished.store(false); playback_ready.store(false); if (process != nullptr) delete process; @@ -147,7 +167,7 @@ void PlaybackInstance::Load(const char *file, int idx) { delete process; process = nullptr; } - SDL_UnlockAudioDevice(device); + UnlockAudioDevice(); load_finished.store(true); flag_mutex.lock(); stopped.store(false); @@ -157,14 +177,14 @@ void PlaybackInstance::Load(const char *file, int idx) { } void PlaybackInstance::Unload() { if (process == nullptr) return; - SDL_LockAudioDevice(device); + LockAudioDevice(); delete process; process = nullptr; SDL_FreeAudioStream(sdl_stream); sdl_stream = nullptr; if (buf) free(buf); buf = nullptr; - SDL_UnlockAudioDevice(device); + UnlockAudioDevice(); } void PlaybackInstance::UpdateST() { bool any_changed = false; @@ -226,7 +246,7 @@ void PlaybackInstance::InitLoopFunction() { oboe::AudioStreamBuilder builder; builder.setDirection(oboe::Direction::Output); builder.setSharingMode(oboe::SharingMode::Shared); - builder.setPerformanceMode(oboe::PerformanceMode::None); + builder.setPerformanceMode(oboe::PerformanceMode::PowerSaving); builder.setFormat(SAMPLE_FMT); builder.setDataCallback(this); auto res = builder.openStream(ostream); @@ -328,9 +348,9 @@ void PlaybackInstance::LoopFunction() { current_stream = 0; } } else { - SDL_LockAudioDevice(device); + LockAudioDevice(); if (process && process->process_running()) process->set_stream_idx(current_stream); - SDL_UnlockAudioDevice(device); + UnlockAudioDevice(); } if (process && process->process_running()) { playback_ready.store(true); @@ -346,7 +366,10 @@ void PlaybackInstance::LoopFunction() { set_signal(PlaybackSignalSeeked); } if (pause_changed.exchange(false) || just_stopped.exchange(false) || just_started.exchange(false)) { - SDL_PauseAudioDevice(device, (stopped.load() || paused) ? 1 : 0); + audio_playback_paused.store(stopped.load() || paused); +#ifdef USE_SDL + SDL_PauseAudioDevice(device, (audio_playback_paused.load()) ? 1 : 0); +#endif if (paused) { set_signal(PlaybackSignalPaused); } else { @@ -354,10 +377,10 @@ void PlaybackInstance::LoopFunction() { } } if (update.exchange(false)) { - SDL_LockAudioDevice(device); + LockAudioDevice(); real_volume = volume / 100.0; UpdateST(); - SDL_UnlockAudioDevice(device); + UnlockAudioDevice(); } flag_mutex.unlock(); } @@ -425,16 +448,16 @@ PlaybackInstance::PlaybackInstance() { bufsize = 0; process = nullptr; running.store(true); - #if NO_THREADS +#ifdef NO_THREADS start_loop(); - #else +#else thread = std::thread(&PlaybackInstance::ThreadFunc, this); loop_started = true; - #endif +#endif while (loop_started && !load_finished.exchange(false)) { - #if NO_THREADS +#ifdef NO_THREADS LoopHook(); - #endif +#endif std::this_thread::sleep_for(20ms); } load_finished.store(false); diff --git a/playback.h b/playback.h index 1790c8c..c7dd3e7 100644 --- a/playback.h +++ b/playback.h @@ -245,6 +245,12 @@ private: #endif PlaybackProcess *process; std::string filePath; +#ifndef USE_SDL + std::mutex audio_playback_mutex; + std::atomic_bool audio_playback_paused; +#endif + void LockAudioDevice(); + void UnlockAudioDevice(); std::atomic_bool running; std::atomic_bool file_changed; std::atomic_bool seeking; diff --git a/sdl-android-project/.project b/sdl-android-project/.project new file mode 100644 index 0000000..3a3984c --- /dev/null +++ b/sdl-android-project/.project @@ -0,0 +1,28 @@ + + + sdl-android-project + Project sdl-android-project created by Buildship. + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.buildship.core.gradleprojectnature + + + + 1729361463965 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/sdl-android-project/.settings/org.eclipse.buildship.core.prefs b/sdl-android-project/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..1382021 --- /dev/null +++ b/sdl-android-project/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,13 @@ +arguments=--init-script /home/catmeow/.local/share/zed/extensions/work/java/jdt-language-server-1.40.0/configuration/org.eclipse.osgi/57/0/.cp/gradle/init/init.gradle +auto.sync=false +build.scans.enabled=false +connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) +connection.project.dir= +eclipse.preferences.version=1 +gradle.user.home= +java.home=/opt/openjdk-bin-21.0.4_p7 +jvm.arguments= +offline.mode=false +override.workspace.settings=true +show.console.view=true +show.executions.view=true diff --git a/sdl-android-project/app/.classpath b/sdl-android-project/app/.classpath new file mode 100644 index 0000000..0a3280e --- /dev/null +++ b/sdl-android-project/app/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/sdl-android-project/app/.project b/sdl-android-project/app/.project new file mode 100644 index 0000000..7e1aa36 --- /dev/null +++ b/sdl-android-project/app/.project @@ -0,0 +1,34 @@ + + + app + Project app created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1729361463958 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/sdl-android-project/app/.settings/org.eclipse.buildship.core.prefs b/sdl-android-project/app/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..b1886ad --- /dev/null +++ b/sdl-android-project/app/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=.. +eclipse.preferences.version=1 diff --git a/sdl-android-project/app/build.gradle b/sdl-android-project/app/build.gradle index bd1fe04..982eb82 100644 --- a/sdl-android-project/app/build.gradle +++ b/sdl-android-project/app/build.gradle @@ -11,6 +11,7 @@ android { buildFeatures { prefab true } + ndkVersion "${project.ndk_version}" if (buildAsApplication) { namespace "com.complecwaft.looper" } diff --git a/sdl-android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java b/sdl-android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java index e7281fd..21a1c1d 100644 --- a/sdl-android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java +++ b/sdl-android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java @@ -277,6 +277,7 @@ public class HIDDeviceManager { 0x044f, // Thrustmaster 0x045e, // Microsoft 0x0738, // Mad Catz + 0x0b05, // ASUS 0x0e6f, // PDP 0x0f0d, // Hori 0x10f5, // Turtle Beach @@ -590,7 +591,13 @@ public class HIDDeviceManager { } else { flags = 0; } - mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), flags)); + if (Build.VERSION.SDK_INT >= 33 /* Android 14.0 (U) */) { + Intent intent = new Intent(HIDDeviceManager.ACTION_USB_PERMISSION); + intent.setPackage(mContext.getPackageName()); + mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, intent, flags)); + } else { + mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), flags)); + } } catch (Exception e) { Log.v(TAG, "Couldn't request permission for USB device " + usbDevice); HIDDeviceOpenResult(deviceID, false); diff --git a/sdl-android-project/app/src/main/java/org/libsdl/app/SDL.java b/sdl-android-project/app/src/main/java/org/libsdl/app/SDL.java index 44c21c1..139be9d 100644 --- a/sdl-android-project/app/src/main/java/org/libsdl/app/SDL.java +++ b/sdl-android-project/app/src/main/java/org/libsdl/app/SDL.java @@ -38,6 +38,10 @@ public class SDL { } public static void loadLibrary(String libraryName) throws UnsatisfiedLinkError, SecurityException, NullPointerException { + loadLibrary(libraryName, mContext); + } + + public static void loadLibrary(String libraryName, Context context) throws UnsatisfiedLinkError, SecurityException, NullPointerException { if (libraryName == null) { throw new NullPointerException("No library name provided."); @@ -53,10 +57,10 @@ public class SDL { // To use ReLinker, just add it as a dependency. For more information, see // https://github.com/KeepSafe/ReLinker for ReLinker's repository. // - Class relinkClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker"); - Class relinkListenerClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener"); - Class contextClass = mContext.getClassLoader().loadClass("android.content.Context"); - Class stringClass = mContext.getClassLoader().loadClass("java.lang.String"); + Class relinkClass = context.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker"); + Class relinkListenerClass = context.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener"); + Class contextClass = context.getClassLoader().loadClass("android.content.Context"); + Class stringClass = context.getClassLoader().loadClass("java.lang.String"); // Get a 'force' instance of the ReLinker, so we can ensure libraries are reinstalled if // they've changed during updates. @@ -66,7 +70,7 @@ public class SDL { // Actually load the library! Method loadMethod = relinkInstanceClass.getDeclaredMethod("loadLibrary", contextClass, stringClass, stringClass, relinkListenerClass); - loadMethod.invoke(relinkInstance, mContext, libraryName, null, null); + loadMethod.invoke(relinkInstance, context, libraryName, null, null); } catch (final Throwable e) { // Fall back diff --git a/sdl-android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/sdl-android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index a5704cd..57aa623 100644 --- a/sdl-android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/sdl-android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh private static final String TAG = "SDL"; private static final int SDL_MAJOR_VERSION = 2; private static final int SDL_MINOR_VERSION = 30; - private static final int SDL_MICRO_VERSION = 2; + private static final int SDL_MICRO_VERSION = 8; /* // Display InputType.SOURCE/CLASS of events and devices // @@ -89,7 +89,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh | InputDevice.SOURCE_CLASS_POSITION | InputDevice.SOURCE_CLASS_TRACKBALL); - if (s2 != 0) cls += "Some_Unkown"; + if (s2 != 0) cls += "Some_Unknown"; s2 = s_copy & InputDevice.SOURCE_ANY; // keep source only, no class; @@ -163,7 +163,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh if (s == FLAG_TAINTED) src += " FLAG_TAINTED"; s2 &= ~FLAG_TAINTED; - if (s2 != 0) src += " Some_Unkown"; + if (s2 != 0) src += " Some_Unknown"; Log.v(TAG, prefix + "int=" + s_copy + " CLASS={" + cls + " } source(s):" + src); } @@ -269,19 +269,19 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh */ protected String[] getLibraries() { return new String[] { - "vgmstream", + "looper", // "SDL2_image", // "SDL2_mixer", // "SDL2_net", // "SDL2_ttf", - "looper" + // "main" }; } // Load the .so public void loadLibraries() { for (String lib : getLibraries()) { - SDL.loadLibrary(lib); + SDL.loadLibrary(lib, this); } } @@ -995,8 +995,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh /* No valid hint, nothing is explicitly allowed */ if (!is_portrait_allowed && !is_landscape_allowed) { if (resizable) { - /* All orientations are allowed */ - req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR; + /* All orientations are allowed, respecting user orientation lock setting */ + req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER; } else { /* Fixed window and nothing specified. Get orientation from w/h of created window */ req = (w > h ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); @@ -1005,8 +1005,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh /* At least one orientation is allowed */ if (resizable) { if (is_portrait_allowed && is_landscape_allowed) { - /* hint allows both landscape and portrait, promote to full sensor */ - req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR; + /* hint allows both landscape and portrait, promote to full user */ + req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER; } else { /* Use the only one allowed "orientation" */ req = (is_landscape_allowed ? orientation_landscape : orientation_portrait); diff --git a/sdl-android-project/gradle.properties b/sdl-android-project/gradle.properties index aac7c9b..3390091 100644 --- a/sdl-android-project/gradle.properties +++ b/sdl-android-project/gradle.properties @@ -10,6 +10,7 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx1536m +ndk_version=27.2.12479018 # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit diff --git a/setup-android-project.sh b/setup-android-project.sh index 246471b..6d81cac 100755 --- a/setup-android-project.sh +++ b/setup-android-project.sh @@ -17,4 +17,7 @@ echo "Android JNI symlink: $ANDROID_JNI_DIR -> $PROJECT_DIR" pushd "${PROJECT_DIR}" [ -d "$ANDROID_JNI_DIR" ] && rm -rf "$ANDROID_JNI_DIR" ln -sf "$PROJECT_DIR" "$ANDROID_JNI_DIR" +rm -rf "${ANDROID_APP_DIR}/src/main/java/org" +cp -r "${PROJECT_DIR}/subprojects/SDL/android-project/app/src/main/java/org" "${ANDROID_APP_DIR}/src/main/java/org" +patch -N "${ANDROID_APP_DIR}/src/main/java/org/libsdl/app/SDLActivity.java" -i "${PROJECT_DIR}/libnames.patch" popd diff --git a/subprojects/SDL b/subprojects/SDL index f461d91..79ec168 160000 --- a/subprojects/SDL +++ b/subprojects/SDL @@ -1 +1 @@ -Subproject commit f461d91cd265d7b9a44b4d472b1df0c0ad2855a0 +Subproject commit 79ec168f3c1e2fe27335cb8886439f7ef676fb49 diff --git a/subprojects/protobuf b/subprojects/protobuf index 439c42c..63def39 160000 --- a/subprojects/protobuf +++ b/subprojects/protobuf @@ -1 +1 @@ -Subproject commit 439c42c735ae1efed57ab7771986f2a3c0b99319 +Subproject commit 63def39e881afa496502d9c410f4ea948e59490d