import('java.lang.*')
import('android.content.Context')
import('com.nx.assist.lua.LuaEngine')
function getAppName()
local ctx = LuaEngine.getContext()
local pkgmgr = ctx.getPackageManager()
local applicationInfo = pkgmgr.getApplicationInfo(ctx.getPackageName(), 0);
local name = pkgmgr.getApplicationLabel(applicationInfo);
return name
end
print(getAppName())
获取当前脚本的名称
获取当前脚本的名字
|