fota移植包合入后编译验证提示:File verification failed

logcat提示升级包是一个目录:
05-09 09:48:55.814 1400 12879 D iportFileUtil: getFileMD5, Exception java.io.FileNotFoundException: /data/ota_package/update.zip (Is a directory).(null:168) getMd5ByFile()
05-09 09:48:55.815 1400 12879 W System.err: java.io.FileNotFoundException: /data/ota_package/update.zip (Is a directory)
05-09 09:48:55.815 1400 12879 W System.err: at java.io.FileInputStream.open0(Native Method)
05-09 09:48:55.815 1400 12879 W System.err: at java.io.FileInputStream.open(FileInputStream.java:231)
05-09 09:48:55.815 1400 12879 W System.err: at java.io.FileInputStream.<init>(FileInputStream.java:165)
05-09 09:48:55.815 1400 12879 W System.err: at com.abupdate.iot_libs.utils.FileUtil.getMd5ByFile(Unknown Source:14)
05-09 09:48:55.815 1400 12879 W System.err: at com.abupdate.iot_libs.utils.FileUtil.getMd5ByFile(Unknown Source:11)
05-09 09:48:55.815 1400 12879 W System.err: at com.abupdate.iot_libs.utils.FileUtil.validateFile(Unknown Source:13)
05-09 09:48:55.815 1400 12879 W System.err: at com.abupdate.iot_libs.engine.b.a.a(Unknown Source:390)
05-09 09:48:55.815 1400 12879 W System.err: at com.abupdate.iot_libs.engine.thread.b$g.execute(Unknown Source:15)
05-09 09:48:55.815 1400 12879 W System.err: at com.abupdate.iot_libs.engine.thread.NamedRunnable.run(Unknown Source:17)
05-09 09:48:55.815 1400 12879 W System.err: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
05-09 09:48:55.815 1400 12879 W System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
05-09 09:48:55.815 1400 12879 W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
05-09 09:48:55.815 1400 12879 W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
05-09 09:48:55.815 1400 12879 W System.err: at java.lang.Thread.run(Thread.java:764)
05-09 09:48:55.817 1400 12879 I iportFileUtil: validateFile() falsemd5_file = null md5_net = dde2afb5940242c6cf3e4752b842c359.(null:53) validateFile()
adb shell进去data/ota_package查看,奇怪为啥会变成dir。
通过adb升级的方式验证差分包没问题可以升级。经fota供应商分析是SELinux权限问题。验证setenforce 0后可以成功升级,问题方向可以确认。可随后调试多版对方提供补丁均未成功,只能通过分析log。展锐6152这个平台不清楚为什么avc log不会体现在logcat中,后通过抓ylog发现avc log隐藏在了kernel log中。
029AF <5> [ 67.336971] c2 [05-09 16:22:15.756] audit: type=1400 audit(1746778935.747:43): avc: denied { rmdir } for pid=1408 comm="e.fota_demo_iot" name="update.zip" dev="mmcblk0p40" ino=2156 scontext=u:r:system_app:s0 tcontext=u:object_r:ota_package_file:s0 tclass=dir permissive=0
system/sepolicy/public/system_app.te添加rmdir权限,api目录下对应添加。
...allow system_app ota_package_file:dir { create rename search setattr getattr unlink rmdir };...
编译验证a-b升级成功,继续编译验证b-c版本升级,结果又提示: File verification failed。。继续抓log
006F0 <5> [59160.889123] c1 [05-10 10:54:12.152] audit: type=1400 audit(1746845624.299:44): avc: denied { unlink } for pid=1406 comm="e.fota_demo_iot" name="update.zip" dev="mmcblk0p40" ino=2399 scontext=u:r:system_app:s0 tcontext=u:object_r:ota_package_file:s0 tclass=file permissive=0
添加unlink权限
allow system_app ota_package_file:file { create rename setattr getattr unlink };