mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-16 16:21:30 +02:00
Harden required import picker for Android 13
This commit is contained in:
@@ -55,4 +55,24 @@ check(not source:find("QuestActivity", 1, true) and
|
||||
not source:find("QuestBridge", 1, true),
|
||||
"generic Android activity must not require Quest classes")
|
||||
|
||||
-- Required mod files use Android's Storage Access Framework, which works with
|
||||
-- Android 13 scoped storage without broad media/storage permissions. Keep the
|
||||
-- native destination distinct so it cannot be consumed as a game ROM.
|
||||
check(source:find('PICKED_REQUIRED_IMPORT_FILENAME = "picked_required_import.bin"',
|
||||
1, true), "required imports use their own Android picker destination")
|
||||
check(source:find("showRequiredImportFilePicker", 1, true),
|
||||
"Android exposes a required-import picker entry point")
|
||||
check(source:find("Intent.ACTION_OPEN_DOCUMENT", 1, true)
|
||||
and source:find("Intent.FLAG_GRANT_READ_URI_PERMISSION", 1, true),
|
||||
"Android 13 uses SAF with an explicit read grant")
|
||||
|
||||
local systemPath = "mobile/android/love/src/jni/love/src/modules/system/System.cpp"
|
||||
local systemFile = assert(io.open(systemPath, "rb"))
|
||||
local system = systemFile:read("*a")
|
||||
systemFile:close()
|
||||
check(system:find('strcmp(kind, "required_import")', 1, true)
|
||||
and system:find('dest = "picked_required_import.bin"', 1, true)
|
||||
and system:find('return "rom,mod,sav,required_import"', 1, true),
|
||||
"native Android bridge advertises and routes required imports")
|
||||
|
||||
print("android_host_extension_test: ok")
|
||||
|
||||
Reference in New Issue
Block a user