@@ -403,37 +403,6 @@ int rm_dex(const char *path)
403403 }
404404}
405405
406- int protect (char * pkgname , gid_t gid )
407- {
408- struct stat s ;
409- char pkgpath [PKG_PATH_MAX ];
410-
411- if (gid < AID_SYSTEM ) return -1 ;
412-
413- if (create_pkg_path_in_dir (pkgpath , & android_app_private_dir , pkgname , ".apk" ))
414- return -1 ;
415-
416- if (stat (pkgpath , & s ) < 0 ) return -1 ;
417-
418- if (chown (pkgpath , s .st_uid , gid ) < 0 ) {
419- ALOGE ("failed to chgrp '%s': %s\n" , pkgpath , strerror (errno ));
420- return -1 ;
421- }
422- if (chmod (pkgpath , S_IRUSR |S_IWUSR |S_IRGRP ) < 0 ) {
423- ALOGE ("protect(): failed to chmod '%s': %s\n" , pkgpath , strerror (errno ));
424- return -1 ;
425- }
426-
427- #ifdef HAVE_SELINUX
428- if (selinux_android_setfilecon (pkgpath , pkgname , s .st_uid ) < 0 ) {
429- ALOGE ("cannot setfilecon dir '%s': %s\n" , pkgpath , strerror (errno ));
430- return -1 ;
431- }
432- #endif
433-
434- return 0 ;
435- }
436-
437406int get_size (const char * pkgname , int persona , const char * apkpath ,
438407 const char * fwdlock_apkpath , const char * asecpath ,
439408 int64_t * _codesize , int64_t * _datasize , int64_t * _cachesize ,
0 commit comments