2929static NSString *MJPrintColorArch;
3030static NSString *MJPrintColorTip;
3131
32+ void print_usage (void );
3233void list_machO (MJMachO *machO);
3334void list_app (MJApp *app, int index);
3435void list_apps (MJListAppsType type, NSString *regex);
@@ -45,18 +46,7 @@ int main(int argc, const char * argv[]) {
4546 }
4647
4748 if (argc == 1 ) { // 参数不够
48- [MJPrintTools printColor: MJPrintColorTip format: @" -l <regex>" ];
49- [MJPrintTools print: @" \t 列出用户安装的应用\n " ];
50-
51- [MJPrintTools printColor: MJPrintColorTip format: @" -le <regex>" ];
52- [MJPrintTools print: @" \t 列出用户安装的" ];
53- [MJPrintTools printColor: MJPrintColorCrypt format: MJEncryptedString];
54- [MJPrintTools print: @" 应用\n " ];
55-
56- [MJPrintTools printColor: MJPrintColorTip format: @" -ld <regex>" ];
57- [MJPrintTools print: @" \t 列出用户安装的" ];
58- [MJPrintTools printColor: MJPrintColorCrypt format: MJDecryptedString];
59- [MJPrintTools print: @" 应用\n " ];
49+ print_usage ();
6050 return 0 ;
6151 }
6252
@@ -71,9 +61,13 @@ int main(int argc, const char * argv[]) {
7161 list_apps (MJListAppsTypeUserEncrypted, regex);
7262 } else if (strcmp (firstArg, " -ld" ) == 0 ) {
7363 list_apps (MJListAppsTypeUserDecrypted, regex);
64+ } else if (strcmp (firstArg, " -ls" ) == 0 ) {
65+ list_apps (MJListAppsTypeSystem, regex);
7466 } else {
7567 list_apps (MJListAppsTypeUser, regex);
7668 }
69+ } else {
70+ print_usage ();
7771 }
7872 }
7973 return 0 ;
@@ -91,6 +85,27 @@ void init_colors()
9185 MJPrintColorTip = MJPrintColorCyan;
9286}
9387
88+ void print_usage ()
89+ {
90+ [MJPrintTools printColor: MJPrintColorTip format: @" -l <regex>" ];
91+ [MJPrintTools print: @" \t 列出用户安装的应用\n " ];
92+
93+ [MJPrintTools printColor: MJPrintColorTip format: @" -le <regex>" ];
94+ [MJPrintTools print: @" \t 列出用户安装的" ];
95+ [MJPrintTools printColor: MJPrintColorCrypt format: MJEncryptedString];
96+ [MJPrintTools print: @" 应用\n " ];
97+
98+ [MJPrintTools printColor: MJPrintColorTip format: @" -ld <regex>" ];
99+ [MJPrintTools print: @" \t 列出用户安装的" ];
100+ [MJPrintTools printColor: MJPrintColorCrypt format: MJDecryptedString];
101+ [MJPrintTools print: @" 应用\n " ];
102+
103+ [MJPrintTools printColor: MJPrintColorTip format: @" -ls <regex>" ];
104+ [MJPrintTools print: @" \t 列出" ];
105+ [MJPrintTools printColor: MJPrintColorCrypt format: @" 系统" ];
106+ [MJPrintTools print: @" 的应用\n " ];
107+ }
108+
94109void list_app (MJApp *app, int index)
95110{
96111 [MJPrintTools print: @" # " ];
@@ -106,9 +121,11 @@ void list_app(MJApp *app, int index)
106121 [MJPrintTools print: @" " ];
107122 [MJPrintTools printColor: MJPrintColorPath format: app.bundlePath];
108123
109- MJPrintNewLine;
110- [MJPrintTools print: @" " ];
111- [MJPrintTools printColor: MJPrintColorPath format: app.dataPath];
124+ if (app.dataPath .length ) {
125+ MJPrintNewLine;
126+ [MJPrintTools print: @" " ];
127+ [MJPrintTools printColor: MJPrintColorPath format: app.dataPath];
128+ }
112129
113130 if (app.executable .isFat ) {
114131 MJPrintNewLine;
@@ -136,6 +153,8 @@ void list_apps(MJListAppsType type, NSString *regex)
136153 [MJPrintTools printColor: MJPrintColorCrypt format: MJDecryptedString];
137154 } else if (type == MJListAppsTypeUserEncrypted) {
138155 [MJPrintTools printColor: MJPrintColorCrypt format: MJEncryptedString];
156+ } else if (type == MJListAppsTypeSystem) {
157+ [MJPrintTools printColor: MJPrintColorCrypt format: @" 系统" ];
139158 }
140159 [MJPrintTools print: @" 应用" ];
141160
0 commit comments