Open tkkcc opened 1 month ago
we use git protocol to do this for its atomic and free hosting. jgit is very small, total dex 1M, while git2 need 6.1M * 2 with vendored ssl, and we have to disable ssl check. another lib to try is gitoxide
should stick with shizuku and libsu. These two share common functionality (the shell user permission).
benefits:
drawbacks:
should stick with wasm, benefits:
drawbacks:
market / billing / online device limitation
different from ascript: total free if the plugin doesn't use our server. free to make standalone app. 1% billing for using our service.
different from lanren: better local ocr and captcha bypass
GameBot is designed to work for years without human operations. GameBot should be self upgradable, because mobile games iterating fast. GameBot relies on AccessibilityService and MediaProjection, and use hidden api via HiddenApiRefinePlugin, and gain permission via Shizuku and libsu
plugin / hot update / hot fix / code push / dynamic loading / scripting
plain DexClassLoader/PathClassLoader
host apk --DexClassLoader/PathClassLoader--> plugin apk/jar/dex
compile andorid library into dex and load via DexClassLoader, the drawback is all dependencies must be bundled into host apk, library can't add new dependencies, and host apk almost can't use r8. library's resource can't be simply load, but kotlin i18n solutions can be used, like lyricist. fat jar solutions may help, like shadow
compile andrlid application into apk and load via PathClassLoader, this is what mediabox does. plugin can use new dependencies, but r8 almost unusable.
Shadow / Tinker
hacky and complicated, may be try BlackShadow
above two solutions violate google play policy:
flutter
shorebird
react native
react-native-code-push
above two solutions is complicated as GameBot need deep integration with android system api, so we need to export java/kotlin function into dart and js. we also need to ship their runtime library. can use rich ui component. flutter doesn't support x86. react native does't support 120fps
js embedded
rhino, used in autojs and it's forks nodejs, used in autojs boa quickjs deno
python embedded
jython chaquopy rustpython, compilable but runtime exception
lua embedded luajava mlua
wasm embedded wasmtime wasmer
above solutions are simpler and safer, but we need to export java/kotlin function into vm, if using compose instead of view, we need to implement some kind of serializable data structure. we need to transfer image byte into vm efficiently. first three solutions have zero compile time, but need to struggle with dynamic typing. for wasm, we can use rust, but have to drop support for 32 bit platforms.
lib size for x86_64:
simplar projects
kotlin/java: FGA, granblue, RobotHelper js: hamibot, autojs6, autox, 自动精灵, EasyClick, 冰狐, aibote, 云控, aiwork lua: 懒人精灵, 节点精灵, 触动精灵, 触摸精灵, 积木编程, 鱼叉助手, 飞天助手, 叉叉助手, autolua python: ascript, aibote, 小派精灵 VBScript/Q: 按键精灵 rpa: 影刀, UiBot, ...