File tree Expand file tree Collapse file tree 1 file changed +4
-19
lines changed
Expand file tree Collapse file tree 1 file changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -41,26 +41,11 @@ pub fn is_ipa_file(bytes: &[u8]) -> Result<bool> {
4141 let cursor = std:: io:: Cursor :: new ( bytes) ;
4242 let mut archive = zip:: ZipArchive :: new ( cursor) ?;
4343
44- // IPA files must contain a Payload/ directory with a .app bundle inside
45- let mut has_payload = false ;
46- let mut has_app_in_payload = false ;
47-
48- for i in 0 ..archive. len ( ) {
49- let file = archive. by_index ( i) ?;
50- let name = file. name ( ) ;
51-
52- if name. starts_with ( "Payload/" ) {
53- has_payload = true ;
54-
55- // Check if there's a .app directory in Payload/
56- if name. starts_with ( "Payload/" ) && name. ends_with ( ".app/" ) {
57- has_app_in_payload = true ;
58- break ;
59- }
60- }
61- }
44+ let is_ipa = archive
45+ . file_names ( )
46+ . any ( |name| name. starts_with ( "Payload/" ) && name. ends_with ( ".app/" ) ) ;
6247
63- Ok ( has_payload && has_app_in_payload )
48+ Ok ( is_ipa )
6449}
6550
6651pub fn is_xcarchive_directory < P > ( path : P ) -> bool
You can’t perform that action at this time.
0 commit comments