mirror of https://github.com/koreader/koreader
fix #1048
parent
19180e8e70
commit
f2f2833b6a
@ -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")
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit d7dbdb6ad87917a14971ae79a0810bf6c5e29fc9
|
||||
Subproject commit c2589c621c87c0601ca9a58add297b0b7d845e77
|
Loading…
Reference in New Issue