mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Add the possibility run shell scripts from filemanager on android (#6288)
This commit is contained in:
@@ -5,6 +5,7 @@ local ffi = require("ffi")
|
||||
local C = ffi.C
|
||||
local lfs = require("libs/libkoreader-lfs")
|
||||
local logger = require("logger")
|
||||
local util = require("util")
|
||||
local _ = require("gettext")
|
||||
local T = require("ffi/util").template
|
||||
|
||||
@@ -349,6 +350,13 @@ function Device:exit()
|
||||
android.lib.ANativeActivity_finish(android.app.activity)
|
||||
end
|
||||
|
||||
function Device:canExecuteScript(file)
|
||||
local file_ext = string.lower(util.getFileNameSuffix(file))
|
||||
if android.prop.flavor ~= "fdroid" and file_ext == "sh" then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
android.LOGI(string.format("Android %s - %s (API %d) - flavor: %s",
|
||||
android.prop.version, getCodename(), Device.firmware_rev, android.prop.flavor))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user