开发平台基本信息
芯片: QCM6125
版本: Android 13
kernel: msm-4.14
问题描述
有个自己添加的服务需要引用第三方jar库支持,而在安卓13的编译规则里面,jar解包出来的类名都必须是至少包含一个字母大写的,不然就抛出异常编译出错;模块厂商给的建议是找厂家重新适配安卓13的jar包,但是,像一些开源的jar包,不可能去做兼容,既然是编译规则引发的错误,那么就修改编译规则。
问题分析
FAILED: out/soong/hiddenapi/hiddenapi-stub-flags.txt.valid
out/host/linux-x86/bin/verify_overlaps --monolithic-flags out/soong/hiddenapi/hiddenapi-stub-flags.txt --module-flags
Traceback (most recent call last):
File “/home/hongxb/data/SC665S_Android13.0_r04_r020/QSSI.13/out/host/linux x86/bin/verify_overlaps/internal/stdlib/runpy.py”, line 196, in _run_module_as_main
…
…File “/home/hongxb/data/SC665S_Android13.0_r04_r020/QSSI.13/out/host/linux-> x86/bin/verify_overlaps/signature_trie.py”, line 154, in signature_to_elements
Exception: Invalid signature ‘Lcom/esc/a;->a(Ljava/lang/String;)[B’: last element ‘a’ is lower case but should be an upper case class name or wildcard
从报错日志的最后一句话可以看出来,解包jar的类名为a,应该是混淆导致的,而编译规则要求必须为大写,一般编译规则都在build
目录下,所以到该目录底下搜索错误日志相关的信息。
hongxb@R720-0-19:~/data5/SC665S_Android13.0_r04_r020/QSSI.13/build$ grep -rn "Invalid signature"
soong/scripts/hiddenapi/verify_overlaps_test.py:214: "Invalid signature: Ljava/lang/Object, "
soong/scripts/hiddenapi/signature_trie.py: