sudo deepin-editor android.iml
在源码的根目录创建start_emulator.sh脚本,为了方便的启动模拟器,输入以下内容 后执行
在系统源码找到ActivityStarter这个类,在startActivityMayWait这个方法打断点
点击菜单的Run–>Attach Debugger to Android Process,勾选Show all processer,选择system_process 随便启动app 触发断点
gdbclient.py -p 6018 --setup-forwarding vscode
执行之后 vscode 附加 发现链接失败时
source build
/
envsetup.sh
lunch
22
mmm development
/
tools
/
idegen
sudo development
/
tools
/
idegen
/
idegen.sh
sudo chmod
777
android.iml
sudo chmod
777
android.ipr
source build
/
envsetup.sh
lunch
22
mmm development
/
tools
/
idegen
sudo development
/
tools
/
idegen
/
idegen.sh
sudo chmod
777
android.iml
sudo chmod
777
android.ipr
<excludeFolder url
=
"file://$MODULE_DIR$/bionic"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/bootable"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/build"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/cts"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/dalvik"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/developers"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/development"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/device"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/docs"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/external"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/hardware"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/kernel"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/out"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/pdk"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/platform_testing"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/prebuilts"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/sdk"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/system"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/test"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/toolchain"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/tools"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/.repo"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/bionic"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/bootable"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/build"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/cts"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/dalvik"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/developers"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/development"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/device"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/docs"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/external"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/hardware"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/kernel"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/out"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/pdk"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/platform_testing"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/prebuilts"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/sdk"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/system"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/test"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/toolchain"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/tools"
/
>
<excludeFolder url
=
"file://$MODULE_DIR$/.repo"
/
>
代号 |
版本 |
API 级别/NDK 版本 |
Android13 |
13 |
API 级别 33 |
Android12L |
12 |
API 级别 32 |
Android12 |
12 |
API 级别 31 |
Android11 |
11 |
API 级别 30 |
Android10 |
10 |
API 级别 29 |
Pie |
9 |
API 级别 28 |
Oreo |
8.1.0 |
API 级别 27 |
Oreo |
8.0.0 |
API 级别 26 |
Nougat |
7.1 |
API 级别 25 |
Nougat |
7.0 |
API 级别 24 |
Marshmallow |
6.0 |
API 级别 23 |
/
android
/
android
/
android
-
10.0
.
0_r2
/
frameworks
/
base
/
core
/
res
/
AndroidManifest.xml
/
android
/
android
/
android
-
10.0
.
0_r2
/
frameworks
/
base
/
core
/
res
/
res
/
android
/
android
/
android
-
10.0
.
0_r2
/
frameworks
/
base
/
core
/
res
/
assets
/
android
/
android
/
android
-
10.0
.
0_r2
/
frameworks
/
base
/
core
/
res
/
AndroidManifest.xml
/
android
/
android
/
android
-
10.0
.
0_r2
/
frameworks
/
base
/
core
/
res
/
res
/
android
/
android
/
android
-
10.0
.
0_r2
/
frameworks
/
base
/
core
/
res
/
assets
source build
/
envsetup.sh
lunch
6
emulator
source build
/
envsetup.sh
lunch
6
emulator
adb shell am
set
-
debug
-
app
-
w com.example.dexlassloaders
adb shell am
set
-
debug
-
app
-
w com.example.dexlassloaders
cd
/
android
/
android
/
android
-
10.0
.
0_r2
source build
/
envsetup.sh
lunch
22
cd development
/
scripts
adb shell am
set
-
debug
-
app
-
w com.example.dexlassloaders
adb shell am start
-
D
-
n com.example.dexlassloaders
/
.MainActivity
adb shell
"ps -ef | grep com.example.dexlassloaders"
gdbclient.py
-
p
6018
-
-
setup
-
forwarding vscode
adb forward tcp:
12345
jdwp:
6018
jdb
-
attach localhost:
12345
cd
/
android
/
android
/
android
-
10.0
.
0_r2
source build
/
envsetup.sh
lunch
22
cd development
/
scripts
adb shell am
set
-
debug
-
app
-
w com.example.dexlassloaders
adb shell am start
-
D
-
n com.example.dexlassloaders
/
.MainActivity
adb shell
"ps -ef | grep com.example.dexlassloaders"
gdbclient.py
-
p
6018
-
-
setup
-
forwarding vscode
adb forward tcp:
12345
jdwp:
6018
jdb
-
attach localhost:
12345
{
"configurations"
: [
/
/
{} 复制到这里
{
"miDebuggerPath"
:
"/android/android/android-10.0.0_r2/prebuilts/gdb/linux-x86/bin/gdb"
,
"program"
:
"/android/android/android-10.0.0_r2/out/target/product/generic_x86_64/symbols/system/bin/app_process64"
,
"setupCommands"
: [
{
"text"
:
"-enable-pretty-printing"
,
"description"
:
"Enable pretty-printing for gdb"
,
"ignoreFailures"
: true
},
{
"text"
:
"-environment-directory /android/android/android-10.0.0_r2"
,
"description"
:
"gdb command: dir"
,
"ignoreFailures"
: false
},
{
"text"
:
"-gdb-set solib-search-path /android/android/android-10.0.0_r2/out/target/product/generic_x86_64/symbols/system/lib64/:/android/android/android-10.0.0_r2/out/target/product/generic_x86_64/symbols/system/lib64/hw:/android/android/android-10.0.0_r2/out/target/product/generic_x86_64/symbols/system/lib64/ssl/engines:/android/android/android-10.0.0_r2/out/target/product/generic_x86_64/symbols/system/lib64/drm:/android/android/android-10.0.0_r2/out/target/product/generic_x86_64/symbols/system/lib64/egl:/android/android/android-10.0.0_r2/out/target/product/generic_x86_64/symbols/system/lib64/soundfx:/android/android/android-10.0.0_r2/out/target/product/generic_x86_64/symbols/vendor/lib64/:/android/android/android-10.0.0_r2/out/target/product/generic_x86_64/symbols/vendor/lib64/hw:/android/android/android-10.0.0_r2/out/target/product/generic_x86_64/symbols/vendor/lib64/egl"
,
"description"
:
"gdb command: set solib-search-path"
,
"ignoreFailures"
: false
},
{
"text"
:
"-gdb-set solib-absolute-prefix /android/android/android-10.0.0_r2/out/target/product/generic_x86_64/symbols"
,
"description"
:
"gdb command: set solib-absolute-prefix"
,
"ignoreFailures"
: false
},
{
"text"
:
"-interpreter-exec console \"source /android/android/android-10.0.0_r2/development/scripts/gdb/dalvik.gdb\""
,
"description"
:
"gdb command: source art commands"
,
"ignoreFailures"
: false
}
],
"name"
:
"(gdbclient.py) Attach app_process64 (port: 5039)"
,
"miDebuggerServerAddress"
:
"localhost:5039"
,
"request"
:
"launch"
,
"type"
:
"cppdbg"
,
"cwd"
:
"/android/android/android-10.0.0_r2"
,
"MIMode"
:
"gdb"
}
]
}
{
"configurations"
: [
/
/
{} 复制到这里
{
"miDebuggerPath"
:
"/android/android/android-10.0.0_r2/prebuilts/gdb/linux-x86/bin/gdb"
,
"program"
:
"/android/android/android-10.0.0_r2/out/target/product/generic_x86_64/symbols/system/bin/app_process64"
,
"setupCommands"
: [
{
"text"
:
"-enable-pretty-printing"
,
"description"
:
"Enable pretty-printing for gdb"
,
"ignoreFailures"
: true
},
{
"text"
:
"-environment-directory /android/android/android-10.0.0_r2"
,
"description"
:
"gdb command: dir"
,
"ignoreFailures"
: false
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)
最后于 2022-11-21 22:38
被iyue_t编辑
,原因: 板块不对