Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMBase
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMBase
Commits
2a07cff5
Commit
2a07cff5
authored
Jun 27, 2018
by
汪洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save progress
parent
5de016f1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
GMBaseUtil.h
GMBase/Classes/GMBaseUtil.h
+5
-1
GMBaseUtil.m
GMBase/Classes/GMBaseUtil.m
+36
-1
No files found.
GMBase/Classes/GMBaseUtil.h
View file @
2a07cff5
...
...
@@ -9,6 +9,10 @@
#import <Foundation/Foundation.h>
#import <Masonry/Masonry.h>
@interface
GMJailbreak
:
NSObject
+
(
BOOL
)
isJailbreak
;
@end
@interface
UIFont
(
GMBase
)
+
(
UIFont
*
)
navigationFontWithSize
:(
NSInteger
)
size
;
@end
...
...
@@ -22,7 +26,7 @@
@property
(
nonatomic
,
strong
)
MASViewAttribute
*
mas_safeBottom
;
@end
@interface
MASConstraintMaker
(
GMAdditions
)
-
(
void
)
mas_bottomToSuperView
:(
UIView
*
)
view
withHeight
:(
CGFloat
)
height
;
@end
GMBase/Classes/GMBaseUtil.m
View file @
2a07cff5
...
...
@@ -28,7 +28,7 @@
@implementation
UIView
(
GMAdditions
)
-
(
MASViewAttribute
*
)
mas_safeBottom
{
if
(
SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO
(
@"11.0"
))
{
if
(
SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO
(
@"11.0"
)
&&
[
self
respondsToSelector
:
@selector
(
safeAreaLayoutGuide
)]
)
{
return
[[
MASViewAttribute
alloc
]
initWithView
:
self
item
:
self
.
safeAreaLayoutGuide
layoutAttribute
:
NSLayoutAttributeBottom
];
}
else
{
return
[[
MASViewAttribute
alloc
]
initWithView
:
self
layoutAttribute
:
NSLayoutAttributeBottom
];
...
...
@@ -43,4 +43,39 @@
}
@end
@implementation
GMJailbreak
+
(
BOOL
)
isJailbreak
{
//由于iOS9以后出现白名单,造成控制台不断打印警告
//所以换成以下方式判断
NSArray
*
paths
=
@[
@"/Applications/Cydia.app"
,
@"/private/var/lib/apt/"
,
@"/private/var/lib/cydia"
,
@"/private/var/stash"
];
for
(
NSString
*
path
in
paths
)
{
if
([[
NSFileManager
defaultManager
]
fileExistsAtPath
:
path
])
return
YES
;
}
FILE
*
bash
=
fopen
(
"/bin/bash"
,
"r"
);
if
(
bash
!=
NULL
)
{
fclose
(
bash
);
return
YES
;
}
NSString
*
path
=
[
NSString
stringWithFormat
:
@"/private/%@"
,
[
self
stringWithUUID
]];
if
([
@"test"
writeToFile
:
path
atomically
:
YES
encoding
:
NSUTF8StringEncoding
error
:
NULL
])
{
[[
NSFileManager
defaultManager
]
removeItemAtPath
:
path
error
:
nil
];
return
YES
;
}
return
NO
;
}
+
(
NSString
*
)
stringWithUUID
{
CFUUIDRef
uuid
=
CFUUIDCreate
(
NULL
);
CFStringRef
string
=
CFUUIDCreateString
(
NULL
,
uuid
);
CFRelease
(
uuid
);
return
(
__bridge_transfer
NSString
*
)
string
;
}
@end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment