禁止从手机中导出某预装APK方案

禁止pull文件修改方案:

system/core/adb$ git diff

diff --git a/core/adb/file_sync_service.cpp b/core/adb/file_sync_service.cpp

old mode 100644

new mode 100755

index 1128993..32b8c7b

--- a/core/adb/file_sync_service.cpp

+++ b/core/adb/file_sync_service.cpp

@@ -420,7 +420,11 @@ static bool do_recv(int s, const char* path, std::vector& buffer) {

     if (posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL | POSIX_FADV_NOREUSE) < 0) {

         D("[ Failed to fadvise: %d ]", errno);

     }

-

+    D("pull argv[1] %s",path);

+    if(strstr(path, "system/app") != nullptr){

+               SendSyncFailErrno(s, "pull requires Permission");

+               return false;

+    }   

     syncmsg msg;

     msg.data.id = ID_DATA;

禁止拷贝再导出

external/toybox$ git diff

diff --git a/toybox/toys/posix/cp.c b/toybox/toys/posix/cp.c

old mode 100644

new mode 100755

index d4475a02c..d03717102

--- a/toybox/toys/posix/cp.c

+++ b/toybox/toys/posix/cp.c

@@ -400,6 +400,10 @@ void cp_main(void)

   // Loop through sources

   for (i=0; i

     char *src = toys.optargs[i];

+       if(strstr(src,"system")|| strstr(src,"app")|| strstr(src,"xxxx")||strstr(src,"xxxxxx")){

+                perror_msg("bad '%s'", src);

+                break;

+       }

     int rc = 1;

     if (destdir) TT.destname = xmprintf("%s/%s", destname, basename(src));


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部