长时间不开机的机器可能会发生时间错位问题 需要用adb进行时间校准
1 2 3
| adb shell date "YYYY-MM-DD HH:MM:SS"
|
把所有闹钟都关闭 防止关了机又打开 或者在脚本操作控制的时候出问题
建议使用云手机平台(搜索:开源云手机),虚拟手机,方便进行环境打包和重新部署。
redroid supports adb connection, and is a docker image
redroid-doc and redroid tutorial
lamda is a multi-source (simulator and real device support) android controlling, network capturing and reverse engineering platform
lamda wiki
如果adb出现连接问题,可以重启adb服务
usb硬件出问题一般是因为供电不足,或者连接线接触不良。所以可以加强供电,以及更换更好的连接线。
1 2 3
| adb kill-server adb start-server
|
Read More
com.github.kr328.clipboard.ClipboardProxy.getPrimaryClip
Magisk Module:
Riru - Clipboard Whitelist
will white list clipboard manager app.
https://github.com/Kr328/Riru-ClipboardWhitelist
https://t.me/kr328_riru_modules
script.sh:
1 2
| scrcpy -K -S 2>&1 | python3 reader.py
|
reader.py:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| import os import subprocess import re class Response(object): status = None data = None def parseResponse(resultString): response = re.findall(r"^Broadcasting: Intent { flg=0x400000 cmp=ch.pete.adbclipboard/.ReadReceiver }\nBroadcast completed: result=-1, data=\"((.*\n?)+)\"$",resultString)[0][0] return response def readFromDevice(): adbProcess = subprocess.Popen( ['adb', 'shell', 'am', 'broadcast', '-n', 'ch.pete.adbclipboard/.ReadReceiver'], stdout=subprocess.PIPE) resultString = adbProcess.communicate()[0] print("read device response:\n{}" .format(resultString)) try: result = parseResponse(resultString.decode("utf-8")) print("raw:\n",resultString) print("result:\n",result) return result except: traceback.print_exc() return def setClipboard(data): with open("target.out","w+",encoding="utf-8") as f: f.write(data) fetch_clipboard = "cat target.out | xclip -selection c" os.system(fetch_clipboard) while True: content = input() print("CONTENT:",content) if "Calling uid 0 does not own package com.android.shell" in content: print("!!!!!!!!!!ERROR FETCHING CLIPBOARD!!!!!!!!!!") data = readFromDevice() if data is not None: setClipboard(data)
|
Read More
grant permission for termux:api
android.permission.WRITE_SETTINGS can only be granted in settings tab.
https://github.com/TilesOrganization/support/wiki/How-to-use-ADB-to-grant-permissions
adb shell pm grant com.rascarlo.quick.settings.tiles android.permission.WRITE_SECURE_SETTINGS
pm grant com.termux.api android.permission.WRITE_SECURE_SETTINGS
pm list packages
the brightness bug is solved by uninstalling the unintended settings app. i don’t know if this will cause more problems.
to remove termux banner/ termux welcome message:
1 2
| cd .. && cd usr/etc && rm -rf motd
|
Read More