Android CTS,应用安全测试 - 私有数据

Android CTS, app security test - private data

我几乎是一个新手 Android 开发人员,正在与 CTS 作斗争。 (我正在使用 kitkat.. 是的,它有点旧了...)

我在 testAppFailAccessPrivateData 遇到了一个关于 com.android.cts.appsecurity.AppSecurityTests 的问题,如下所示..

似乎CTS测试应用程序(com.android.cts.appwithdata)在xt_qtaguid,

中找不到它自己的流量数据

我还能做些什么来解决这个问题??我可以为配额添加一些必要的模块吗?

有人请帮助我.. 我试图在网上找到有关此问题的信息,但我失败了..

有没有像我这样的 android CTS 初学者的网站或社区??

logcat :

E/memtrack(26467): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug(26467): failed to load memtrack module: -2
D/AndroidRuntime(26467): Calling main entry com.android.commands.am.Am
I/ActivityManager( 1145): Force stopping com.android.cts.appwithdata appid=10612 user=0: start instr
I/ActivityManager( 1145): Start proc com.android.cts.appwithdata for added application com.android.cts.appwithdata: pid=26476 uid=10612 gids={50612, 3003}
I/TestRunner(26476): started: testCreatePrivateData(com.android.cts.appwithdata.CreatePrivateDataTest)
I/TestRunner(26476): failed: testCreatePrivateData(com.android.cts.appwithdata.CreatePrivateDataTest)
I/TestRunner(26476): ----- begin exception -----
I/TestRunner(26476): 
I/TestRunner(26476): junit.framework.AssertionFailedError: Was expecting to find own traffic stats
I/TestRunner(26476):    at junit.framework.Assert.fail(Assert.java:50)
I/TestRunner(26476):    at junit.framework.Assert.assertTrue(Assert.java:20)
I/TestRunner(26476):    at com.android.cts.appwithdata.CreatePrivateDataTest.accessOwnTrafficStats(CreatePrivateDataTest.java:195)
I/TestRunner(26476):    at com.android.cts.appwithdata.CreatePrivateDataTest.createTrafficStatsWithTags(CreatePrivateDataTest.java:243)
I/TestRunner(26476):    at com.android.cts.appwithdata.CreatePrivateDataTest.testCreatePrivateData(CreatePrivateDataTest.java:93)

and adb shell :/proc/net/xt_qtaguid # cat stats 

idx iface acct_tag_hex uid_tag_int cnt_set rx_bytes rx_packets tx_bytes tx_packets rx_tcp_bytes rx_tcp_packets rx_udp_bytes rx_udp_packets rx_other_bytes rx_other_packets tx_tcp_bytes tx_tcp_packets tx_udp_bytes tx_udp_packets tx_other_bytes tx_other_packets
2 usb0 0x0 0 0 0 0 441054 5264 0 0 0 0 0 0 24814 308 0 0 416240 4956
3 usb0 0x0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4 lo 0x0 0 0 0 0 2968 43 0 0 0 0 0 0 744 18 0 0 2224 25
5 lo 0x0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
adbshell :/proc/net/xt_qtaguid # 

谢谢! 金智勋.

这是改编自 Android gerrit 的修复程序:

https://android-review.googlesource.com/#/c/269115/1/net/netfilter/xt_qtaguid.c

我在通过 TCP 连接 adb 时也遇到了问题,因为测试只查看相关进程的 rx/tx 字节差异和其中的 adb 数据计数。