mirror of
https://github.com/DKJone/DKWechatHelper.git
synced 2026-07-29 06:12:07 +08:00
what's new
* 新增集赞助手 * 新增CallKit * 支持7.0.14 * 更新越狱包7.0.14 * 更新已注入助手的7.0.14未签名包 * 增加越狱方式安装包 * 新增越狱源安装
This commit is contained in:
@@ -27,6 +27,15 @@ typedef void(^BtnBlock)(UIButton *sender);
|
||||
|
||||
@interface DKHelper : NSObject
|
||||
|
||||
/// 所有好友(不包含公众号)
|
||||
+ (NSArray<CContact*> *)allFriends;
|
||||
|
||||
/// 朋友圈点赞用户集合
|
||||
+ (NSMutableArray<WCUserComment *>*)commentUsers;
|
||||
|
||||
/// 朋友圈评论
|
||||
+ (NSMutableArray<WCUserComment *>*)commentWith:(WCDataItem *) origItem;
|
||||
|
||||
+ (UIBarButtonItem *)leftNavigationItem;
|
||||
|
||||
+ (UINavigationController *)navigationContrioller;
|
||||
@@ -92,4 +101,3 @@ typedef void(^BtnBlock)(UIButton *sender);
|
||||
- (BOOL)serialQueueIsEmpty;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
@interface DKHelper(){
|
||||
BtnBlock act1;
|
||||
BtnBlock act2;
|
||||
NSArray* allFriends;
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -51,6 +52,68 @@
|
||||
|
||||
}
|
||||
|
||||
+ (NSArray<CContact*> *)allFriends{
|
||||
// 好友缓存为空时去数据库加载
|
||||
if (!DKHelper.shared->allFriends.count){
|
||||
NSMutableArray * friends = [NSMutableArray array];
|
||||
CContactMgr *contactMgr = [[objc_getClass("MMServiceCenter") defaultCenter] getService:[objc_getClass("CContactMgr") class]];
|
||||
NSArray* contacts = [contactMgr getContactList:1 contactType:0];
|
||||
for(CContact* contact in contacts){
|
||||
if (!contact.isBrandContact && contact.m_uiSex != 0) {
|
||||
[friends addObject:contact];
|
||||
}
|
||||
}
|
||||
DKHelper.shared->allFriends = friends;
|
||||
}
|
||||
return DKHelper.shared->allFriends;
|
||||
}
|
||||
|
||||
+ (NSMutableArray<WCUserComment *>*)commentUsers{
|
||||
NSMutableArray* likeCommentUsers = [NSMutableArray array];
|
||||
[DKHelper.allFriends enumerateObjectsUsingBlock:^(CContact * curAddContact, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
WCUserComment* likeComment = [[objc_getClass("WCUserComment") alloc] init];
|
||||
likeComment.username = curAddContact.m_nsUsrName;
|
||||
likeComment.nickname = curAddContact.m_nsNickName;
|
||||
likeComment.type = 2;
|
||||
likeComment.commentID = [NSString stringWithFormat:@"%lu", (unsigned long)idx];
|
||||
likeComment.createTime = [[NSDate date] timeIntervalSince1970];
|
||||
[likeCommentUsers addObject:likeComment];
|
||||
*stop = (DKHelperConfig.likeCount.integerValue == idx);
|
||||
}];
|
||||
return likeCommentUsers;
|
||||
}
|
||||
|
||||
+ (NSMutableArray<WCUserComment *>*)commentWith:(WCDataItem *) origItem{
|
||||
|
||||
NSMutableArray* origComment = origItem.commentUsers;
|
||||
if (origComment.count >= DKHelperConfig.commentCount.intValue){ return origComment;}
|
||||
NSMutableArray* newComments = [NSMutableArray array];
|
||||
|
||||
[newComments addObjectsFromArray:origComment];
|
||||
NSArray<NSString *> *defaultComments = [DKHelperConfig.comments componentsSeparatedByString:@",,"];
|
||||
if (!DKHelperConfig.comments.length){ defaultComments = @[@"赞",@"👍"];}
|
||||
int timeInterval = NSDate.date.timeIntervalSince1970 - origItem.createtime;
|
||||
___addComment:
|
||||
[DKHelper.allFriends enumerateObjectsUsingBlock:^(CContact * curAddContact, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
WCUserComment* newComment = [[objc_getClass("WCUserComment") alloc] init];
|
||||
newComment.username = curAddContact.m_nsUsrName;
|
||||
newComment.nickname = curAddContact.m_nsNickName;
|
||||
newComment.type = 2;
|
||||
newComment.commentID = [NSString stringWithFormat:@"%lu", (unsigned long)idx + origComment.count];
|
||||
newComment.createTime = NSDate.date.timeIntervalSince1970 - arc4random() % timeInterval ;
|
||||
newComment.content = defaultComments[arc4random() % defaultComments.count];
|
||||
[newComments addObject:newComment];
|
||||
*stop = DKHelperConfig.commentCount.intValue <= idx + origComment.count;
|
||||
}];
|
||||
if(DKHelperConfig.commentCount.intValue > newComments.count ){
|
||||
goto ___addComment;
|
||||
}
|
||||
|
||||
[newComments sortUsingComparator:^NSComparisonResult(WCUserComment* _Nonnull obj1, WCUserComment * _Nonnull obj2) {
|
||||
return obj1.createTime < obj2.createTime ? NSOrderedAscending : NSOrderedDescending;
|
||||
}];
|
||||
return newComments;
|
||||
}
|
||||
|
||||
+ (WCTableViewManager *)tableManageWithViewFrame{
|
||||
CGRect tableFrame = [DKHelper viewFrame];
|
||||
|
||||
@@ -17,47 +17,81 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
+ (instancetype)shared;
|
||||
|
||||
//程序进入后台处理
|
||||
/// 程序进入后台处理
|
||||
- (void)enterBackgroundHandler;
|
||||
|
||||
|
||||
/// 自动抢红包
|
||||
+(BOOL)autoRedEnvelop;
|
||||
+(void)setAutoRedEnvelop:(BOOL)value;
|
||||
|
||||
/// 消息防撤回
|
||||
+(BOOL)preventRevoke;
|
||||
+(void)setPreventRevoke:(BOOL)value;
|
||||
|
||||
/// 修改步数
|
||||
+(BOOL)changeSteps;
|
||||
+(void)setChangeSteps:(BOOL)value;
|
||||
|
||||
/// 运动步数
|
||||
+(NSInteger)changedSteps;
|
||||
+(void)setChangedSteps:(NSInteger)value;
|
||||
|
||||
/// 小游戏作弊
|
||||
+(BOOL)gamePlugEnable;
|
||||
+(void)setGamePlugEnable:(BOOL)value;
|
||||
|
||||
/// 后台抢红包
|
||||
+(BOOL)redEnvelopBackGround;
|
||||
+(void)setRedEnvelopBackGround:(BOOL)value;
|
||||
|
||||
/// 抢红包延迟
|
||||
+(NSInteger)redEnvelopDelay;
|
||||
+(void)setRedEnvelopDelay:(NSInteger)value;
|
||||
|
||||
/// 抢红包关键词过滤
|
||||
+(NSString *)redEnvelopTextFiter;
|
||||
+(void)setRedEnvelopTextFiter:(NSString*)value;
|
||||
|
||||
/// 抢红包群组过滤
|
||||
+(NSArray *)redEnvelopGroupFiter;
|
||||
+(void)setRedEnvelopGroupFiter:(NSArray *)value;
|
||||
|
||||
/// 抢自己的红包
|
||||
+(BOOL)redEnvelopCatchMe;
|
||||
+(void)setRedEnvelopCatchMe:(BOOL)value;
|
||||
|
||||
/// 同事抢多个红包
|
||||
+(BOOL)redEnvelopMultipleCatch;
|
||||
+(void)setRedEnvelopMultipleCatch:(BOOL)value;
|
||||
|
||||
+(BOOL)hasShowTips;
|
||||
+(void)setHasShowTips:(BOOL)value;
|
||||
|
||||
+(BOOL)enableCallKit;
|
||||
+(void)setEnableCallKit:(BOOL)value;
|
||||
/// 启用callkit
|
||||
+(BOOL)callKitEnable;
|
||||
+(void)setCallKitEnable:(BOOL)value;
|
||||
|
||||
/// 启用积攒助手
|
||||
+(BOOL)likeCommentEnable;
|
||||
+(void)setLikeCommentEnable:(BOOL)value;
|
||||
|
||||
/// 赞的数量
|
||||
+(NSNumber *)likeCount;
|
||||
+(void)setLikeCount:(NSNumber *)value;
|
||||
|
||||
/// 评论的数量
|
||||
+(NSNumber *)commentCount;
|
||||
+(void)setCommentCount:(NSNumber *)value;
|
||||
|
||||
/// 评论
|
||||
+(NSString *)comments;
|
||||
+(void)setComments:(NSString *)value;
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -35,13 +35,56 @@ NSString* cmdString(SEL sel){
|
||||
return str;
|
||||
}
|
||||
|
||||
+ (NSMethodSignature *)methodSignatureForSelector:(SEL)selector{
|
||||
BOOL isSetMethod = [NSStringFromSelector(selector) rangeOfString:@"set"].location == 0;
|
||||
return [NSMethodSignature signatureWithObjCTypes:isSetMethod ? "v@:@" : "@@:"];
|
||||
}
|
||||
|
||||
+(void)forwardInvocation:(NSInvocation *)anInvocation{
|
||||
NSString * sel = NSStringFromSelector(anInvocation.selector);
|
||||
if ([sel rangeOfString:@"set"].location == 0){
|
||||
//设置值
|
||||
if ([sel rangeOfString:@"Enable"].location != NSNotFound){
|
||||
// 存储BOOL值
|
||||
BOOL *value = (BOOL *)malloc(sizeof(BOOL));
|
||||
[anInvocation getArgument:value atIndex:2];
|
||||
[NSUserDefaults.standardUserDefaults setBool:*value forKey: cmdString(anInvocation.selector)];
|
||||
[NSUserDefaults.standardUserDefaults synchronize];
|
||||
free(value);
|
||||
}else{
|
||||
// 存储对象
|
||||
NSObject *value ;
|
||||
[anInvocation getArgument:&value atIndex:2];
|
||||
[NSUserDefaults.standardUserDefaults setValue:value forKey: cmdString(anInvocation.selector)];
|
||||
[NSUserDefaults.standardUserDefaults synchronize];
|
||||
}
|
||||
|
||||
}else{
|
||||
//返回值
|
||||
if ([sel rangeOfString:@"Enable"].location != NSNotFound){
|
||||
// 返回BOOL值
|
||||
BOOL *retValue = (BOOL *)malloc(sizeof(BOOL));
|
||||
*retValue = [NSUserDefaults.standardUserDefaults boolForKey:cmdString(anInvocation.selector)];
|
||||
[NSUserDefaults.standardUserDefaults synchronize];
|
||||
[anInvocation setReturnValue:retValue];
|
||||
free(retValue);
|
||||
}else{
|
||||
// 返回对象
|
||||
NSObject *retValue ;
|
||||
retValue = [NSUserDefaults.standardUserDefaults valueForKey:cmdString(anInvocation.selector)];
|
||||
[anInvocation setReturnValue:&retValue];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+(BOOL)autoRedEnvelop{
|
||||
return [NSUserDefaults.standardUserDefaults boolForKey:cmdString(_cmd)];
|
||||
}
|
||||
|
||||
+(void)setAutoRedEnvelop:(BOOL)value{
|
||||
[NSUserDefaults.standardUserDefaults setBool:value forKey: cmdString(_cmd)];
|
||||
[NSUserDefaults.standardUserDefaults synchronize];
|
||||
|
||||
}
|
||||
|
||||
+(BOOL)preventRevoke{
|
||||
@@ -52,10 +95,10 @@ NSString* cmdString(SEL sel){
|
||||
[NSUserDefaults.standardUserDefaults synchronize];
|
||||
}
|
||||
|
||||
+(BOOL)enableCallKit{
|
||||
+(BOOL)callKitEnable{
|
||||
return [NSUserDefaults.standardUserDefaults boolForKey:cmdString(_cmd)];
|
||||
}
|
||||
+(void)setEnableCallKit:(BOOL)value{
|
||||
+(void)setCallKitEnable:(BOOL)value{
|
||||
[NSUserDefaults.standardUserDefaults setBool:value forKey: cmdString(_cmd)];
|
||||
[NSUserDefaults.standardUserDefaults synchronize];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user