mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
@@ -1,6 +1,28 @@
|
||||
local A = require("android")
|
||||
A.dl.library_path = A.dl.library_path .. ":" .. A.dir .. "/libs"
|
||||
|
||||
-- check uri of the intent that starts this application
|
||||
local file = A.jni:context(A.app.activity.vm, function(JNI)
|
||||
local uri = JNI:callObjectMethod(
|
||||
JNI:callObjectMethod(
|
||||
A.app.activity.clazz,
|
||||
"getIntent",
|
||||
"()Landroid/content/Intent;"
|
||||
),
|
||||
"getData",
|
||||
"()Landroid/net/Uri;"
|
||||
)
|
||||
if uri ~= nil then
|
||||
local path = JNI:callObjectMethod(
|
||||
uri,
|
||||
"getPath",
|
||||
"()Ljava/lang/String;"
|
||||
)
|
||||
return JNI:to_string(path)
|
||||
end
|
||||
end)
|
||||
A.LOGI("intent file path " .. (file or ""))
|
||||
|
||||
-- create fake command-line arguments
|
||||
arg = {"-d", "/sdcard"}
|
||||
arg = {"-d", file or "/sdcard"}
|
||||
dofile(A.dir.."/reader.lua")
|
||||
|
||||
Submodule platform/android/luajit-launcher updated: d7dbdb6ad8...c2589c621c
Reference in New Issue
Block a user