Skip to content

Commit

Permalink
增加显示沙盒信息
Browse files Browse the repository at this point in the history
增加显示沙盒信息
  • Loading branch information
CoderMJLee committed Jan 29, 2018
1 parent 18ab8f7 commit d770e57
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
1 change: 1 addition & 0 deletions MJAppTools/Models/MJApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@interface MJApp : NSObject

@property(copy, nonatomic, readonly) NSString *bundlePath;
@property(copy, nonatomic, readonly) NSString *dataPath;
@property(copy, nonatomic, readonly) NSString *bundleIdentifier;
@property(copy, nonatomic, readonly) NSString *displayName;
@property(copy, nonatomic, readonly) NSString *executableName;
Expand Down
2 changes: 2 additions & 0 deletions MJAppTools/Models/MJApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

@interface MJApp()
@property(copy, nonatomic) NSString *bundlePath;
@property(copy, nonatomic) NSString *dataPath;
@property(copy, nonatomic) NSString *bundleIdentifier;
@property(copy, nonatomic) NSString *displayName;
@property(copy, nonatomic) NSString *executableName;
Expand All @@ -37,6 +38,7 @@ - (instancetype)initWithInfo:(FBApplicationInfo *)info
self.displayName = displayName;
self.bundleIdentifier = info.bundleIdentifier;
self.bundlePath = info.bundleURL.path;
self.dataPath = info.dataContainerURL.path;
}
return self;
}
Expand Down
2 changes: 0 additions & 2 deletions MJAppTools/SystemHeaders/LSApplicationProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@
@property (nonatomic, readonly) NSString *watchKitVersion;
@property (getter=isWhitelisted, nonatomic, readonly) BOOL whitelisted;

// Image: /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices

+ (id)applicationProxyForBundleURL:(id)arg1;
+ (id)applicationProxyForCompanionIdentifier:(id)arg1;
+ (id)applicationProxyForIdentifier:(id)arg1;
Expand Down
17 changes: 12 additions & 5 deletions MJAppTools/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#import <UIKit/UIKit.h>
#import "MJPrintTools.h"

#define MJEncryptedString @"加壳"
#define MJDecryptedString @"未加壳"

#define MJPrintNewLine printf("\n")
#define MJPrintDivider(n) \
for (int i = 0; i<(n); i++) { \
Expand Down Expand Up @@ -47,12 +50,12 @@ int main(int argc, const char * argv[]) {

[MJPrintTools printColor:MJPrintColorTip format:@" -le <regex>"];
[MJPrintTools print:@"\t列出用户安装的"];
[MJPrintTools printColor:MJPrintColorCrypt format:@"加密"];
[MJPrintTools printColor:MJPrintColorCrypt format:MJEncryptedString];
[MJPrintTools print:@"应用\n"];

[MJPrintTools printColor:MJPrintColorTip format:@" -ld <regex>"];
[MJPrintTools print:@"\t列出用户安装的"];
[MJPrintTools printColor:MJPrintColorCrypt format:@"未加密"];
[MJPrintTools printColor:MJPrintColorCrypt format:MJDecryptedString];
[MJPrintTools print:@"应用\n"];
return 0;
}
Expand Down Expand Up @@ -103,6 +106,10 @@ void list_app(MJApp *app, int index)
[MJPrintTools print:@" "];
[MJPrintTools printColor:MJPrintColorPath format:app.bundlePath];

MJPrintNewLine;
[MJPrintTools print:@" "];
[MJPrintTools printColor:MJPrintColorPath format:app.dataPath];

if (app.executable.isFat) {
MJPrintNewLine;
[MJPrintTools print:@" "];
Expand All @@ -126,9 +133,9 @@ void list_apps(MJListAppsType type, NSString *regex)
[MJPrintTools printColor:MJPrintColorCount format:@"%zd", apps.count];
[MJPrintTools print:@""];
if (type == MJListAppsTypeUserDecrypted) {
[MJPrintTools printColor:MJPrintColorCrypt format:@"未加密"];
[MJPrintTools printColor:MJPrintColorCrypt format:MJDecryptedString];
} else if (type == MJListAppsTypeUserEncrypted) {
[MJPrintTools printColor:MJPrintColorCrypt format:@"加密"];
[MJPrintTools printColor:MJPrintColorCrypt format:MJEncryptedString];
}
[MJPrintTools print:@"应用"];

Expand All @@ -147,6 +154,6 @@ void list_machO(MJMachO *machO)
[MJPrintTools printColor:MJPrintColorArch format:machO.architecture];
if (machO.isEncrypted) {
[MJPrintTools print:@" "];
[MJPrintTools printColor:MJPrintColorCrypt format:@"加密"];
[MJPrintTools printColor:MJPrintColorCrypt format:MJEncryptedString];
}
}
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@

## 目前已有的功能

- 彩色打印 + 正则搜索
- 正则搜索
- 列出用户安装的所有应用
- 列出用户安装的所有加壳应用
- 列出用户安装的所有脱壳应用
- 列出用户安装的所有未加壳应用
- 应用信息
- 应用名称
- Bundle Identifier
- Bundle URL
- Bundle URL(Main Bundle)
- Data URL(Sandbox)
- 架构信息(Architecture)
- 架构名称(Architecture Name)
- 加壳信息(Cryptid)
Expand Down Expand Up @@ -58,22 +59,21 @@ chmod +x /usr/bin/MJAppTools

### 5、开始使用MJAppTools

![](https://images2017.cnblogs.com/blog/497279/201801/497279-20180128160520912-1432195115.png)
![](https://images2017.cnblogs.com/blog/497279/201801/497279-20180129122122859-304167009.png)



## 用法

### 搜索用户安装的所有应用

![](https://images2017.cnblogs.com/blog/497279/201801/497279-20180128221025584-441116962.png)
![](https://images2017.cnblogs.com/blog/497279/201801/497279-20180129122149625-343565107.png)

### 支持正则搜索
- 搜索名称
![](https://images2017.cnblogs.com/blog/497279/201801/497279-20180128221554725-1505248222.png)
![](https://images2017.cnblogs.com/blog/497279/201801/497279-20180129122156265-61789802.png)

- 搜索ID
![](https://images2017.cnblogs.com/blog/497279/201801/497279-20180128221635897-1734040701.png)
![](https://images2017.cnblogs.com/blog/497279/201801/497279-20180129122206250-1877490399.png)

- 搜索路径
![](https://images2017.cnblogs.com/blog/497279/201801/497279-20180129014550003-918385208.png)
![](https://images2017.cnblogs.com/blog/497279/201801/497279-20180129122212906-911472208.png)

0 comments on commit d770e57

Please sign in to comment.