Skip to content

Commit 42ac7be

Browse files
committed
Fix bug with images in plist
1 parent 655f26f commit 42ac7be

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

LSUnusedResources/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.1</string>
20+
<string>1.0</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>2</string>
24+
<string>3</string>
2525
<key>LSApplicationCategoryType</key>
2626
<string>public.app-category.developer-tools</string>
2727
<key>LSMinimumSystemVersion</key>

LSUnusedResources/Model/ResourceStringSearcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extern NSString * const kNotificationResourceStringQueryDone;
1717

1818
+ (instancetype)sharedObject;
1919

20-
- (void)startWithProjectPath:(NSString *)projectPath fileSuffixs:(NSArray *)fileSuffixs;
20+
- (void)startWithProjectPath:(NSString *)projectPath resourceSuffixs:(NSArray *)resourceSuffixs fileSuffixs:(NSArray *)fileSuffixs;
2121
- (void)reset;
2222

2323
- (BOOL)containsResourceName:(NSString *)name;

LSUnusedResources/Model/ResourceStringSearcher.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ @interface ResourceStringSearcher ()
2929

3030
@property (strong, nonatomic) NSMutableSet *resStringSet;
3131
@property (strong, nonatomic) NSString *projectPath;
32+
@property (strong, nonatomic) NSArray *resSuffixs;
3233
@property (strong, nonatomic) NSArray *fileSuffixs;
3334
@property (assign, nonatomic) BOOL isRunning;
3435

@@ -46,7 +47,7 @@ + (instancetype)sharedObject {
4647
return _sharedInstance;
4748
}
4849

49-
- (void)startWithProjectPath:(NSString *)projectPath fileSuffixs:(NSArray *)fileSuffixs {
50+
- (void)startWithProjectPath:(NSString *)projectPath resourceSuffixs:(NSArray *)resourceSuffixs fileSuffixs:(NSArray *)fileSuffixs {
5051
if (self.isRunning) {
5152
return;
5253
}
@@ -56,6 +57,7 @@ - (void)startWithProjectPath:(NSString *)projectPath fileSuffixs:(NSArray *)file
5657

5758
self.isRunning = YES;
5859
self.projectPath = projectPath;
60+
self.resSuffixs = resourceSuffixs;
5961
self.fileSuffixs = fileSuffixs;
6062

6163
[self runSearchTask];
@@ -193,7 +195,7 @@ - (void)parseFileAtPath:(NSString *)path withType:(LSFileType)fileType {
193195
case LSFileTypePlist:
194196
case LSFileTypeH:
195197
case LSFileTypeC:
196-
pattern = @"(\\S+)\\.(png|gif|jpg|jpeg)";//*.png
198+
pattern = [NSString stringWithFormat:@"([a-zA-Z0-9_-]+)\\.(%@)", self.resSuffixs.count ? [self.resSuffixs componentsJoinedByString:@"|"] : @"png|gif|jpg|jpeg"]; //*.(png|gif|jpg|jpeg)
197199
groupIndex = 1;
198200
break;
199201
default:

LSUnusedResources/ViewController/MainViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ - (IBAction)onSearchButtonClicked:(id)sender {
134134
NSArray *fileSuffixs = [self includeFileSuffixs];
135135

136136
[[ResourceFileSearcher sharedObject] startWithProjectPath:projectPath resourceSuffixs:resourceSuffixs];
137-
[[ResourceStringSearcher sharedObject] startWithProjectPath:projectPath fileSuffixs:fileSuffixs];
137+
[[ResourceStringSearcher sharedObject] startWithProjectPath:projectPath resourceSuffixs:resourceSuffixs fileSuffixs:fileSuffixs];
138138
}
139139

140140
- (IBAction)onExportButtonClicked:(id)sender {

Release/LSUnusedResources.app.zip

354 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)