Commit Graph
1995 Commits
Author SHA1 Message Date
Henrik Rydgård 9c8a4035ef Buildfix, restore lost check 2026-08-07 11:27:45 +02:00
Henrik Rydgård cac10caed7 Minor cleanup 2026-08-07 10:54:02 +02:00
Henrik Rydgård 30d04b72a6 Refactor sd card detection 2026-08-07 10:54:02 +02:00
Henrik Rydgård eabec15add Alert dialog code cleanup 2026-08-07 10:54:02 +02:00
Henrik Rydgård f62a10b61a Package and library dir cleanup 2026-08-07 10:54:02 +02:00
Henrik Rydgård 092ab42fe7 Clean up ugly usage of the g_nativeLibDir global. Now it's local in VulkanLoader. 2026-08-06 18:12:04 +02:00
Henrik Rydgård 16206d18ab Simplify the EmuThread API again 2026-08-05 09:48:51 +02:00
Henrik Rydgård 905650921e Android hang fix when switching backends, buildfix 2026-08-05 00:59:33 +02:00
Henrik Rydgård 4add25e6c7 Buildfixes, bump gradle 2026-08-05 00:15:56 +02:00
Henrik Rydgård 5eb4772644 Minor EmuThread refactor 2026-08-05 00:15:56 +02:00
Henrik Rydgård be922eca62 Make OpenGL render thread shutdown more robust. 2026-08-04 16:44:55 +02:00
Henrik Rydgård 68ec34ad54 Build and warning fixes 2026-08-03 19:11:07 +02:00
Henrik Rydgård 4d98ff8404 Clean up Android.mk for the unittest 2026-08-03 18:55:33 +02:00
Henrik Rydgård c66e5a26bd Use the gradle NDK version for the legacy Android build and parallelize
The legacy android/jni build (ab.sh / ab.cmd / CI) used an ancient NDK
(r21e) and hardcoded job counts. Update it to the NDK version used by the
gradle build (29.0.14206865) and derive the job count from the available
cores (nproc / NUMBER_OF_PROCESSORS) instead of hardcoding.
2026-08-03 12:00:13 +02:00
Henrik Rydgård b7b96c3374 Fix LZRC decompressor heap overflow and add unit test
The LZRC decompressor's only bounds check for output (and input) was a
debug-only _dbg_assert_msg_, which is a no-op in release builds. The
NPDRM demo block device also passed a hardcoded 1 MiB output length
while the real destination buffer (blockBuf_) could be as small as 2048
bytes, allowing a crafted NPDRM image to trigger an unbounded heap
overflow during game load.

Changes:
- rc_putbyte/rc_getbyte now enforce real bounds and set an error flag
  instead of relying on debug asserts; decompression aborts with -1 on
  overflow or truncated input.
- normalize() reads via rc_getbyte so it stays in bounds.
- Plain-text path clamps the copy size to both the output buffer and the
  remaining input (and no longer interprets the size as signed).
- NPDRMDemoBlockDevice::ReadBlock passes blockSize_ (the real buffer
  size) instead of 0x00100000 to lzrc_decompress.
- Add unittest/TestLzrc (synthetic input, no test data files): checks the
  plain-text clamp, truncated input, and output overflow all fail safely.
- AGENTS.md: note to reuse existing format handlers/decompressors before
  writing new ones.
2026-07-31 20:54:13 +02:00
Henrik Rydgård f3d7d8bc0c Fix Zip Slip in zip extraction and add unit test
A crafted zip with a parent-directory ("..") entry name could escape the
destination directory during extraction, writing arbitrary files on the
host (e.g. into startup/autostart folders). ExtractZipContents built the
output path by concatenating the raw zip entry name onto the destination
with no traversal check.

Changes:
- Add HasParentDirComponent() utility in Core/Util/PathUtil and use it in
  GameManager::ExtractZipContents to reject entries with a ".." component.
  Guard both the directory-creation and file-writing passes.
- Expose ExtractZipContents as public for testing.
- Add unittest/TestZipSlip which crafts a zip with a "../evil.txt" entry
  and verifies it is not written outside the destination directory.
2026-07-31 20:35:12 +02:00
Henrik Rydgård edce05211e Add more logging in onPause 2026-07-30 18:50:32 +02:00
Henrik Rydgård 6bdaf7caee Fix null pointer access in InfraredHelper.java 2026-07-29 14:40:53 +02:00
Henrik Rydgård ccff34b431 Reuse the AndroidJavaGLContext as the new generic OpenGLGraphicsContext 2026-07-26 20:07:14 +02:00
Henrik Rydgård 3784bbe0e6 Delete the AndroidVulkanContext, replace with the generic VulkanGraphicsContext 2026-07-26 19:10:46 +02:00
Henrik Rydgård e3d36e2741 Move the VulkanGraphicsContext to its correct location in Common/GPU/Vulkan 2026-07-26 14:15:15 +02:00
Henrik Rydgård 3eb056ad86 Move Common/GraphicsContext.h to Common/GPU/GraphicsContext.h 2026-07-26 13:58:17 +02:00
Henrik Rydgård 8020b60dda Use the new common RunMainLoop on Android 2026-07-26 13:42:16 +02:00
Henrik Rydgård 29edec7684 Move calling ThreadStart and ThreadEnd into the EmuThread wrapper 2026-07-26 11:54:50 +02:00
Henrik Rydgård ea3a2a2e84 Use the common EmuThread in the Android backend 2026-07-26 11:54:50 +02:00
Henrik Rydgård 7f218acc53 Change the GraphicsContext interface to be more consistent 2026-07-26 10:22:00 +02:00
Henrik Rydgård c2c0fa3634 Remove the AndroidGraphicsContext middle-level class 2026-07-26 10:21:59 +02:00
Henrik Rydgård 85f8715660 Break the circular dependency caused by putting EmuThread in core using an interface 2026-07-24 15:31:42 +02:00
Henrik Rydgård cb1b4067f7 Small optimizations in app-android.cpp 2026-07-24 15:31:42 +02:00
Henrik Rydgård b2c5fdc39f Make EmuThreadFunc match Android's EmuThreadFunc 2026-07-24 15:31:42 +02:00
Henrik Rydgård 02017ad41e Fix name collision between functions 2026-07-24 15:31:42 +02:00
Henrik Rydgård 8b05f703a4 Clean up unused parameters 2026-07-24 15:31:42 +02:00
Henrik Rydgård 906d877019 Android: Remove some state and a race condition 2026-07-24 15:31:42 +02:00
Henrik Rydgård 86c8e9ae68 Minor code cleanup 2026-07-24 15:31:41 +02:00
Henrik Rydgård af7977267e Add NeedsRenderThread property to GraphicsContext 2026-07-24 15:31:41 +02:00
Henrik Rydgård 221aba92da Move EmuThread.cpp/h to Core, in preparation for sharing logic 2026-07-21 12:50:22 +02:00
Henrik Rydgård 16c7ec390f Headless: Start taking logic out of the "HeadlessHost"
Also update some agent files
2026-07-21 11:01:48 +02:00
Henrik Rydgård a59637975a Call the new command line parser from all backends 2026-07-20 12:02:07 +02:00
Henrik Rydgård 29836ea74e Move the new incomplete command line parser to Core 2026-07-20 12:02:07 +02:00
Henrik Rydgård 26313b6314 Log improvements 2026-07-15 12:03:05 +02:00
Henrik Rydgård 993c3a9c67 Avoid accurately computing disk space on iOS and Android (where it can be slow). Add a setting. 2026-07-14 22:22:29 +02:00
Henrik Rydgård 6d98293be9 Hide orientation controls on large Android 17 devices, since they won't work. 2026-06-15 10:37:58 +02:00
Henrik Rydgård 697179c8cd Add some plumbing for the Android 17 local network access permission 2026-06-15 09:45:09 +02:00
Henrik Rydgård b079c5d6ce Minor optimizations in ContentUri.java 2026-06-15 09:44:41 +02:00
Henrik Rydgård ab1975e3ba build.gradle.kts cleanup 2026-06-15 09:17:13 +02:00
Henrik Rydgård e0634f3df9 Assorted cleanup and tweaks 2026-06-13 13:34:41 +02:00
Henrik Rydgård 8fe3dcdb83 Android: Allow clipdata as input for the file browser.
Fixes #18874
2026-06-06 14:12:57 +02:00
Henrik Rydgård 3ba732d26f Android: Change target SDK to 37 (Android 17) 2026-06-05 21:07:29 +02:00
Henrik Rydgård 01d65ada40 Merge pull request #21760 from misantronic/feature/achievementshost-cli-override
Android: add achievements host override receiver
2026-06-01 11:05:22 +02:00
david.schkalee d477afa9b2 Android: add achievements host override receiver 2026-06-01 01:44:04 +02:00