Skip to content

Commit

Permalink
8.10 auto-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rev1si0n committed Mar 2, 2025
1 parent 1728177 commit a234533
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
8.10
* 优化自恢复逻辑
* 优化触控兼容性

8.9
* 修复解析错误

Expand Down
2 changes: 1 addition & 1 deletion lamda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#
# Distributed under MIT license.
# See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
__version__ = "8.9"
__version__ = "8.10"
5 changes: 5 additions & 0 deletions properties.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ cert=TEFNREEgU1NMIENFUlRJRklDQVRFIChDTj10ZXN0LFBBU1NXRD1hMWMwZTNlYTcwN2E1NGRlN2E
# the certificate (for easier memorization).
ssl-web-credential=password123

# Set Access-Control-Allow-Origin header of firerpa webui
# and it's apis to allow you embed firerpa's features
# see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
allow_origin=https://example.com

# Setting this option will also disable the LAMDA Python client API.
# This option should be set only if the device crashes after starting LAMDA,
# or if you do not need to use the API. This option will also disable
Expand Down
60 changes: 60 additions & 0 deletions tools/ida.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env python3
#encoding=utf-8
import os
import sys
import time
import argparse
import subprocess

from shlex import split as s
from lamda.client import *

certfile = os.environ.get("CERTIFICATE", None)
port = int(os.environ.get("PORT", 65000))

argp = argparse.ArgumentParser()
argp.add_argument("-d", type=str, required=True)
argp.add_argument("-a", type=str, required=True)
args = argp.parse_args()

certfile = os.environ.get("CERTIFICATE", None)
d = Device(args.d, certificate=certfile)

app = d.application(args.a)
d.start_activity(**app.query_launch_activity(), debug=True)
print (time.ctime(), "{} is started as debuggable mode".format(args.a))
print (time.ctime(), "Waitting for 'Waitting For Debugger' popup")
if not d(textContains="Waiting").wait_for_exists(25*1000):
print (time.ctime(), "No debugger prompt detected, please ensure "\
"you already run 'setdebuggable' in firerpa terminal." )
exit (1)

pName = app.info().processName
processes = d.enumerate_running_processes()
p = list(filter(lambda p: p.processName == pName,
processes))[0]
print (time.ctime(), "Found pid: {}".format(p.pid))
# Build forward cmd
print (time.ctime(), "Forwarding jwdp pid")
cmd = s("adb forward tcp:8700 jdwp:%s" % p.pid)
forward = subprocess.Popen(cmd, stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
shell=False)
forward.wait()

print (time.ctime(), "--------------------------------")
print (time.ctime(), "Now please use your IDA to attach this target")
print (time.ctime(), "name: {} pid: {}".format(pName, p.pid))
print (time.ctime(), "and wait for IDA 'Downloading symbols' to finish")
print (time.ctime(), "when all is finished, press ENTER to continue")
print (time.ctime(), "--------------------------------")

_ = input()

cmd = s("jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8700")
debug = subprocess.Popen(cmd, stdin=sys.stdin,
stdout=sys.stdout,
stderr=sys.stderr,
bufsize=0,
shell=False)
debug.wait()

0 comments on commit a234533

Please sign in to comment.