安卓不再每次启动时复制动态库文件
This commit is contained in:
@@ -9,29 +9,34 @@ return function(name,libName)
|
||||
elseif SYSTEM=="Android"then
|
||||
local fs=love.filesystem
|
||||
local platform={"arm64-v8a","armeabi-v7a"}
|
||||
local libFunc
|
||||
for i=1,#platform do
|
||||
local soFile,size=fs.read("data","libAndroid/"..platform[i].."/"..libName.Android)
|
||||
if soFile then
|
||||
local success,message=fs.write(libName.Android,soFile,size)
|
||||
if success then
|
||||
libFunc,message=package.loadlib(table.concat({SAVEDIR,libName.Android},"/"),libName.libFunc)
|
||||
if libFunc then
|
||||
LOG.print(name.." lib loaded","warn",COLOR.G)
|
||||
break
|
||||
|
||||
local libFunc=package.loadlib(SAVEDIR.."/lib/"..libName.Android,libName.libFunc)
|
||||
if libFunc then
|
||||
LOG.print(name.." lib loaded","warn",COLOR.G)
|
||||
else
|
||||
for i=1,#platform do
|
||||
local soFile=fs.read("data","libAndroid/"..platform[i].."/"..libName.Android)
|
||||
if soFile then
|
||||
local success,message=fs.write("lib/"..libName.Android,soFile)
|
||||
if success then
|
||||
libFunc,message=package.loadlib(SAVEDIR.."/lib/"..libName.Android,libName.libFunc)
|
||||
if libFunc then
|
||||
LOG.print(name.." lib loaded","warn",COLOR.G)
|
||||
break
|
||||
else
|
||||
LOG.print("Cannot load "..name..": "..message,"warn",COLOR.R)
|
||||
end
|
||||
else
|
||||
LOG.print("Cannot load "..name..": "..message,"warn",COLOR.R)
|
||||
LOG.print("Write "..name.."-"..platform[i].." to saving failed: "..message,"warn",COLOR.R)
|
||||
end
|
||||
else
|
||||
LOG.print("Write "..name.."-"..platform[i].." to saving failed: "..message,"warn",COLOR.R)
|
||||
LOG.print("Read "..name.."-"..platform[i].." failed","warn",COLOR.R)
|
||||
end
|
||||
else
|
||||
LOG.print("Read "..name.."-"..platform[i].." failed","warn",COLOR.R)
|
||||
end
|
||||
end
|
||||
if not libFunc then
|
||||
LOG.print("Cannot load "..name,"warn",COLOR.R)
|
||||
return
|
||||
if not libFunc then
|
||||
LOG.print("Cannot load "..name,"warn",COLOR.R)
|
||||
return
|
||||
end
|
||||
end
|
||||
return libFunc()
|
||||
else
|
||||
|
||||
6
main.lua
6
main.lua
@@ -41,7 +41,7 @@ for _,name in next,fs.getDirectoryItems("")do
|
||||
end
|
||||
|
||||
--Create directories
|
||||
for _,v in next,{"conf","record","replay","cache"}do
|
||||
for _,v in next,{"conf","record","replay","cache","lib"}do
|
||||
local info=fs.getInfo(v)
|
||||
if not info then
|
||||
fs.createDirectory(v)
|
||||
@@ -268,6 +268,10 @@ do
|
||||
needSave=true
|
||||
autoRestart=true
|
||||
end
|
||||
if STAT.version<1405 then
|
||||
fs.remove("conf/user")
|
||||
autoRestart=true
|
||||
end
|
||||
|
||||
for _,v in next,VK_org do
|
||||
if not v.color then
|
||||
|
||||
Reference in New Issue
Block a user