local resourceName = "test-download" _webResources:afterDownload(function(webResource, scriptFile, throwable) if (webResource:getName() == resourceName) then if (scriptFile ~= nil) then _console:log("afterDownload", webResource, "下载成功", scriptFile) elseif (throwable ~= nil) then _console:error("afterDownload", webResource, "下载失败", throwable) end end end) _webResources:beforeDownload(function(webResource) if (webResource:getName() == resourceName) then local RegexUtils = _java:loadClass("com.blankj.utilcode.util.RegexUtils") webResource:setUrl(RegexUtils:getReplaceFirst(webResource:getUrl(), "172.16.0.238", "172.16.0.235")) _console:log("beforeDownload", webResource) end return nil end) _webResources:download(function(webResource) webResource:setName(resourceName) webResource:setUrl("https://github.com/m8test/runtime-release/raw/refs/heads/main/frameworks/android-34.jar") webResource:setVersion("34") end)