1 Star 0 Fork 10

maktom/udbg

forked from udbg/udbg 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
__udbg__.lua 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
元虫 提交于 2021-10-26 18:42 . impr: basic *nix support
require 'udbg.lua'
require 'udbg.core'
require 'udbg.service'
class = require 'class'
ui = require 'udbg.ui'
__llua_error = log.error
ucmd = require 'udbg.cmd'
ucmd.prefix = 'udbg.command.'
uevent = require 'udbg.event'
uevent.error = ui.error
local lapp = require 'pl.lapp'
lapp.add_type('address', function(s)
return assert(udbg.target:eval_address(s), 'invalid address expression')
end)
require 'udbg.util'
require 'udbg.luadebug'.add(INIT_COROUTINES)
---@type table<string, UDbgEngine>
udbg.engine = setmetatable({}, {
__newindex = function(self, key, val)
if type(key) == "string" then
if not table.find(self, key) then
table.insert(self, key)
end
end
rawset(self, key, val)
end,
})
udbg.set('service', require 'udbg.service')
local device = {os = os.name, arch = os.arch, udbg_version = udbg.version}
-- https://docs.rs/machine-uid/0.2.0/machine_uid/
if os.name == 'windows' then
local reg = require 'win.reg'
device.id = reg.HKEY_LOCAL_MACHINE:open [[SOFTWARE\Microsoft\Cryptography]]:get 'MachineGuid'
elseif os.name == 'android' then
device.id = 'android-' .. io.popen 'getprop ro.serialno':read 'a':trim()
else
local mid = readfile '/etc/machine-id' or readfile '/var/lib/dbus/machine-id'
device.id = mid and mid:trim() or select(2, io.popen 'uname -a':read 'a':splitv '%s+')
end
__ui_data_dir = ui.session:request('ui_info', device)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zaixiabeiming/udbg.git
git@gitee.com:zaixiabeiming/udbg.git
zaixiabeiming
udbg
udbg
master

搜索帮助