local function fullscreen() local window = activity.getWindow() window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN|View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN) return pcall(function() lp = window.getAttributes() lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES--Android P window.setAttributes(lp) end) end --使用该代码可能需要隐藏ActionBar
function toFloatWindowPermission() local intent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION) intent.setData(Uri.parse("package:" .. activity.getPackageName())) activity.startActivityForResult(intent, 0); end
local function canDrawOverlays() if (Build.VERSION.SDK_INT >= 23 and not Settings.canDrawOverlays(this)) then return false elseif Build.VERSION.SDK_INT 23 then return nil else return true end end
function 设置Cookie(context,url,content) CookieSyncManager.createInstance(context) local cookieManager = CookieManager.getInstance() cookieManager.setAcceptCookie(true) cookieManager.removeSessionCookie() cookieManager.removeAllCookie() cookieManager.setCookie(url, content) CookieSyncManager.getInstance().sync() end
function 获取Cookie(url) local cookieManager = CookieManager.getInstance(); return cookieManager.getCookie(url); end
举报 0