代码拉取完成,页面将自动刷新
require("Fun")
require("HttpUtil")
require("assign")
local sz = require("sz")
local json = sz.json--使用JSON 模块前必须插入这一句
--[[
version: 1.0.1
author:lancy
date:2017年11月26日
PS:
需要配置config.lua中模拟精灵悬浮按钮的位置
需要引用 触动精灵扩展库 sz.so
]]
require("config")
require("Fun")
czero={};
czero.PACKAGE_NAME="com.hms.jingling"; -- 模拟精灵包名
--[[
检查模拟精灵是否运行,如果未运行则启动
--]]
local function runEx()
local isRunFlag = Fun.app.isRunning(czero.PACKAGE_NAME);
if(isRunFlag==0) then
Fun.app.run(czero.PACKAGE_NAME);
Fun.sleep(1000*5);
else
Fun.app.close(czero.PACKAGE_NAME);
Fun.app.run(czero.PACKAGE_NAME);
Fun.sleep(1000*5);
end
end
function czero.mock(app_store_pkg)
local inParam='{"apps":[{"pkg_name":"'..app_store_pkg..'","setting":{"cache_clean":true,"root_intercept":true}}]}'
--toast(inParam,1)
local httputil = HttpUtil()
local url = "http://127.0.0.1:1437/hook"
local res,code = httputil.httpPost(url,inParam)
--toast(res,1)
if code ~= 200 then
runEx()
return false,data;
end
local data = json.decode(res);
if(data==nil or data.code ~=20001) then
runEx()
return false,data;
end
return true,data.data;
end
function test(...)
while (true) do
local flag,data=czero.mock('com.tencent.android.qqdownloader');
if(flag) then
toast("模拟成功"..data.brand,1)
else
toast("模拟失败",1)
end
mSleep(1000*5)
end
end
--test();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。