|
|
@ -10,25 +10,7 @@ ffi.cdef[[
|
|
|
|
]]
|
|
|
|
]]
|
|
|
|
|
|
|
|
|
|
|
|
-- check uri of the intent that starts this application
|
|
|
|
-- check uri of the intent that starts this application
|
|
|
|
local file = A.jni:context(A.app.activity.vm, function(JNI)
|
|
|
|
local file = A.getIntent()
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if file ~= nil then
|
|
|
|
if file ~= nil then
|
|
|
|
A.LOGI("intent file path " .. file)
|
|
|
|
A.LOGI("intent file path " .. file)
|
|
|
|