修改Android内核输出syscall某些调用日志
想要使用Seccomp 来查看某个apk的syscall日志, 发现apk本身有反Seccomp机制, 设置PR_SET_NO_NEW_PRIVS 就闪退了.后续更无法使用 prctl PR_SET_SECCOMP, SECCOMP_MODE_FILTER
只好从内核层直接输入日志.
烧录内核的步骤主要参考:
https://blog.lleavesg.top/article/pixel5-kernel-build
https://github.com/zhanghecn/luckzh_android_flash_notes/blob/main/doc/note3-kernel/index.md
可以成功烧录内核. 主要的注意点就是: 解压原始boot.img的得到的boot.img-ramdisk.cpio.lz4 并将其放入android-kernel目录中. 再打包重新烧录 boot.img 和vendor_boot.img两个分区即可.
1.取消PR_SET_NO_NEW_PRIVS 设置后status状态值这个修改比较简单, ...
Android 编译 FFMPEG 7.0.2 + x264错误排查.
1.使用android-ndk-r23c来编译FFMPEG 和X264,提示X264找不到.1**ERROR: x264 not found using pkg-config**
参考Chat-gpt 的回答,需要安装pkg-config,并且export PKG_CONFIG_PATH=/xxx/x264
安装后,在命令行里手工验证是ok的.
123ubuntu:/work/ThirdParty/ffmpeg4$ export PKG_CONFIG_PATH=$(pwd)/dist/x264/arm64-v8a/lib/pkgconfig/ubuntu:/work/ThirdParty/ffmpeg4$ pkg-config --exists --print-errors x264ubuntu:/work/ThirdParty/ffmpeg4$
但是编译时仍然报错. 查看FFMPEG的configurate 日志ffbuild/config.log
123456require_pkg_config libx264 x264 std ...
Fatal signal 5 (SIGTRAP), code 1 (TRAP_BRKPT)
在华为手机鸿蒙系统4.2.0上面发现有JNI报错信息:
1234562024-08-14 18:Fatal signal 5 (SIGTRAP), code 1 (TRAP_BRKPT), fault addr 0x7bdd911c30 in tid 3011 (Thread-11), pid 2175 (t.myapplication)2024-08-14 18:Cmdline: com.myapplication2024-08-14 18:pid: 2175, tid: 3011, name: Thread-11 >>> com.myapplication <<<2024-08-14 18: #00 pc 0000000000020c30 /data/app/~~fknWHZgCIhPELEYcOIDVFg==/com.myapplication-kIlrv3njQZh8GuDC_8Qs4w==/lib/arm64/libnativelib.so!libnativelib.so (foo11111(void*, void*)+44) ...
aosp_tangorpro-ap2a-userdebug 编译错误
错误提示如下:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990[ 86% 1602/1858 13m53s remaining] Target userdata fs image: out/target/product/tangorpro/userdata.imgFAILED: out/target/product/tangorpro/userdata.img/bin/bash -c "(mkdir -p out/target/product/tangorpro/data ) && (mkdir -p out/target/product/tangorpro/obj/PACKAGING/userdata_intermediates && rm -rf o ...
Frida 查看函数返回struct 类型的方法
追查某个bug,需要查看这个函数的返回值:
12345678910111213141516171819202122232425262728293031323334353637sp<IBinder> ServiceManager::tryGetService(const std::string& name, bool startIfNotFound) { auto ctx = mAccess->getCallingContext(); sp<IBinder> out; Service* service = nullptr; if (auto it = mNameToService.find(name); it != mNameToService.end()) { service = &(it->second); if (!service->allowIsolated) { uid_t appid = multiuser_ge ...
Warning: Cannot display lunch menu.
aosp源代码更新到android-14.0.0_r29(Build ID:AP1A.240305.019.A1)或更新版本,lunch会失败,
123456789101112tangorpro14$ lunchYou're building on Linux**Warning: Cannot display lunch menu.**Note: You can invoke lunch with an explicit target:usage: lunch [target]Which would you like? [aosp_cf_x86_64_phone-trunk_staging-eng]Pick from common choices above (e.g. 13) or specify your own (e.g. aosp_barbet-trunk_staging-eng):
查看./build/envsetup.sh ,
这个选择列表是有脚本函数get_build_var COMMON_LUNCH_CHOICES来生成,在命令行里执行 ...
Redundant Character Escape '\\/' in RegExp
Redundant Character Escape ‘\/‘ in RegExp正则表达式的转义字符反斜杠 \总是不好理解,因为字符串本身会先转义一次。
上面的Android Studio的经过意思是说在正则表达式中使用 ‘\\/‘ 是多余的,因为字符串 “\\/”转义之后是 \/ ,而正则表达式匹配的时候 \/ 等价于 /
Matching Characters如果需要匹配字符 \ 这两个字符 ,标准的匹配字符串是 “\\\\” ,首先经过字符串的转义,正则表达式使用的才是 \\ 。
因此匹配一个反斜杠和一个正斜杠 \/ 的写法就有两种:
“\\\\/”
“\\\\\\/” 编辑器会提示Redundant Character Escape
Test Program123456789101112131415161718String inputStr=":android\\/data";Pattern PATTERN_BLOCK_PATH = Pattern.compile(& ...