├── dkhelper ├── dkhelper │ ├── TargetApp │ │ └── put ipa or app here │ ├── icon.png │ ├── Scripts │ │ └── quick-resign.sh │ └── Config │ │ └── MDConfig.plist ├── dkhelper.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcuserdata │ │ │ └── zhudekun.xcuserdatad │ │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ │ └── xcdebugger │ │ │ │ └── Expressions.xcexplist │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── xcuserdata │ │ └── zhudekun.xcuserdatad │ │ │ ├── xcschemes │ │ │ └── xcschememanagement.plist │ │ │ └── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ └── xcshareddata │ │ └── xcschemes │ │ ├── dkhelperDylib.xcscheme │ │ └── dkhelper.xcscheme └── dkhelperDylib │ ├── dkhelperDylib-Prefix.pch │ ├── DKHelperSettingController.h │ ├── dkhelperDylib.h │ ├── Tools │ └── LLDBTools.h │ ├── DKGroupFilterController.h │ ├── DKLaunchViewController.h │ ├── QGVAPlayer │ ├── class │ │ ├── Models │ │ │ ├── QGBaseDFileInfo.m │ │ │ ├── QGMP4HWDFileInfo.m │ │ │ ├── QGBaseAnimatedImageFrame.m │ │ │ ├── QGMP4HWDFileInfo.h │ │ │ ├── QGBaseDFileInfo.h │ │ │ ├── QGMP4AnimatedImageFrame.m │ │ │ ├── QGMP4AnimatedImageFrame.h │ │ │ ├── QGBaseAnimatedImageFrame.h │ │ │ ├── QGBaseAnimatedImageFrame+Displaying.h │ │ │ ├── QGVAPMaskInfo.m │ │ │ ├── QGBaseAnimatedImageFrame+Displaying.m │ │ │ ├── QGVAPMaskInfo.h │ │ │ ├── QGVAPTextureLoader.h │ │ │ └── QGVAPConfigModel.h │ │ ├── Utils │ │ │ ├── Categorys │ │ │ │ ├── UIView+MP4HWDecode.m │ │ │ │ ├── NSArray+VAPUtil.h │ │ │ │ ├── UIView+MP4HWDecode.h │ │ │ │ ├── UIColor+VAPUtil.h │ │ │ │ ├── UIGestureRecognizer+VAPUtil.h │ │ │ │ ├── NSDictionary+VAPUtil.h │ │ │ │ ├── UIDevice+VAPUtil.m │ │ │ │ ├── NSArray+VAPUtil.m │ │ │ │ ├── UIDevice+VAPUtil.h │ │ │ │ ├── NSDictionary+VAPUtil.m │ │ │ │ ├── UIColor+VAPUtil.m │ │ │ │ ├── UIGestureRecognizer+VAPUtil.m │ │ │ │ ├── NSNotificationCenter+VAPThreadSafe.h │ │ │ │ └── NSNotificationCenter+VAPThreadSafe.m │ │ │ ├── QGVAPWeakProxy.h │ │ │ ├── QGVAPMetalShaderFunctionLoader.h │ │ │ ├── QGVAPSafeMutableArray.h │ │ │ ├── QGVAPSafeMutableDictionary.h │ │ │ ├── QGVAPWeakProxy.m │ │ │ ├── QGVAPMetalUtil.h │ │ │ ├── Logger │ │ │ │ ├── QGVAPLogger.m │ │ │ │ └── QGVAPLogger.h │ │ │ └── QGVAPMetalShaderFunctionLoader.m │ │ ├── Controllers │ │ │ ├── QGAnimatedImageDecodeThread.h │ │ │ ├── QGAnimatedImageDecodeThreadPool.h │ │ │ ├── QGAnimatedImageDecodeConfig.h │ │ │ ├── QGAnimatedImageDecodeConfig.m │ │ │ ├── QGAnimatedImageDecodeThread.m │ │ │ ├── QGAnimatedImageBufferManager.h │ │ │ ├── Decoders │ │ │ │ ├── QGBaseDecoder.h │ │ │ │ ├── QGMP4FrameHWDecoder.h │ │ │ │ └── QGBaseDecoder.m │ │ │ ├── QGVAPConfigManager.h │ │ │ ├── QGAnimatedImageDecodeManager.h │ │ │ ├── QGAnimatedImageDecodeThreadPool.m │ │ │ ├── QGAnimatedImageBufferManager.m │ │ │ └── QGAnimatedImageDecodeManager.m │ │ ├── QGVAPlayer.h │ │ ├── Views │ │ │ ├── Metal │ │ │ │ ├── Vapx │ │ │ │ │ ├── QGVAPMetalView.h │ │ │ │ │ ├── QGVAPMetalRenderer.h │ │ │ │ │ └── QGVAPMetalView.m │ │ │ │ ├── QGHWDMetalRenderer.h │ │ │ │ ├── QGHWDMetalView.h │ │ │ │ └── QGHWDMetalView.m │ │ │ └── OpenGL │ │ │ │ └── QGHWDMP4OpenGLView.h │ │ ├── MP4Parser │ │ │ └── QGMP4Parser.h │ │ ├── VAPMacros.h │ │ └── UIView+VAP.h │ └── Shaders │ │ └── QGHWDShaderTypes.h │ ├── Config │ ├── MDCycriptManager.h │ ├── MDMethodTrace.h │ ├── MDConfigManager.m │ └── MDConfigManager.h │ ├── MyUtils │ ├── NSArray+Utils.h │ ├── NSArray+Utils.m │ ├── DKLaunchHelper.h │ ├── DKHelperConfig.h │ └── DKHelper.h │ ├── DKCleanFriendsController.h │ ├── Trace │ ├── OCSelectorTrampolines.h │ ├── selectortramps.mac │ ├── OCMethodTrace.h │ ├── a1a2-selectortramps-arm64.s │ ├── a1a2-selectortramps-arm.s │ └── a2a3-selectortramps-arm.s │ ├── wechatHeaders │ ├── MMUICommonUtil.h │ ├── UiUtil.h │ └── WCUIAlertView.h │ ├── fishhook │ └── fishhook.h │ ├── AntiAntiDebug │ └── AntiAntiDebug.m │ ├── DKGroupFilterController.m │ └── dkhelperDylib.m ├── IMG_0031.JPG ├── IMG_0223.png ├── IMG_4272.JPG ├── IMG_4286.JPG ├── .gitignore ├── CHANGELOG.md └── README.md /dkhelper/dkhelper/TargetApp/put ipa or app here: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /IMG_0031.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DKJone/DKWechatHelper/HEAD/IMG_0031.JPG -------------------------------------------------------------------------------- /IMG_0223.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DKJone/DKWechatHelper/HEAD/IMG_0223.png -------------------------------------------------------------------------------- /IMG_4272.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DKJone/DKWechatHelper/HEAD/IMG_4272.JPG -------------------------------------------------------------------------------- /IMG_4286.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DKJone/DKWechatHelper/HEAD/IMG_4286.JPG -------------------------------------------------------------------------------- /dkhelper/dkhelper/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DKJone/DKWechatHelper/HEAD/dkhelper/dkhelper/icon.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | obj 3 | *.deb 4 | .theos/ 5 | .DS_Store 6 | *.ipa 7 | dkhelper/dkhelper/TargetApp/ 8 | dkhelper/dkhelper/tmp/ 9 | dkhelper/LatestBuild 10 | dkhelper/dkhelper/WeChat_Headers/ 11 | Info.plist 12 | dkhelper/LogesTewak 13 | -------------------------------------------------------------------------------- /dkhelper/dkhelper.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /dkhelper/dkhelper.xcodeproj/project.xcworkspace/xcuserdata/zhudekun.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DKJone/DKWechatHelper/HEAD/dkhelper/dkhelper.xcodeproj/project.xcworkspace/xcuserdata/zhudekun.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/dkhelperDylib-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'dkhelperDylib' target in the 'dkhelperDylib' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import "/opt/theos/Prefix.pch" //path/to/theos/Prefix.pch 8 | #endif 9 | -------------------------------------------------------------------------------- /dkhelper/dkhelper.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/DKHelperSettingController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DKHelperSettingController.h 3 | // testHookDylib 4 | // 5 | // Created by 朱德坤 on 2019/1/10. 6 | // Copyright © 2019 DKJone. All rights reserved. 7 | // 8 | 9 | #import 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface DKHelperSettingController : UIViewController 13 | - (void)payForMe; 14 | @end 15 | 16 | NS_ASSUME_NONNULL_END 17 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/dkhelperDylib.h: -------------------------------------------------------------------------------- 1 | // weibo: http://weibo.com/xiaoqing28 2 | // blog: http://www.alonemonkey.com 3 | // 4 | // dkhelperDylib.h 5 | // dkhelperDylib 6 | // 7 | // Created by 朱德坤 on 2019/1/23. 8 | // Copyright (c) 2019 DKJone. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | #define INSERT_SUCCESS_WELCOME " 🎉!!!congratulations!!!🎉\n👍----------------insert dylib success----------------👍\n" 14 | 15 | 16 | -------------------------------------------------------------------------------- /dkhelper/dkhelper/Scripts/quick-resign.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Usage 4 | # Must be an absolute path 5 | 6 | # ./quick-resign.sh [insert] "origin.ipa path" "resign.ipa path" 7 | 8 | INSERT_DYLIB=NO 9 | INPUT_PATH=$1 10 | OUTPUT_PATH=$2 11 | 12 | if [[ $1 == "insert" ]];then 13 | INSERT_DYLIB=YES 14 | INPUT_PATH=$2 15 | OUTPUT_PATH=$3 16 | fi 17 | 18 | if [[ ! $OUTPUT_PATH ]];then 19 | OUTPUT_PATH=$PWD 20 | fi 21 | 22 | cp -rf $INPUT_PATH ../TargetApp/ 23 | cd ../../ 24 | xcodebuild MONKEYDEV_INSERT_DYLIB=$INSERT_DYLIB | xcpretty 25 | cd LatestBuild 26 | ./createIPA.command 27 | cp -rf Target.ipa $OUTPUT_PATH 28 | exit 0 -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/Tools/LLDBTools.h: -------------------------------------------------------------------------------- 1 | // weibo: http://weibo.com/xiaoqing28 2 | // blog: http://www.alonemonkey.com 3 | // 4 | // LLDBTools.h 5 | // MonkeyDev 6 | // 7 | // Created by AloneMonkey on 2018/3/8. 8 | // Copyright © 2018年 AloneMonkey. All rights reserved. 9 | // 10 | 11 | #import 12 | #import 13 | 14 | //(lldb) po pviews() 15 | 16 | NSString* pvc(void); 17 | 18 | NSString* pviews(void); 19 | 20 | NSString* pactions(vm_address_t address); 21 | 22 | NSString* pblock(vm_address_t address); 23 | 24 | NSString* methods(const char * classname); 25 | 26 | NSString* ivars(vm_address_t address); 27 | 28 | NSString* choose(const char* classname); 29 | 30 | NSString* vmmap(); 31 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/DKGroupFilterController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DKGroupFilterController.h 3 | // testHookDylib 4 | // 5 | // Created by 朱德坤 on 2019/1/22. 6 | // Copyright © 2019 DKJone. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DKHelper.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | 15 | @protocol MultiSelectGroupsViewControllerDelegate 16 | - (void)onMultiSelectGroupReturn:(NSArray *)arg1; 17 | 18 | @optional 19 | - (void)onMultiSelectGroupCancel; 20 | @end 21 | 22 | @interface DKGroupFilterController : UIViewController 23 | - (instancetype)initWithBlackList:(NSArray *)blackList; 24 | @property (nonatomic, assign) id delegate; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/DKLaunchViewController.h: -------------------------------------------------------------------------------- 1 | // ViewController.h 2 | // 3 | // Created by ___ORGANIZATIONNAME___ on 2021/1/18 4 | // 5 | // 6 | // 7 | // ██████╗ ██╗ ██╗ ██╗ ██████╗ ███╗ ██╗███████╗ 8 | // ██╔══██╗██║ ██╔╝ ██║██╔═══██╗████╗ ██║██╔════╝ 9 | // ██║ ██║█████╔╝ ██║██║ ██║██╔██╗ ██║█████╗ 10 | // ██║ ██║██╔═██╗ ██ ██║██║ ██║██║╚██╗██║██╔══╝ 11 | // ██████╔╝██║ ██╗╚█████╔╝╚██████╔╝██║ ╚████║███████╗ 12 | // ╚═════╝ ╚═╝ ╚═╝ ╚════╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝ 13 | // 14 | // 15 | 16 | #import 17 | #import "DKLaunchHelper.h" 18 | @interface DKLaunchViewController : UIViewController 19 | /// 设置类型 0 :启动页,1:设置启动页,2:设置聊天背景 20 | @property (nonatomic,assign)int setType; 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGBaseDFileInfo.m: -------------------------------------------------------------------------------- 1 | // QGBaseDFileInfo.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGBaseDFileInfo.h" 17 | 18 | @implementation QGBaseDFileInfo 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /dkhelper/dkhelper.xcodeproj/xcuserdata/zhudekun.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | dkhelper.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | dkhelperDylib.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 114CCC2621F817D500A4646E 21 | 22 | primary 23 | 24 | 25 | 114CCC3721F817D500A4646E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/Config/MDCycriptManager.h: -------------------------------------------------------------------------------- 1 | // weibo: http://weibo.com/xiaoqing28 2 | // blog: http://www.alonemonkey.com 3 | // 4 | // MDCycriptManager.h 5 | // MonkeyDev 6 | // 7 | // Created by AloneMonkey on 2018/3/8. 8 | // Copyright © 2018年 AloneMonkey. All rights reserved. 9 | // 10 | 11 | #ifndef __OPTIMIZE__ 12 | 13 | #import 14 | 15 | #define PORT 6666 16 | 17 | @interface MDCycriptManager : NSObject 18 | 19 | + (instancetype)sharedInstance; 20 | 21 | 22 | /** 23 | Download script by config.plist 24 | 25 | @param update Force update of all scripts 26 | */ 27 | -(void)loadCycript:(BOOL) update; 28 | 29 | /** 30 | eval javascript by cycript 31 | 32 | @param cycript javascript string 33 | @param error error happened 34 | @return eval result 35 | */ 36 | -(NSString*)evaluateCycript:(NSString*) cycript error:(NSError **) error; 37 | 38 | @end 39 | 40 | #endif -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGMP4HWDFileInfo.m: -------------------------------------------------------------------------------- 1 | // QGMP4HWDFileInfo.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGMP4HWDFileInfo.h" 17 | 18 | @implementation QGMP4HWDFileInfo 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/MyUtils/NSArray+Utils.h: -------------------------------------------------------------------------------- 1 | // NSArray+Utils.h 2 | // dkhelperDylib 3 | // Created by DKJone on 2020/9/27 4 | // Copyright © 2020 DKJone. All rights reserved. 5 | // 6 | // 7 | // ██████╗ ██╗ ██╗ ██╗ ██████╗ ███╗ ██╗███████╗ 8 | // ██╔══██╗██║ ██╔╝ ██║██╔═══██╗████╗ ██║██╔════╝ 9 | // ██║ ██║█████╔╝ ██║██║ ██║██╔██╗ ██║█████╗ 10 | // ██║ ██║██╔═██╗ ██ ██║██║ ██║██║╚██╗██║██╔══╝ 11 | // ██████╔╝██║ ██╗╚█████╔╝╚██████╔╝██║ ╚████║███████╗ 12 | // ╚═════╝ ╚═╝ ╚═╝ ╚════╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝ 13 | // 14 | // 15 | 16 | #import 17 | 18 | 19 | 20 | @interface NSArray (Utils) 21 | - (NSArray *)_map:(id(^)(id))hanlde ; 22 | 23 | - (NSArray *)_filter:(BOOL(^)(id obj))handle ; 24 | - (BOOL)_contains:(BOOL(^)(id obj))handle; 25 | @end 26 | 27 | 28 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/DKCleanFriendsController.h: -------------------------------------------------------------------------------- 1 | // DKCleanFriendsController.h 2 | // dkhelperDylib 3 | // Created by DKJone on 2020/9/25 4 | // Copyright © 2020 DKJone. All rights reserved. 5 | // 6 | // 7 | // ██████╗ ██╗ ██╗ ██╗ ██████╗ ███╗ ██╗███████╗ 8 | // ██╔══██╗██║ ██╔╝ ██║██╔═══██╗████╗ ██║██╔════╝ 9 | // ██║ ██║█████╔╝ ██║██║ ██║██╔██╗ ██║█████╗ 10 | // ██║ ██║██╔═██╗ ██ ██║██║ ██║██║╚██╗██║██╔══╝ 11 | // ██████╔╝██║ ██╗╚█████╔╝╚██████╔╝██║ ╚████║███████╗ 12 | // ╚═════╝ ╚═╝ ╚═╝ ╚════╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝ 13 | // 14 | // 15 | 16 | #import 17 | #import "DKHelper.h" 18 | 19 | @interface DKCleanFriendsController : UIViewController 20 | - (instancetype)initWithContactList:(NSArray *)contactList contactDesc:(NSString *)contactDesc; 21 | 22 | @end 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/UIView+MP4HWDecode.m: -------------------------------------------------------------------------------- 1 | // UIView+MP4HWDecode.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "UIView+MP4HWDecode.h" 17 | 18 | @implementation UIView (MP4HWDecode) 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGBaseAnimatedImageFrame.m: -------------------------------------------------------------------------------- 1 | // QGBaseAnimatedImageFrame.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGBaseAnimatedImageFrame.h" 17 | 18 | @implementation QGBaseAnimatedImageFrame 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/NSArray+VAPUtil.h: -------------------------------------------------------------------------------- 1 | // NSArray+VAPUtil.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | @interface NSArray (VAPUtil) 19 | 20 | - (CGRect)hwd_rectValue; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/Config/MDMethodTrace.h: -------------------------------------------------------------------------------- 1 | // weibo: http://weibo.com/xiaoqing28 2 | // blog: http://www.alonemonkey.com 3 | // 4 | // MDMethodTrace.h 5 | // MonkeyDev 6 | // 7 | // Created by AloneMonkey on 2017/9/7. 8 | // Copyright © 2017年 AloneMonkey. All rights reserved. 9 | // 10 | 11 | #ifndef MethodTrace_h 12 | #define MethodTrace_h 13 | 14 | #define TRACE_README @"\n📚--------------------OCMethodTrace(Usage)-------------------📚\nhttps://github.com/omxcodec/OCMethodTrace/blob/master/README.md\n📚--------------------OCMethodTrace(Usage)-------------------📚" 15 | 16 | #import 17 | 18 | @interface MDMethodTrace : NSObject 19 | 20 | + (instancetype)sharedInstance; 21 | 22 | - (void)addClassTrace:(NSString *) className; 23 | 24 | - (void)addClassTrace:(NSString *)className methodName:(NSString *)methodName; 25 | 26 | - (void)addClassTrace:(NSString *)className methodList:(NSArray *)methodList; 27 | 28 | @end 29 | 30 | #endif /* MethodTrace_h */ 31 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/UIView+MP4HWDecode.h: -------------------------------------------------------------------------------- 1 | // UIView+MP4HWDecode.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import "UIView+VAP.h" 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | @interface UIView (MP4HWDecode) 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGMP4HWDFileInfo.h: -------------------------------------------------------------------------------- 1 | // QGMP4HWDFileInfo.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGBaseDFileInfo.h" 17 | #import "QGMP4Parser.h" 18 | 19 | @interface QGMP4HWDFileInfo : QGBaseDFileInfo 20 | 21 | @property (nonatomic, strong) QGMP4ParserProxy *mp4Parser; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/QGVAPWeakProxy.h: -------------------------------------------------------------------------------- 1 | // QGVAPWeakProxy.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | @interface QGVAPWeakProxy : NSObject 19 | 20 | - (instancetype)initWithTarget:(id)target; 21 | 22 | + (instancetype)proxyWithTarget:(id)target; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/UIColor+VAPUtil.h: -------------------------------------------------------------------------------- 1 | // UIColor+VAPUtil.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | NS_ASSUME_NONNULL_BEGIN 19 | 20 | @interface UIColor (VAPUtil) 21 | 22 | + (instancetype)hwd_colorWithHexString:(NSString *)hexStr; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGBaseDFileInfo.h: -------------------------------------------------------------------------------- 1 | // QGBaseDFileInfo.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | @interface QGBaseDFileInfo : NSObject 19 | 20 | @property (nonatomic, strong) NSString *filePath; //文件路径 21 | @property (atomic, assign) NSInteger occupiedCount; //作用类似retainCount 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/Trace/OCSelectorTrampolines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OCSelectorTrampolines.mm 3 | * OCMethodTrace 4 | * 5 | * https://github.com/omxcodec/OCMethodTrace.git 6 | * 7 | * Copyright (C) 2018 Michael Chen 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #import 23 | 24 | FOUNDATION_EXTERN IMP imp_implementationWithSelector(SEL aSel, const char *signature); 25 | FOUNDATION_EXTERN SEL imp_getSelector(IMP anImp); 26 | FOUNDATION_EXTERN BOOL imp_removeSelector(IMP anImp); 27 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/QGAnimatedImageDecodeThread.h: -------------------------------------------------------------------------------- 1 | // QGAnimatedImageDecodeThread.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | @interface QGAnimatedImageDecodeThread : NSThread 19 | 20 | @property (nonatomic, assign) BOOL occupied; //是否被解码器占用 21 | @property (nonatomic, readonly) NSString *sequenceDec; //线程标识信息 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGMP4AnimatedImageFrame.m: -------------------------------------------------------------------------------- 1 | // QGMP4AnimatedImageFrame.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGMP4AnimatedImageFrame.h" 17 | 18 | @implementation QGMP4AnimatedImageFrame 19 | 20 | - (void)dealloc { 21 | 22 | //释放image buffer 23 | if (self.pixelBuffer) { 24 | CVPixelBufferRelease(self.pixelBuffer); 25 | } 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/QGAnimatedImageDecodeThreadPool.h: -------------------------------------------------------------------------------- 1 | // QGAnimatedImageDecodeThreadPool.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import "QGAnimatedImageDecodeThread.h" 18 | 19 | @interface QGAnimatedImageDecodeThreadPool : NSObject 20 | 21 | + (instancetype)sharedPool; 22 | - (QGAnimatedImageDecodeThread *)getDecodeThread; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGMP4AnimatedImageFrame.h: -------------------------------------------------------------------------------- 1 | // QGMP4AnimatedImageFrame.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGBaseAnimatedImageFrame.h" 17 | #import 18 | 19 | @interface QGMP4AnimatedImageFrame : QGBaseAnimatedImageFrame 20 | 21 | @property (nonatomic, assign) CVPixelBufferRef pixelBuffer; 22 | @property (nonatomic, assign) int defaultFps; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/QGVAPMetalShaderFunctionLoader.h: -------------------------------------------------------------------------------- 1 | // QGVAPMetalShaderFunctionLoader.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import 18 | 19 | @interface QGVAPMetalShaderFunctionLoader : NSObject 20 | 21 | - (instancetype)initWithDevice:(id)device; 22 | - (id)loadFunctionWithName:(NSString *)funcName; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/QGAnimatedImageDecodeConfig.h: -------------------------------------------------------------------------------- 1 | // QGAnimatedImageDecodeConfig.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | @interface QGAnimatedImageDecodeConfig : NSObject 19 | 20 | @property (nonatomic, assign) NSInteger threadCount;//线程数 21 | @property (nonatomic, assign) NSInteger bufferCount;//缓冲数 22 | 23 | + (instancetype)defaultConfig; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/UIGestureRecognizer+VAPUtil.h: -------------------------------------------------------------------------------- 1 | // UIGestureRecognizer+VAPUtil.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | @interface UIGestureRecognizer (VAPUtil) 19 | 20 | - (instancetype)initWithVapActionBlock:(void (^)(id sender))block; 21 | 22 | - (void)addVapActionBlock:(void (^)(id sender))block; 23 | 24 | - (void)removeAllVapActionBlocks; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGBaseAnimatedImageFrame.h: -------------------------------------------------------------------------------- 1 | // QGBaseAnimatedImageFrame.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | @interface QGBaseAnimatedImageFrame : NSObject 19 | 20 | @property (atomic, assign) NSInteger frameIndex; //当前帧索引 21 | @property (atomic, assign) NSTimeInterval duration; //播放时长 22 | /** pts */ 23 | @property (atomic, assign) uint64_t pts; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGBaseAnimatedImageFrame+Displaying.h: -------------------------------------------------------------------------------- 1 | // QGBaseAnimatedImageFrame+Displaying.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGBaseAnimatedImageFrame.h" 17 | 18 | @interface QGBaseAnimatedImageFrame (Displaying) 19 | 20 | @property (nonatomic, strong) NSDate *startDate; //开始播放的时间 21 | @property (nonatomic, assign) NSTimeInterval decodeTime; //解码时间 22 | 23 | - (BOOL)shouldFinishDisplaying; //是否需要结束播放(根据播放时长来决定) 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/QGAnimatedImageDecodeConfig.m: -------------------------------------------------------------------------------- 1 | // QGAnimatedImageDecodeConfig.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGAnimatedImageDecodeConfig.h" 17 | 18 | @implementation QGAnimatedImageDecodeConfig 19 | 20 | + (instancetype)defaultConfig { 21 | 22 | QGAnimatedImageDecodeConfig *config = [QGAnimatedImageDecodeConfig new]; 23 | config.threadCount= 1; 24 | config.bufferCount = 5; 25 | return config; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/NSDictionary+VAPUtil.h: -------------------------------------------------------------------------------- 1 | // NSDictionary+VAPUtil.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | 19 | @interface NSDictionary (VAPUtil) 20 | 21 | - (CGFloat)hwd_floatValue:(NSString *)key; 22 | - (NSInteger)hwd_integerValue:(NSString *)key; 23 | - (NSString *)hwd_stringValue:(NSString *)key; 24 | - (NSDictionary *)hwd_dicValue:(NSString *)key; 25 | - (NSArray *)hwd_arrValue:(NSString *)key; 26 | 27 | @end 28 | 29 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/QGAnimatedImageDecodeThread.m: -------------------------------------------------------------------------------- 1 | // QGAnimatedImageDecodeThread.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGAnimatedImageDecodeThread.h" 17 | 18 | @implementation QGAnimatedImageDecodeThread 19 | 20 | - (NSString *)sequenceDec 21 | { 22 | #ifdef DEBUG 23 | return [NSString stringWithFormat:@"%@",@([[self valueForKeyPath:@"private.seqNum"] integerValue])];// 24 | #else 25 | return [self description]; 26 | #endif 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/QGVAPlayer.h: -------------------------------------------------------------------------------- 1 | // QGVAPlayer.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import "UIView+VAP.h" 18 | 19 | //! Project version number for QGVAPlayer. 20 | FOUNDATION_EXPORT double QGVAPlayerVersionNumber; 21 | 22 | //! Project version string for QGVAPlayer. 23 | FOUNDATION_EXPORT const unsigned char QGVAPlayerVersionString[]; 24 | 25 | // In this header, you should import all the public headers of your framework using statements like #import 26 | 27 | 28 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/QGVAPSafeMutableArray.h: -------------------------------------------------------------------------------- 1 | // QGVAPSafeMutableArray.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | 19 | /** 20 | This class inherits from NSMutableArray,make it tread safe and allow Recursive lock. 21 | 22 | @discussion access performance would lower than NSMutableArray, or using semaphore but equal to @sychronized. 23 | 24 | @warning Fast enumerate and enumerator are not thread safe 25 | */ 26 | @interface QGVAPSafeMutableArray : NSMutableArray 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/QGVAPSafeMutableDictionary.h: -------------------------------------------------------------------------------- 1 | // QGVAPSafeMutableDictionary.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | /** 19 | This class inherits from NSMutableDictionary, make it thread safe and allow Recursive lock. 20 | 21 | @discussion access performance would lower than NSMutableDictionary, or using semaphore but equal to @sychronized. 22 | 23 | @warning Fast enumerate and enumerator are not thread safe 24 | */ 25 | @interface QGVAPSafeMutableDictionary : NSMutableDictionary 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGVAPMaskInfo.m: -------------------------------------------------------------------------------- 1 | // QGVAPMaskInfo.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGVAPMaskInfo.h" 17 | #import "QGVAPTextureLoader.h" 18 | #import "QGHWDMetalRenderer.h" 19 | 20 | @implementation QGVAPMaskInfo 21 | 22 | @synthesize texture = _texture; 23 | 24 | - (id)texture { 25 | if (!_texture) { 26 | _texture = [QGVAPTextureLoader loadTextureWithData:self.data device:kQGHWDMetalRendererDevice width:self.dataSize.width height:self.dataSize.height]; 27 | } 28 | return _texture; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/Config/MDConfigManager.m: -------------------------------------------------------------------------------- 1 | // weibo: http://weibo.com/xiaoqing28 2 | // blog: http://www.alonemonkey.com 3 | // 4 | // MDConfigManager.m 5 | // MonkeyDev 6 | // 7 | // Created by AloneMonkey on 2018/4/24. 8 | // Copyright © 2018年 AloneMonkey. All rights reserved. 9 | // 10 | 11 | #define CONFIG_FILE_NAME @"MDConfig" 12 | 13 | #import "MDConfigManager.h" 14 | 15 | @implementation MDConfigManager{ 16 | NSString* _filepath; 17 | } 18 | 19 | + (instancetype)sharedInstance{ 20 | static MDConfigManager *sharedInstance = nil; 21 | if (!sharedInstance){ 22 | sharedInstance = [[MDConfigManager alloc] init]; 23 | } 24 | return sharedInstance; 25 | } 26 | 27 | - (BOOL)isActive{ 28 | _filepath = [[NSBundle mainBundle] pathForResource:CONFIG_FILE_NAME ofType:@"plist"]; 29 | if(_filepath == nil){ 30 | return NO; 31 | } 32 | return YES; 33 | } 34 | 35 | - (NSDictionary*) readConfigByKey:(NSString*) key{ 36 | if([self isActive]){ 37 | NSDictionary* contentDict = [NSDictionary dictionaryWithContentsOfFile:_filepath]; 38 | if([contentDict.allKeys containsObject:key]){ 39 | return contentDict[key]; 40 | }else{ 41 | return nil; 42 | } 43 | }else{ 44 | return nil; 45 | } 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/QGAnimatedImageBufferManager.h: -------------------------------------------------------------------------------- 1 | // QGAnimatedImageBufferManager.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import "QGAnimatedImageDecodeConfig.h" 18 | #import "QGBaseAnimatedImageFrame.h" 19 | 20 | @interface QGAnimatedImageBufferManager : NSObject 21 | 22 | @property (nonatomic, strong) NSMutableArray *buffers;//缓冲 23 | 24 | - (instancetype)initWithConfig:(QGAnimatedImageDecodeConfig *)config; 25 | - (QGBaseAnimatedImageFrame *)getBufferedFrame:(NSInteger)frameIndex; 26 | - (BOOL)isBufferFull; 27 | - (QGBaseAnimatedImageFrame *)popVideoFrame; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Views/Metal/Vapx/QGVAPMetalView.h: -------------------------------------------------------------------------------- 1 | // QGVAPMetalView.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import "QGVAPConfigModel.h" 18 | 19 | @class QGVAPMaskInfo; 20 | 21 | @protocol QGVAPMetalViewDelegate 22 | 23 | - (void)onMetalViewUnavailable; 24 | 25 | @end 26 | 27 | @interface QGVAPMetalView : UIView 28 | 29 | @property (nonatomic, weak) id delegate; 30 | @property (nonatomic, strong) QGVAPCommonInfo *commonInfo; 31 | @property (nonatomic, strong) QGVAPMaskInfo *maskInfo; 32 | 33 | - (void)display:(CVPixelBufferRef)pixelBuffer mergeInfos:(NSArray *)infos; 34 | 35 | - (void)dispose; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/Trace/selectortramps.mac: -------------------------------------------------------------------------------- 1 | /* 2 | * selectortramps.mac 3 | * OCMethodTrace 4 | * 5 | * https://github.com/omxcodec/OCMethodTrace.git 6 | * 7 | * Copyright (C) 2018 Michael Chen 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifdef __x86_64__ 23 | #define PRELOAD(x,f) movq x@GOTPCREL(%rip), %r10; 24 | #define LABEL_ADDR(x,f) %r10 25 | #define LABEL_VALUE(x,f) (%r10) 26 | #define INIT_PIC(f) 27 | #define END_PIC(f) 28 | #elif __i386__ 29 | #define PRELOAD(x,f) leal x-L0## f ##$pb(%ebx), %eax; 30 | #define LABEL_ADDR(x,f) %eax 31 | #define LABEL_VALUE(x,f) (%eax) 32 | #define INIT_PIC(x) \ 33 | push %ebx; \ 34 | call L0## x ##$pb; \ 35 | L0## x ##$pb:; \ 36 | pop %ebx; 37 | #define END_PIC(x) pop %ebx 38 | #endif 39 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/UIDevice+VAPUtil.m: -------------------------------------------------------------------------------- 1 | // UIDevice+VAPUtil.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "UIDevice+VAPUtil.h" 17 | 18 | MTLResourceOptions getDefaultMTLResourceOption() { 19 | 20 | if (@available(iOS 9.0, *)) { 21 | return MTLResourceStorageModeShared; 22 | } else { 23 | return MTLResourceCPUCacheModeDefaultCache; 24 | } 25 | } 26 | @implementation UIDevice (VAPUtil) 27 | 28 | + (double)systemVersionNum { 29 | 30 | static double version; 31 | static dispatch_once_t onceToken; 32 | dispatch_once(&onceToken, ^{ 33 | version = [UIDevice currentDevice].systemVersion.doubleValue; 34 | }); 35 | return version; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/Decoders/QGBaseDecoder.h: -------------------------------------------------------------------------------- 1 | // QGBaseDecoder.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import "QGAnimatedImageDecodeThread.h" 18 | #import "QGBaseDFileInfo.h" 19 | 20 | @interface QGBaseDecoder : NSObject 21 | 22 | @property (atomic, assign) NSInteger currentDecodeFrame; //正在解码的帧索引 23 | @property (nonatomic, readonly) QGBaseDFileInfo *fileInfo; //解码文件信息 只能通过初始化方法赋值 24 | 25 | - (instancetype)initWith:(QGBaseDFileInfo *)fileInfo error:(NSError **)error; 26 | - (void)decodeFrame:(NSInteger)frameIndex buffers:(NSMutableArray *)buffers; 27 | - (BOOL)shouldStopDecode:(NSInteger)nextFrameIndex; 28 | - (BOOL)isFrameIndexBeyondEnd:(NSInteger)frameIndex; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/NSArray+VAPUtil.m: -------------------------------------------------------------------------------- 1 | // NSArray+VAPUtil.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "NSArray+VAPUtil.h" 17 | 18 | @implementation NSArray (VAPUtil) 19 | 20 | - (CGRect)hwd_rectValue { 21 | 22 | if (self.count < 4) { 23 | return CGRectZero; 24 | } 25 | for (int i = 0; i < self.count; i++) { 26 | id value = self[i]; 27 | if (i >= 4) { 28 | break ; 29 | } 30 | if (![value isKindOfClass:[NSString class]] && ![value isKindOfClass:[NSNumber class]]) { 31 | return CGRectZero; 32 | } 33 | } 34 | return CGRectMake([self[0] floatValue], [self[1] floatValue], [self[2] floatValue], [self[3] floatValue]); 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/UIDevice+VAPUtil.h: -------------------------------------------------------------------------------- 1 | // UIDevice+VAPUtil.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import 18 | 19 | #ifndef kHWDSystemVersion 20 | #define kHWDSystemVersion [UIDevice systemVersionNum] 21 | #endif 22 | 23 | #ifndef kHWDiOS9Later 24 | #define kHWDiOS9Later (kHWDSystemVersion >= 9) 25 | #endif 26 | 27 | #define kDefaultMTLResourceOption getDefaultMTLResourceOption() 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | MTLResourceOptions getDefaultMTLResourceOption(void); 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | NS_ASSUME_NONNULL_BEGIN 38 | 39 | @interface UIDevice (VAPUtil) 40 | 41 | + (double)systemVersionNum; 42 | 43 | @end 44 | 45 | NS_ASSUME_NONNULL_END 46 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGBaseAnimatedImageFrame+Displaying.m: -------------------------------------------------------------------------------- 1 | // QGBaseAnimatedImageFrame+Displaying.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | #import "QGBaseAnimatedImageFrame+Displaying.h" 16 | #import 17 | #import "VAPMacros.h" 18 | 19 | @implementation QGBaseAnimatedImageFrame (Displaying) 20 | 21 | HWDSYNTH_DYNAMIC_PROPERTY_CTYPE(decodeTime, setDecodeTime, NSTimeInterval) 22 | HWDSYNTH_DYNAMIC_PROPERTY_OBJECT(startDate, setStartDate, OBJC_ASSOCIATION_RETAIN); 23 | 24 | - (BOOL)shouldFinishDisplaying { 25 | 26 | if (!self.startDate) { 27 | return YES; 28 | } 29 | NSTimeInterval timeInterval = [[NSDate date] timeIntervalSinceDate:self.startDate]; 30 | //每一个VSYNC16ms 31 | return timeInterval*1000 + 10 >= self.duration; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGVAPMaskInfo.h: -------------------------------------------------------------------------------- 1 | // QGVAPMaskInfo.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import 18 | #import 19 | 20 | typedef NSUInteger QGVAPMaskValues; 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | // 如果要更新data、rect、size必须重新创建QGVAPMaskInfo对象 25 | @interface QGVAPMaskInfo : NSObject 26 | 27 | /** mask数据 0/1 Byte */ 28 | @property (nonatomic, strong) NSData *data; 29 | /** 采样范围 与datasize单位一致 */ 30 | @property (nonatomic, assign) CGRect sampleRect; 31 | /** mask 大小 单位pixel */ 32 | @property (nonatomic, assign) CGSize dataSize; 33 | /** 模糊范围,单位pixel */ 34 | @property (nonatomic, assign) NSInteger blurLength; 35 | /** mask纹理 */ 36 | @property (nonatomic, strong, readonly) id texture; 37 | 38 | @end 39 | 40 | NS_ASSUME_NONNULL_END 41 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGVAPTextureLoader.h: -------------------------------------------------------------------------------- 1 | // QGVAPTextureLoader.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import 18 | 19 | @interface QGVAPTextureLoader : NSObject 20 | 21 | + (id)loadVapColorFillBufferWith:(UIColor *)color device:(id)device; 22 | 23 | + (id)loadTextureWithImage:(UIImage *)image device:(id)device; 24 | 25 | + (id)loadTextureWithData:(NSData *)data device:(id)device width:(CGFloat)width height:(CGFloat)height; 26 | 27 | + (UIImage *)drawingImageForText:(NSString *)textStr color:(UIColor *)color size:(CGSize)size bold:(BOOL)bold; 28 | 29 | + (UIFont *)getAppropriateFontWith:(NSString *)text rect:(CGRect)fitFrame designedSize:(CGFloat)designedFontSize bold:(BOOL)isBold textSize:(CGSize *)textSize; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/MyUtils/NSArray+Utils.m: -------------------------------------------------------------------------------- 1 | // NSArray+Utils.m 2 | // dkhelperDylib 3 | // Created by DKJone on 2020/9/27 4 | // Copyright © 2020 DKJone. All rights reserved. 5 | // 6 | // 7 | // ██████╗ ██╗ ██╗ ██╗ ██████╗ ███╗ ██╗███████╗ 8 | // ██╔══██╗██║ ██╔╝ ██║██╔═══██╗████╗ ██║██╔════╝ 9 | // ██║ ██║█████╔╝ ██║██║ ██║██╔██╗ ██║█████╗ 10 | // ██║ ██║██╔═██╗ ██ ██║██║ ██║██║╚██╗██║██╔══╝ 11 | // ██████╔╝██║ ██╗╚█████╔╝╚██████╔╝██║ ╚████║███████╗ 12 | // ╚═════╝ ╚═╝ ╚═╝ ╚════╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝ 13 | // 14 | // 15 | 16 | #import "NSArray+Utils.h" 17 | 18 | @implementation NSArray (Utils) 19 | - (NSArray *)_map:(id(^)(id))hanlde { 20 | if (!hanlde || !self) return self; 21 | 22 | NSMutableArray *arr = NSMutableArray.array; 23 | for (id obj in self) { 24 | id new = hanlde(obj); 25 | [arr addObject:new]; 26 | } 27 | return arr.copy; 28 | } 29 | 30 | - (NSArray *)_filter:(BOOL(^)(id))handle { 31 | if (!handle || !self) return self; 32 | 33 | NSMutableArray *arr = NSMutableArray.array; 34 | for (id obj in self) { 35 | if (handle(obj)) { 36 | [arr addObject:obj]; 37 | } 38 | } 39 | return arr.copy; 40 | } 41 | 42 | - (BOOL)_contains:(BOOL(^)(id))handle { 43 | if (!handle || !self) return self; 44 | for (id obj in self) { 45 | if (handle(obj)) { 46 | return true; 47 | } 48 | } 49 | return false; 50 | } 51 | 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Views/OpenGL/QGHWDMP4OpenGLView.h: -------------------------------------------------------------------------------- 1 | // QGHWDMP4OpenGLView.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import 18 | #import 19 | #import "UIView+VAP.h" 20 | 21 | @protocol QGHWDMP4OpenGLViewDelegate 22 | 23 | - (void)onViewUnavailableStatus; 24 | 25 | @end 26 | 27 | @interface QGHWDMP4OpenGLView : UIView 28 | 29 | @property (nonatomic, strong) EAGLContext *glContext; 30 | @property (nonatomic, weak) id displayDelegate; 31 | @property (nonatomic, assign) QGHWDTextureBlendMode blendMode; 32 | @property (nonatomic, assign) BOOL pause; 33 | 34 | - (void)setupGL; 35 | - (void)displayPixelBuffer:(CVPixelBufferRef)pixelBuffer; 36 | - (void)dispose; 37 | 38 | //update glcontext's viewport size by layer bounds 39 | - (void)updateBackingSize; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/wechatHeaders/MMUICommonUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. 5 | // 6 | 7 | #import 8 | @interface MMUICommonUtil : NSObject 9 | { 10 | } 11 | 12 | + (id)getBottomBarButtonWithTitle:(id)arg1 backgroundImageName:(id)arg2 widthMargin:(double)arg3 target:(id)arg4 action:(SEL)arg5; 13 | + (id)getBottomBarButtonWithTitle:(id)arg1 target:(id)arg2 action:(SEL)arg3 style:(unsigned long long)arg4; 14 | + (id)getBarButtonWithImage:(id)arg1 withHighlightedImage:(id)arg2 withDisabledImage:(id)arg3 withBackGroundImage:(id)arg4 withBackGroundImageHL:(id)arg5 withBackGroundImageDisable:(id)arg6 target:(id)arg7 action:(SEL)arg8 style:(unsigned long long)arg9 accessibilityStr:(id)arg10; 15 | + (id)getBarButtonWithImage:(id)arg1 target:(id)arg2 action:(SEL)arg3 style:(unsigned long long)arg4 accessibility:(id)arg5 color:(id)arg6; 16 | + (id)getBarButtonWithImageName:(id)arg1 target:(id)arg2 action:(SEL)arg3 style:(unsigned long long)arg4 accessibility:(id)arg5 color:(id)arg6; 17 | + (id)getBarButtonWithImageName:(id)arg1 target:(id)arg2 action:(SEL)arg3 style:(unsigned long long)arg4 accessibility:(id)arg5; 18 | + (id)getBarButtonWithTitle:(id)arg1 target:(id)arg2 action:(SEL)arg3 style:(unsigned long long)arg4 maxWidth:(double)arg5 color:(id)arg6; 19 | + (id)getBarButtonWithTitle:(id)arg1 target:(id)arg2 action:(SEL)arg3 style:(unsigned long long)arg4 color:(id)arg5; 20 | + (id)getBarButtonWithTitle:(id)arg1 target:(id)arg2 action:(SEL)arg3 style:(unsigned long long)arg4; 21 | + (void)setBottomBarButtonTitleColor:(id)arg1 withStyle:(unsigned long long)arg2; 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/Decoders/QGMP4FrameHWDecoder.h: -------------------------------------------------------------------------------- 1 | // QGMP4FrameHWDecoder.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGBaseDecoder.h" 17 | #import "QGMP4HWDFileInfo.h" 18 | #import 19 | 20 | /* 数字跳动的动画类型*/ 21 | typedef NS_ENUM(NSInteger, QGMP4HWDErrorCode){ 22 | 23 | QGMP4HWDErrorCode_FileNotExist = 10000, // 文件不存在 24 | QGMP4HWDErrorCode_InvalidMP4File = 10001, // 非法的mp4文件 25 | QGMP4HWDErrorCode_CanNotGetStreamInfo = 10002, // 无法获取视频流信息 26 | QGMP4HWDErrorCode_CanNotGetStream = 10003, // 无法获取视频流 27 | QGMP4HWDErrorCode_ErrorCreateVTBDesc = 10004, // 创建desc失败 28 | QGMP4HWDErrorCode_ErrorCreateVTBSession = 10005, // 创建session失败 29 | }; 30 | 31 | @interface UIDevice (HWD) 32 | 33 | - (BOOL)hwd_isSimulator; 34 | 35 | @end 36 | 37 | @interface QGMP4FrameHWDecoder : QGBaseDecoder 38 | 39 | 40 | + (NSString *)errorDescriptionForCode:(QGMP4HWDErrorCode)errorCode; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Views/Metal/Vapx/QGVAPMetalRenderer.h: -------------------------------------------------------------------------------- 1 | // QGVAPMetalRenderer.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import "QGVAPConfigModel.h" 18 | #import 19 | #import "VAPMacros.h" 20 | 21 | #if TARGET_OS_SIMULATOR//模拟器 22 | 23 | @interface QGVAPMetalRenderer : NSObject 24 | 25 | @property (nonatomic, strong) QGVAPCommonInfo *commonInfo; 26 | 27 | - (instancetype)initWithMetalLayer:(id)layer; 28 | - (void)renderPixelBuffer:(CVPixelBufferRef)pixelBuffer metalLayer:(id)layer mergeInfos:(NSArray *)infos; 29 | - (void)dispose; 30 | 31 | @end 32 | 33 | #else 34 | 35 | @interface QGVAPMetalRenderer : NSObject 36 | 37 | @property (nonatomic, strong) QGVAPCommonInfo *commonInfo; 38 | @property (nonatomic, strong) QGVAPMaskInfo *maskInfo; 39 | 40 | - (instancetype)initWithMetalLayer:(CAMetalLayer *)layer; 41 | 42 | - (void)renderPixelBuffer:(CVPixelBufferRef)pixelBuffer metalLayer:(CAMetalLayer *)layer mergeInfos:(NSArray *)infos; 43 | 44 | - (void)dispose; 45 | 46 | @end 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/QGVAPWeakProxy.m: -------------------------------------------------------------------------------- 1 | // QGVAPWeakProxy.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGVAPWeakProxy.h" 17 | 18 | @implementation QGVAPWeakProxy { 19 | __weak id _target; 20 | } 21 | 22 | - (instancetype)initWithTarget:(id)target { 23 | if (self = [super init]) { 24 | _target = target; 25 | } 26 | return self; 27 | } 28 | 29 | + (instancetype)proxyWithTarget:(id)target { 30 | return [[QGVAPWeakProxy alloc] initWithTarget:target]; 31 | } 32 | 33 | // 1. 快速消息转发 34 | - (id)forwardingTargetForSelector:(SEL)aSelector { 35 | return _target; 36 | } 37 | 38 | // 2. 如果<1>返回nil,到标准消息转发处理,如果不处理为Crash:unrecognized selector. 这里我们直接返回空指针地址. 39 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector { 40 | return [NSObject instanceMethodSignatureForSelector:@selector(init)]; 41 | } 42 | 43 | - (void)forwardInvocation:(NSInvocation *)anInvocation { 44 | void *null = NULL; 45 | [anInvocation setReturnValue:&null]; 46 | } 47 | 48 | - (BOOL)respondsToSelector:(SEL)aSelector { 49 | return [_target respondsToSelector:aSelector]; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/QGVAPConfigManager.h: -------------------------------------------------------------------------------- 1 | // QGVAPConfigManager.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import "QGMP4HWDFileInfo.h" 18 | #import "QGVAPConfigModel.h" 19 | #import "VAPMacros.h" 20 | 21 | @class QGVAPSourceInfo; 22 | @protocol QGVAPConfigDelegate 23 | 24 | - (void)onVAPConfigResourcesLoaded:(QGVAPConfigModel *)config error:(NSError *)error; 25 | 26 | @optional 27 | - (NSString *)vap_contentForTag:(NSString *)tag resource:(QGVAPSourceInfo *)info; //替换配置中的资源占位符(不处理直接返回tag) 28 | - (void)vap_loadImageWithURL:(NSString *)urlStr context:(NSDictionary *)context completion:(VAPImageCompletionBlock)completionBlock; 29 | 30 | @end 31 | 32 | @interface QGVAPConfigManager : NSObject 33 | 34 | @property (nonatomic, weak) id delegate; 35 | @property (nonatomic, assign) BOOL hasValidConfig; 36 | @property (nonatomic, strong) QGVAPConfigModel *model; 37 | 38 | - (instancetype)initWith:(QGMP4HWDFileInfo *)fileInfo; 39 | - (void)loadConfigResources; 40 | - (void)loadMTLTextures:(id)device; 41 | - (void)loadMTLBuffers:(id)device; 42 | 43 | @end 44 | 45 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/QGAnimatedImageDecodeManager.h: -------------------------------------------------------------------------------- 1 | // QGAnimatedImageDecodeManager.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import "QGBaseDecoder.h" 18 | #import "QGBaseAnimatedImageFrame.h" 19 | #import "QGAnimatedImageDecodeConfig.h" 20 | 21 | @class QGAnimatedImageDecodeManager; 22 | @protocol QGAnimatedImageDecoderDelegate 23 | 24 | /** 25 | 必须实现该方法 用以实例化解码器 26 | 27 | @param manager 解码控制器 28 | @return class 29 | */ 30 | - (Class)decoderClassForManager:(QGAnimatedImageDecodeManager *)manager; 31 | 32 | @optional 33 | 34 | /** 35 | 到文件末尾时被调用 36 | 37 | @param decoder 解码器 38 | */ 39 | - (void)decoderDidFinishDecode:(QGBaseDecoder *)decoder; 40 | 41 | - (void)decoderDidFailDecode:(QGBaseDecoder *)decoder error:(NSError *)error; 42 | 43 | @end 44 | 45 | @interface QGAnimatedImageDecodeManager : NSObject 46 | 47 | @property (nonatomic, weak) id decoderDelegate; 48 | 49 | - (instancetype)initWith:(QGBaseDFileInfo *)fileInfo 50 | config:(QGAnimatedImageDecodeConfig *)config 51 | delegate:(id)delegate; 52 | 53 | - (QGBaseAnimatedImageFrame *)consumeDecodedFrame:(NSInteger)frameIndex; 54 | 55 | - (void)tryToStartAudioPlay; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/Decoders/QGBaseDecoder.m: -------------------------------------------------------------------------------- 1 | // QGBaseDecoder.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGBaseDecoder.h" 17 | #import "QGAnimatedImageDecodeThreadPool.h" 18 | 19 | @interface QGBaseDecoder() { 20 | 21 | QGBaseDFileInfo *_fileInfo; 22 | } 23 | 24 | @end 25 | 26 | @implementation QGBaseDecoder 27 | 28 | - (instancetype)initWith:(QGBaseDFileInfo *)fileInfo error:(NSError **)error { 29 | 30 | if (self = [super init]) { 31 | _currentDecodeFrame = -1; 32 | _fileInfo = fileInfo; 33 | _fileInfo.occupiedCount ++; 34 | } 35 | return self; 36 | } 37 | 38 | - (QGBaseDFileInfo *)fileInfo { 39 | 40 | return _fileInfo; 41 | } 42 | 43 | /** 44 | 由具体子类实现 45 | 该方法在decodeframe方法即将被调用时调用,如果返回YES则停止解码工作 46 | 47 | @param nextFrameIndex 将要解码的帧索引 48 | @return 是否需要继续解码 49 | */ 50 | - (BOOL)shouldStopDecode:(NSInteger)nextFrameIndex { 51 | // No implementation here. Meant to be overriden in subclass. 52 | return NO; 53 | } 54 | 55 | - (BOOL)isFrameIndexBeyondEnd:(NSInteger)frameIndex { 56 | 57 | return NO; 58 | } 59 | 60 | /** 61 | 在专用线程内解码指定帧并放入对应的缓冲区内 62 | 63 | @param frameIndex 帧索引 64 | @param buffers 缓冲 65 | */ 66 | - (void)decodeFrame:(NSInteger)frameIndex buffers:(NSMutableArray *)buffers { 67 | // No implementation here. Meant to be overriden in subclass. 68 | } 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Views/Metal/QGHWDMetalRenderer.h: -------------------------------------------------------------------------------- 1 | // QGHWDMetalRenderer.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import 18 | #import "VAPMacros.h" 19 | 20 | UIKIT_EXTERN NSString *const kHWDVertexFunctionName; 21 | UIKIT_EXTERN NSString *const kHWDYUVFragmentFunctionName; 22 | extern matrix_float3x3 const kColorConversionMatrix601Default; 23 | extern matrix_float3x3 const kColorConversionMatrix601FullRangeDefault; 24 | extern matrix_float3x3 const kColorConversionMatrix709Default; 25 | extern matrix_float3x3 const kColorConversionMatrix709FullRangeDefault; 26 | extern matrix_float3x3 const kBlurWeightMatrixDefault; 27 | extern id kQGHWDMetalRendererDevice; 28 | 29 | #if TARGET_OS_SIMULATOR//模拟器 30 | 31 | @interface QGHWDMetalRenderer : NSObject 32 | 33 | @property (nonatomic, assign) QGHWDTextureBlendMode blendMode; 34 | 35 | - (instancetype)initWithMetalLayer:(id)layer blendMode:(QGHWDTextureBlendMode)mode; 36 | - (void)renderPixelBuffer:(CVPixelBufferRef)pixelBuffer metalLayer:(id)layer; 37 | - (void)dispose; 38 | 39 | @end 40 | #else 41 | 42 | @interface QGHWDMetalRenderer : NSObject 43 | 44 | @property (nonatomic, assign) QGHWDTextureBlendMode blendMode; 45 | 46 | - (instancetype)initWithMetalLayer:(CAMetalLayer *)layer blendMode:(QGHWDTextureBlendMode)mode; 47 | 48 | - (void)renderPixelBuffer:(CVPixelBufferRef)pixelBuffer metalLayer:(CAMetalLayer *)layer; 49 | 50 | - (void)dispose; 51 | 52 | @end 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/Shaders/QGHWDShaderTypes.h: -------------------------------------------------------------------------------- 1 | // QGHWDShaderTypes.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #ifndef QGHWDShaderTypes_h 17 | #define QGHWDShaderTypes_h 18 | 19 | /* 20 | 请注意:更新本文件后请同步到QGHWDMetalShaderSourceDefine.h 21 | */ 22 | #import 23 | 24 | typedef struct { 25 | packed_float4 position; 26 | packed_float2 textureColorCoordinate; 27 | packed_float2 textureAlphaCoordinate; 28 | } QGHWDVertex; 29 | 30 | typedef struct { 31 | packed_float4 position; 32 | packed_float2 textureColorCoordinate; 33 | packed_float2 textureAlphaCoordinate; 34 | packed_float2 textureMaskCoordinate; 35 | } QGVAPVertex; 36 | 37 | struct ColorParameters { 38 | 39 | matrix_float3x3 matrix; 40 | packed_float2 offset; 41 | }; 42 | 43 | struct MaskParameters { 44 | matrix_float3x3 weightMatrix; 45 | int coreSize; 46 | float texelOffset; 47 | }; 48 | 49 | struct VapAttachmentFragmentParameter { 50 | 51 | int needOriginRGB; 52 | packed_float4 fillColor; 53 | }; 54 | 55 | typedef struct { 56 | packed_float4 position; 57 | packed_float2 sourceTextureCoordinate; 58 | packed_float2 maskTextureCoordinate; 59 | } QGHWDAttachmentVertex; 60 | 61 | typedef enum QGHWDYUVFragmentTextureIndex { 62 | 63 | QGHWDYUVFragmentTextureIndexLuma = 0, 64 | QGHWDYUVFragmentTextureIndexChroma = 1, 65 | QGHWDYUVFragmentTextureIndexAttachmentStart = 2, 66 | } QGHWDYUVFragmentTextureIndex; 67 | 68 | #endif /* QGHWDShaderTypes_h */ 69 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/wechatHeaders/UiUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. 5 | // 6 | 7 | #import 8 | 9 | @interface UiUtil : NSObject 10 | { 11 | } 12 | 13 | + (void)showCameraAlertForSplitViewIfNeed:(id)arg1 currentWidth:(double)arg2; 14 | + (_Bool)isiPadSplitViewModeNow; 15 | + (_Bool)isiPadSplitViewMinimizeModeNow; 16 | + (void)setStatusBarStyle:(long long)arg1 viewController:(id)arg2; 17 | + (void)setStatusBarStyle:(long long)arg1; 18 | + (void)setStatusBarFontBlack; 19 | + (void)setStatusBarFontWhite; 20 | + (_Bool)hasRoundCorner; 21 | + (double)bottomInset; 22 | + (double)tabBarContentHeight; 23 | + (double)tabBarHeight; 24 | + (double)topBarNormalOffset; 25 | + (_Bool)isTopBarInNormalState; 26 | + (double)keyboardHeightByNotification:(id)arg1; 27 | + (void)setTopBarHidden:(_Bool)arg1 withAnimation:(long long)arg2; 28 | + (void)setTopBarHidden:(_Bool)arg1; 29 | + (_Bool)isTopBarHidden; 30 | + (long long)getRotatedOrientation; 31 | + (void)setStatusBarHidden:(_Bool)arg1 withAnimation:(long long)arg2; 32 | + (void)setStatusBarHidden:(_Bool)arg1; 33 | + (_Bool)isStatusBarLandscape; 34 | + (_Bool)isStatusBarHidden; 35 | + (void)OnSystemStatusBarFrameChange; 36 | + (void)OnSystemStatusBarOrientationChange:(long long)arg1; 37 | + (id)mainWindow; 38 | + (double)visibleHeight:(id)arg1; 39 | + (struct CGRect)windowBoundsOri:(long long)arg1; 40 | + (struct CGRect)screenBoundsOri:(long long)arg1; 41 | + (struct CGRect)screenBounds; 42 | + (struct CGSize)screenSizeOri:(long long)arg1; 43 | + (struct CGSize)screenSize; 44 | + (double)mainScreenWidth; 45 | + (double)deviceScreenWidth:(long long)arg1; 46 | + (double)screenWidth:(long long)arg1; 47 | + (double)deviceScreenWidth; 48 | + (double)windowWidth; 49 | + (double)screenWidthCurOri; 50 | + (double)screenHeight:(long long)arg1; 51 | + (double)screenHeightCurOri; 52 | + (double)navigationBarHeight:(long long)arg1; 53 | + (double)navigationBarHeightCurOri; 54 | + (double)navigationBarHeight; 55 | + (double)statusBarHeight:(long long)arg1; 56 | + (double)statusBarHeight; 57 | + (double)normalStatusBarHeight; 58 | 59 | @end 60 | 61 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/QGVAPMetalUtil.h: -------------------------------------------------------------------------------- 1 | // QGVAPMetalUtil.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | UIKIT_EXTERN NSString *const kHWDAttachmentVertexFunctionName; 19 | UIKIT_EXTERN NSString *const kVAPAttachmentVertexFunctionName; 20 | UIKIT_EXTERN NSString *const kVAPAttachmentFragmentFunctionName; 21 | UIKIT_EXTERN NSString *const kVAPVertexFunctionName; 22 | UIKIT_EXTERN NSString *const kVAPYUVFragmentFunctionName; 23 | UIKIT_EXTERN NSString *const kVAPMaskFragmentFunctionName; 24 | UIKIT_EXTERN NSString *const kVAPMaskBlurFragmentFunctionName; 25 | 26 | extern float const kVAPMTLVerticesIdentity[16]; 27 | extern float const kVAPMTLTextureCoordinatesIdentity[8]; 28 | extern float const kVAPMTLTextureCoordinatesFor90[8]; 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | void genMTLVertices(CGRect rect, CGSize containerSize, float vertices[16], BOOL reverse); //生成顶点坐标 34 | void genMTLTextureCoordinates(CGRect rect, CGSize containerSize, float coordinates[8], BOOL reverse, NSInteger degree); //生成纹理坐标 35 | void replaceArrayElements(float arr0[], float arr1[], int size); //arr0[0...(size-1)] <- arr1[0...(size-1)] 36 | 37 | CGSize vapSourceSizeForCenterFull(CGSize sourceSize, CGSize renderSize); 38 | CGRect vapRectForCenterFull(CGSize sourceSize, CGSize renderSize); 39 | CGRect vapRectWithContentModeInsideRect(CGRect boundingRect, CGSize aspectRatio, UIViewContentMode contentMode); 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | @interface QGVAPMetalUtil : NSObject 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Logger/QGVAPLogger.m: -------------------------------------------------------------------------------- 1 | // QGVAPLogger.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGVAPLogger.h" 17 | 18 | QGVAPLoggerFunc external_VAP_Logger; 19 | 20 | @implementation QGVAPLogger 21 | 22 | #pragma mark - Extenral log 23 | 24 | void internal_VAP_Logger_handler(VAPLogLevel level, const char* file, int line, const char* func, NSString *module, NSString *format, ...) { 25 | 26 | #ifdef DEBUG 27 | va_list arg_list; 28 | va_start (arg_list, format); 29 | NSString *formattedString = [[NSString alloc] initWithFormat:format arguments:arg_list]; 30 | va_end(arg_list); 31 | file = [NSString stringWithUTF8String:file].lastPathComponent.UTF8String; 32 | NSLog(@"<%@> %s(%@):%s [%@] - %@",@(level), file, @(line), func, module, formattedString); 33 | #endif 34 | } 35 | 36 | + (void)registerExternalLog:(QGVAPLoggerFunc)externalLog { 37 | external_VAP_Logger = externalLog; 38 | } 39 | 40 | + (void)log:(VAPLogLevel)level file:(NSString *)file line:(NSInteger)line func:(NSString *)func module:(NSString *)module message:(NSString *)message { 41 | 42 | if ([message containsString:@"%"]) { 43 | //此处是为了兼容%进入formmat之后的crash风险 44 | [message stringByReplacingOccurrencesOfString:@"%" withString:@""]; 45 | } 46 | if (external_VAP_Logger) { 47 | external_VAP_Logger(level, file.UTF8String, (int)line, func.UTF8String, module, message); 48 | } else { 49 | internal_VAP_Logger_handler(level, file.UTF8String, (int)line, func.UTF8String, module, message); 50 | } 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /dkhelper/dkhelper.xcodeproj/project.xcworkspace/xcuserdata/zhudekun.xcuserdatad/xcdebugger/Expressions.xcexplist: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 19 | 21 | 22 | 24 | 25 | 26 | 27 | 29 | 30 | 32 | 33 | 34 | 35 | 37 | 38 | 40 | 41 | 42 | 43 | 45 | 46 | 48 | 49 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/QGAnimatedImageDecodeThreadPool.m: -------------------------------------------------------------------------------- 1 | // QGAnimatedImageDecodeThreadPool.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGAnimatedImageDecodeThreadPool.h" 17 | #import "QGAnimatedImageDecodeThread.h" 18 | #import "QGVAPSafeMutableArray.h" 19 | 20 | @interface QGAnimatedImageDecodeThreadPool (){ 21 | 22 | NSMutableArray *_threads; 23 | } 24 | 25 | @end 26 | 27 | @implementation QGAnimatedImageDecodeThreadPool 28 | 29 | + (instancetype)sharedPool { 30 | 31 | static QGAnimatedImageDecodeThreadPool *instance; 32 | static dispatch_once_t onceToken; 33 | dispatch_once(&onceToken, ^{ 34 | instance = [[QGAnimatedImageDecodeThreadPool alloc] init]; 35 | }); 36 | return instance; 37 | } 38 | 39 | - (instancetype)init { 40 | 41 | if (self = [super init]) { 42 | _threads = [QGVAPSafeMutableArray new]; 43 | } 44 | return self; 45 | } 46 | 47 | /** 48 | 从池子中找出没被占用的线程,如果没有则新建一个 49 | 50 | @return 解码线程 51 | */ 52 | - (QGAnimatedImageDecodeThread *)getDecodeThread { 53 | 54 | QGAnimatedImageDecodeThread *freeThread = nil; 55 | for (QGAnimatedImageDecodeThread *thread in _threads) { 56 | if (!thread.occupied) { 57 | freeThread = thread; 58 | } 59 | } 60 | if (!freeThread) { 61 | freeThread = [[QGAnimatedImageDecodeThread alloc] initWithTarget:self selector:@selector(run) object:nil]; 62 | [freeThread start]; 63 | [_threads addObject:freeThread]; 64 | } 65 | return freeThread; 66 | } 67 | 68 | - (void)run{ 69 | //线程保活 70 | @autoreleasepool { 71 | [[NSRunLoop currentRunLoop] addPort:[NSPort port] forMode:NSDefaultRunLoopMode]; 72 | NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; 73 | [runLoop run]; 74 | } 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/NSDictionary+VAPUtil.m: -------------------------------------------------------------------------------- 1 | // NSDictionary+VAPUtil.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "NSDictionary+VAPUtil.h" 17 | 18 | #define HWD_RETURN_VALUE(_type_, _default_) \ 19 | if (!key) return _default_; \ 20 | id value = self[key]; \ 21 | if (!value || value == [NSNull null]) return _default_; \ 22 | if ([value isKindOfClass:[NSNumber class]]) return ((NSNumber *)value)._type_; \ 23 | if ([value isKindOfClass:[NSString class]]) return ((NSString *)value)._type_; \ 24 | return _default_; 25 | 26 | @implementation NSDictionary (VAPUtil) 27 | 28 | - (CGFloat)hwd_floatValue:(NSString *)key { 29 | HWD_RETURN_VALUE(floatValue, 0.0); 30 | } 31 | 32 | - (NSInteger)hwd_integerValue:(NSString *)key { 33 | HWD_RETURN_VALUE(integerValue, 0); 34 | } 35 | 36 | - (NSString *)hwd_stringValue:(NSString *)key { 37 | 38 | NSString *defaultValue = @""; 39 | if (!key) return defaultValue; 40 | id value = self[key]; 41 | if (!value || value == [NSNull null]) return defaultValue; 42 | if ([value isKindOfClass:[NSString class]]) return value; 43 | if ([value isKindOfClass:[NSNumber class]]) return ((NSNumber *)value).description; 44 | return defaultValue; 45 | } 46 | 47 | - (NSDictionary *)hwd_dicValue:(NSString *)key { 48 | 49 | if (!key) { 50 | return nil; 51 | } 52 | id value = self[key]; 53 | if (![value isKindOfClass:[NSDictionary class]]) { 54 | return nil; 55 | } 56 | return value; 57 | } 58 | 59 | - (NSArray *)hwd_arrValue:(NSString *)key { 60 | 61 | if (!key) { 62 | return nil; 63 | } 64 | id value = self[key]; 65 | if (![value isKindOfClass:[NSArray class]]) { 66 | return nil; 67 | } 68 | return value; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Views/Metal/QGHWDMetalView.h: -------------------------------------------------------------------------------- 1 | // QGHWDMetalView.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import "VAPMacros.h" 18 | 19 | //https://developer.apple.com/library/archive/documentation/Miscellaneous/Conceptual/MetalProgrammingGuide/Device/Device.html#//apple_ref/doc/uid/TP40014221-CH2-SW1 20 | /* 21 | 2018-12-31 00:01:51.349229+0800 MetalTest[28134:2050088] [DYMTLInitPlatform] platform initialization successful 22 | 2018-12-31 00:01:51.413574+0800 MetalTest[28134:2050043] Metal GPU Frame Capture Enabled 23 | 2018-12-31 00:01:51.414037+0800 MetalTest[28134:2050043] Metal API Validation Enabled 24 | 2018-12-31 00:01:54.008682+0800 MetalTest[28134:2050086] Execution of the command buffer was aborted due to an error during execution. Insufficient Permission (to submit GPU work from background) (IOAF code 6) 25 | 2018-12-31 00:01:54.009053+0800 MetalTest[28134:2050086] Execution of the command buffer was aborted due to an error during execution. Insufficient Permission (to submit GPU work from background) (IOAF code 6) 26 | 2018-12-31 00:01:54.011370+0800 MetalTest[28134:2050086] Execution of the command buffer was aborted due to an error during execution. Insufficient Permission (to submit GPU work from background) (IOAF code 6) 27 | 2018-12-31 00:01:54.011710+0800 MetalTest[28134:2050086] Execution of the command buffer was aborted due to an error during execution. Insufficient Permission (to submit GPU work from background) (IOAF code 6) 28 | */ 29 | @protocol QGHWDMetelViewDelegate 30 | 31 | - (void)onMetalViewUnavailable; 32 | 33 | @end 34 | 35 | @interface QGHWDMetalView : UIView 36 | 37 | @property (nonatomic, weak) id delegate; 38 | @property (nonatomic, assign) QGHWDTextureBlendMode blendMode; 39 | 40 | - (instancetype)initWithFrame:(CGRect)frame blendMode:(QGHWDTextureBlendMode)mode; 41 | 42 | - (void)display:(CVPixelBufferRef)pixelBuffer; 43 | 44 | - (void)dispose; 45 | 46 | @end 47 | 48 | -------------------------------------------------------------------------------- /dkhelper/dkhelper.xcodeproj/xcshareddata/xcschemes/dkhelperDylib.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/MP4Parser/QGMP4Parser.h: -------------------------------------------------------------------------------- 1 | // QGMP4Parser.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import "QGMP4Box.h" 18 | 19 | @class QGMP4Parser; 20 | @protocol QGMP4ParserDelegate 21 | 22 | @optional 23 | - (void)didParseMP4Box:(QGMP4Box *)box parser:(QGMP4Parser *)parser; 24 | - (void)MP4FileDidFinishParse:(QGMP4Parser *)parser; 25 | 26 | @end 27 | 28 | @interface QGMP4Parser : NSObject 29 | 30 | @property (nonatomic, strong) QGMP4Box *rootBox; 31 | @property (nonatomic, strong) NSFileHandle *fileHandle; 32 | @property (nonatomic, weak) id delegate; 33 | 34 | - (instancetype)initWithFilePath:(NSString *)filePath; 35 | - (void)parse; 36 | - (NSData *)readDataForBox:(QGMP4Box *)box; 37 | - (NSInteger)readValue:(const char*)bytes length:(NSInteger)length; 38 | 39 | @end 40 | 41 | @interface QGMP4ParserProxy : NSObject 42 | 43 | - (instancetype)initWithFilePath:(NSString *)filePath; 44 | 45 | @property (nonatomic, assign) NSInteger picWidth; //视频宽度 46 | @property (nonatomic, assign) NSInteger picHeight; //视频高度 47 | @property (nonatomic, assign) NSInteger fps; //视频fps 48 | @property (nonatomic, assign) double duration; //视频时长 49 | @property (nonatomic, strong) NSData *spsData; //sps 50 | @property (nonatomic, strong) NSData *ppsData; //pps 51 | @property (nonatomic, strong) NSArray *videoSamples; //所有帧数据,包含了位置和大小等信息 52 | @property (nonatomic, strong) QGMP4Box *rootBox; //mp4文件根box 53 | @property (nonatomic, strong) QGMP4TrackBox *videoTrackBox; //视频track 54 | @property (nonatomic, strong) QGMP4TrackBox *audioTrackBox; //音频track 55 | /** vps */ 56 | @property (nonatomic, strong) NSData *vpsData; 57 | /** 视频流编码器ID类型 */ 58 | @property (nonatomic, assign) QGMP4VideoStreamCodecID videoCodecID; 59 | 60 | - (void)parse; 61 | - (NSData *)readPacketOfSample:(NSInteger)sampleIndex; 62 | - (NSData *)readDataOfBox:(QGMP4Box *)box length:(NSInteger)length offset:(NSInteger)offset; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/MyUtils/DKLaunchHelper.h: -------------------------------------------------------------------------------- 1 | // DKLaunchHelper.h 2 | // launchDemo 3 | // Created by ___ORGANIZATIONNAME___ on 2021/1/18 4 | // 5 | // 6 | // 7 | // ██████╗ ██╗ ██╗ ██╗ ██████╗ ███╗ ██╗███████╗ 8 | // ██╔══██╗██║ ██╔╝ ██║██╔═══██╗████╗ ██║██╔════╝ 9 | // ██║ ██║█████╔╝ ██║██║ ██║██╔██╗ ██║█████╗ 10 | // ██║ ██║██╔═██╗ ██ ██║██║ ██║██║╚██╗██║██╔══╝ 11 | // ██████╔╝██║ ██╗╚█████╔╝╚██████╔╝██║ ╚████║███████╗ 12 | // ╚═════╝ ╚═╝ ╚═╝ ╚════╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝ 13 | // 14 | // 15 | 16 | #import 17 | #import 18 | #import "QGVAPlayer.h" 19 | 20 | @interface DKLaunchHelper : NSObject 21 | + (void)clearLaunchScreenCache; 22 | + (NSArray*> *)animaNames; 23 | @end 24 | 25 | /// 自定义校验规则,originImage为原始系统缓存启动图,yourImage为替代的启动图,返回YES代表本次替换,否则本次不会进行替换 26 | typedef BOOL(^BBACustomValicationBlock)(UIImage *originImage, UIImage *yourImage); 27 | 28 | /** 29 | 动态启动图(请确保替换的图片尺寸与屏幕分辨率一致,否则替换不成功) 30 | */ 31 | @interface BBADynamicLaunchImage : NSObject 32 | 33 | /// 替换系统缓存启动图,图片压缩质量默认0.8,覆盖原有系统启动图文件 34 | /// @param replacementImage 替代图片 35 | /// @return 替换是否成功 36 | + (BOOL)replaceLaunchImage:(UIImage *)replacementImage; 37 | 38 | /// 替换系统缓存启动图,将替换图片以指定的压缩质量写入系统启动图缓存目录,覆盖原有系统启动图文件 39 | /// @param replacementImage 替代图片 40 | /// @param quality 压缩质量 41 | /// @return 替换是否成功 42 | + (BOOL)replaceLaunchImage:(UIImage *)replacementImage compressionQuality:(CGFloat)quality; 43 | 44 | /// 替换系统缓存启动图,按自定义的校验规则将替代图片以指定的压缩质量写入系统启动图缓存目录,覆盖原有系统启动图文件 45 | /// @param replacementImage 替代图片 46 | /// @param quality 压缩质量 47 | /// @param validationBlock 自定义校验回调,校验通过表示本次替换,否则不替换 48 | /// @return 替换是否成功 49 | + (BOOL)replaceLaunchImage:(UIImage *)replacementImage 50 | compressionQuality:(CGFloat)quality 51 | customValidation:(BBACustomValicationBlock)validationBlock; 52 | 53 | 54 | 55 | /// 获取image对象 56 | + (UIImage *)imageFromData:(NSData *)data; 57 | 58 | /// 获取图片大小 59 | + (CGSize)getImageSize:(NSData *)imageData; 60 | 61 | @end 62 | 63 | 64 | @interface LaunchImageHelper : NSObject 65 | 66 | + (UIImage *)snapshotStoryboardForPortrait:(NSString *)sbName; 67 | + (UIImage *)snapshotStoryboardForLandscape:(NSString *)sbName; 68 | 69 | /// 替换所有的启动图为竖屏 70 | + (void)changeAllLaunchImageToPortrait:(UIImage *)image; 71 | /// 替换所有的启动图为横屏 72 | + (void)changeAllLaunchImageToLandscape:(UIImage *)image; 73 | /// 使用单独的图片分别替换竖、横屏启动图 74 | + (void)changePortraitLaunchImage:(UIImage *)portraitImage 75 | landscapeLaunchImage:(UIImage *)landScapeImage; 76 | 77 | @end 78 | 79 | 80 | @interface UIView (DKScreenShoot) 81 | 82 | - (UIImage *)dkScreenShoot; 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # DKWechatHelper ChangeLog 2 | 3 | [v1.1.0](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.1.0) / 2023-06-21 4 | what's new 5 | * 支持8.0.38 6 | * 更新越狱包8.0.38 7 | * 更新已注入助手的8.0.38未签名包 8 | * 更新越狱源安装包 9 | 10 | [v1.0.9](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.9) / 2021-09-15 11 | what's new 12 | * 好友检测改为通过请求是否可以转账进行判断 13 | * 动态启动图资源改为下载 14 | * 支持8.0.13 15 | * 更新越狱包8.0.13 16 | * 更新已注入助手的8.0.13未签名包 17 | * 更新越狱源安装包 18 | [v1.0.8](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.8) / 2021-05-20 19 | what's new 20 | * 动态启动图黑屏修复(#65,#66) 21 | * 支持8.0.6 22 | * 更新越狱包8.0.6 23 | * 更新已注入助手的8.0.6未签名包 24 | * 更新越狱源安装包 25 | 26 | [v1.0.7](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.7) / 2021-01-29 27 | what's new 28 | * 动态启动图 29 | * 动态聊天背景 30 | * 支持8.0.1 31 | * 更新越狱包8.0.1 32 | * 更新已注入助手的8.0.1未签名包 33 | * 更新越狱源安装包 34 | 35 | [v1.0.6](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.6) / 2020-10-16 36 | what's new 37 | * 朋友圈转发 38 | * 支持7.0.17 39 | * 更新越狱包7.0.17 40 | * 更新已注入助手的7.0.17未签名包 41 | * 更新越狱源安装包 42 | 43 | [v1.0.5](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.5) / 2020-09-29 44 | what's new 45 | * 新增好友关系检测 46 | * 新增自动收取个人红包 47 | * 修复集赞助手自定义评论时可能会发生闪退的BUG 48 | * 支持7.0.15 49 | * 更新越狱包7.0.15 50 | * 更新已注入助手的7.0.15未签名包 51 | * 更新越狱源安装包 52 | 53 | [v1.0.4](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.4) / 2020-07-07 54 | what's new 55 | * 新增集赞助手 56 | * 新增CallKit 57 | * 支持7.0.14 58 | * 更新越狱包7.0.14 59 | * 更新已注入助手的7.0.14未签名包 60 | * 增加越狱方式安装包 61 | * 新增越狱源安装 62 | 63 | [v1.0.3](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.3) / 2020-06-29 64 | what's new 65 | * 适配新版本微信 66 | * 支持7.0.13 67 | * 更新越狱包7.0.13 68 | * 更新已注入助手的7.0.13未签名包 69 | * 增加越狱方式安装包 70 | 71 | [v1.0.2](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.2) / 2020-01-29 72 | what's new 73 | * 修复请我喝咖啡闪退 74 | * 支持7.0.11 75 | * 更新越狱包7.0.11 76 | * 更新已注入助手的7.0.11未签名包 77 | 78 | 79 | [v1.0.1](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.1) / 2020-01-21 80 | what's new 81 | 82 | * 修复微信7.0.8~7.0.10设置步数和抢红包延迟闪退 83 | * 新增越狱包7.0.8、7.0.10 84 | * 新增已注入助手的7.0.10未签名包 85 | 86 | 87 | [v1.0.0](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.0) / 2019-02-06 88 | what's new 89 | 90 | * 修改获取NavigationController逻辑 91 | * 适配IPad设备 92 | * 修复IPad设备打开小助手闪退问题 93 | 94 | 95 | v0.0.1 / 2019-01-30 96 | what's new 97 | 98 | * 修改readme中砸壳APP链接,新增微信7.0.0链接 99 | 100 | 101 | v0.0.1 / 2019-01-23 102 | what's new 103 | 104 | * 初始化项目 105 | * 添加完整源代码 106 | 107 | 108 | v0.0.0 / 2019-01-22 109 | what's new 110 | 111 | * 创建项目,编写ReadMe文档 -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/UIColor+VAPUtil.m: -------------------------------------------------------------------------------- 1 | // UIColor+VAPUtil.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "UIColor+VAPUtil.h" 17 | 18 | @implementation UIColor (VAPUtil) 19 | 20 | static inline NSUInteger hwd_hexStrToInt(NSString *str) { 21 | uint32_t result = 0; 22 | sscanf([str UTF8String], "%X", &result); 23 | return result; 24 | } 25 | 26 | static BOOL hwd_hexStrToRGBA(NSString *str, 27 | CGFloat *r, CGFloat *g, CGFloat *b, CGFloat *a) { 28 | 29 | NSCharacterSet *cset = [NSCharacterSet whitespaceAndNewlineCharacterSet]; 30 | str = [[str stringByTrimmingCharactersInSet:cset] uppercaseString]; 31 | if ([str hasPrefix:@"#"]) { 32 | str = [str substringFromIndex:1]; 33 | } else if ([str hasPrefix:@"0X"]) { 34 | str = [str substringFromIndex:2]; 35 | } 36 | 37 | NSUInteger length = [str length]; 38 | //RGB||RGBA||RRGGBB||RRGGBBAA 39 | if (length != 3 && length != 4 && length != 6 && length != 8) { 40 | return NO; 41 | } 42 | if (length < 5) { 43 | *r = hwd_hexStrToInt([str substringWithRange:NSMakeRange(0, 1)]) / 255.0f; 44 | *g = hwd_hexStrToInt([str substringWithRange:NSMakeRange(1, 1)]) / 255.0f; 45 | *b = hwd_hexStrToInt([str substringWithRange:NSMakeRange(2, 1)]) / 255.0f; 46 | if (length == 4) *a = hwd_hexStrToInt([str substringWithRange:NSMakeRange(3, 1)]) / 255.0f; 47 | else *a = 1; 48 | } else { 49 | *r = hwd_hexStrToInt([str substringWithRange:NSMakeRange(0, 2)]) / 255.0f; 50 | *g = hwd_hexStrToInt([str substringWithRange:NSMakeRange(2, 2)]) / 255.0f; 51 | *b = hwd_hexStrToInt([str substringWithRange:NSMakeRange(4, 2)]) / 255.0f; 52 | if (length == 8) *a = hwd_hexStrToInt([str substringWithRange:NSMakeRange(6, 2)]) / 255.0f; 53 | else *a = 1; 54 | } 55 | return YES; 56 | } 57 | 58 | + (instancetype)hwd_colorWithHexString:(NSString *)hexStr { 59 | CGFloat r, g, b, a; 60 | if (hwd_hexStrToRGBA(hexStr, &r, &g, &b, &a)) { 61 | return [UIColor colorWithRed:r green:g blue:b alpha:a]; 62 | } 63 | return nil; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/UIGestureRecognizer+VAPUtil.m: -------------------------------------------------------------------------------- 1 | // UIGestureRecognizer+VAPUtil.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "UIGestureRecognizer+VAPUtil.h" 17 | #import 18 | #import "QGVAPSafeMutableArray.h" 19 | 20 | static const int vap_block_key; 21 | 22 | @interface _VAPUIGestureRecognizerBlockTarget : NSObject 23 | 24 | @property (nonatomic, copy) void (^block)(id sender); 25 | 26 | - (id)initWithBlock:(void (^)(id sender))block; 27 | - (void)invoke:(id)sender; 28 | 29 | @end 30 | 31 | @implementation _VAPUIGestureRecognizerBlockTarget 32 | 33 | - (id)initWithBlock:(void (^)(id sender))block{ 34 | 35 | if (self = [super init]) { 36 | _block = [block copy]; 37 | } 38 | return self; 39 | } 40 | 41 | - (void)invoke:(id)sender { 42 | if (_block) _block(sender); 43 | } 44 | 45 | @end 46 | 47 | @implementation UIGestureRecognizer (VAPUtil) 48 | 49 | - (instancetype)initWithVapActionBlock:(void (^)(id sender))block { 50 | 51 | if (self = [self init]) { 52 | [self addVapActionBlock:block]; 53 | } 54 | return self; 55 | } 56 | 57 | - (void)addVapActionBlock:(void (^)(id sender))block { 58 | 59 | _VAPUIGestureRecognizerBlockTarget *target = [[_VAPUIGestureRecognizerBlockTarget alloc] initWithBlock:block]; 60 | [self addTarget:target action:@selector(invoke:)]; 61 | NSMutableArray *targets = [self _vap_allUIGestureRecognizerBlockTargets]; 62 | [targets addObject:target]; 63 | } 64 | 65 | - (NSMutableArray *)_vap_allUIGestureRecognizerBlockTargets { 66 | 67 | NSMutableArray *targets = objc_getAssociatedObject(self, &vap_block_key); 68 | if (!targets) { 69 | targets = [QGVAPSafeMutableArray new]; 70 | objc_setAssociatedObject(self, &vap_block_key, targets, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 71 | } 72 | return targets; 73 | } 74 | 75 | - (void)removeAllVapActionBlocks { 76 | 77 | NSMutableArray *targets = [self _vap_allUIGestureRecognizerBlockTargets]; 78 | [targets enumerateObjectsUsingBlock:^(id target, NSUInteger idx, BOOL *stop) { 79 | [self removeTarget:target action:@selector(invoke:)]; 80 | }]; 81 | [targets removeAllObjects]; 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/Trace/OCMethodTrace.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OCMethodTrace.h 3 | * OCMethodTrace 4 | * 5 | * https://github.com/omxcodec/OCMethodTrace.git 6 | * 7 | * Copyright (C) 2018 Michael Chen 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #import 23 | 24 | // 方法跟踪条件block 25 | // @param sel 方法名 26 | typedef BOOL (^OMTConditionBlock)(SEL sel); 27 | 28 | // 方法调用前会调用该block 29 | // @param target 跟踪目标对象 30 | // @param cls 调用方法所在的类(可以是target所在的类,也可以是target的父类) 31 | // @param sel 方法名 32 | // @param args 参数列表 33 | // @param deep 调用层次 34 | typedef void (^OMTBeforeBlock)(id target, Class cls, SEL sel, NSArray *args, int deep); 35 | 36 | // 方法调用后会调用该block 37 | // @param target 跟踪目标对象 38 | // @param cls 调用方法所在的类(可以是target所在的类,也可以是target的父类) 39 | // @param sel 方法名 40 | // @param ret 返回值 41 | // @param deep 调用层次 42 | // @param interval 执行方法的ms耗时 43 | typedef void (^OMTAfterBlock)(id target, Class cls, SEL sel, id ret, int deep, NSTimeInterval interval); 44 | 45 | // target位置 46 | typedef NS_ENUM(NSUInteger, OMTTargetPosition) { 47 | OMTTargetPositionBeforeSelf = 0, // before-调用者self 48 | OMTTargetPositionBeforeArgument, // before-参数 49 | OMTTargetPositionAfterSelf, // after-调用者self 50 | OMTTargetPositionAfterReturnValue, // after-返回值 51 | OMTTargetPositionMax, 52 | }; 53 | 54 | // 日志级别 55 | typedef NS_ENUM(NSUInteger, OMTLogLevel) { 56 | OMTLogLevelError = 0, 57 | OMTLogLevelDebug, 58 | OMTLogLevelMax, 59 | }; 60 | 61 | @protocol OCMethodTraceDelegate 62 | 63 | @optional 64 | // 获取target的description回调 65 | - (NSString *)descriptionWithTarget:(id)target class:(Class)cls selector:(SEL)sel targetPosition:(OMTTargetPosition)targetPosition; 66 | // 日志回调 67 | - (void)log:(OMTLogLevel)level format:(NSString *)format, ... NS_FORMAT_FUNCTION(2,3); 68 | 69 | @end 70 | 71 | @interface OCMethodTrace : NSObject 72 | 73 | @property (nonatomic, assign) BOOL disableTrace; // 屏蔽before和after调用,hook完成后默认打开 74 | @property (nonatomic, weak) id delegate; // 回调 75 | @property (nonatomic, assign) OMTLogLevel logLevel; // 日志级别,默认OMTLogLevelDebug 76 | 77 | + (OCMethodTrace *)sharedInstance; 78 | 79 | // 跟踪打印目标(实例或类)方法调用 80 | // @param cls 跟踪打印目标类 81 | // @param condition 判断是否跟踪方法的block 82 | // @param before 被跟踪的方法调用前会调用该block 83 | // @param after 被跟踪的方法调用后会调用该block 84 | - (void)traceMethodWithClass:(Class)cls 85 | condition:(OMTConditionBlock)condition 86 | before:(OMTBeforeBlock)before 87 | after:(OMTAfterBlock)after; 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /dkhelper/dkhelper.xcodeproj/xcuserdata/zhudekun.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 21 | 22 | 23 | 25 | 37 | 38 | 39 | 41 | 53 | 54 | 55 | 57 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /dkhelper/dkhelper.xcodeproj/xcshareddata/xcschemes/dkhelper.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 44 | 46 | 52 | 53 | 54 | 55 | 61 | 63 | 69 | 70 | 71 | 72 | 74 | 75 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/QGAnimatedImageBufferManager.m: -------------------------------------------------------------------------------- 1 | // QGAnimatedImageBufferManager.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGAnimatedImageBufferManager.h" 17 | #import "QGVAPSafeMutableArray.h" 18 | 19 | @interface QGAnimatedImageBufferManager() { 20 | 21 | QGAnimatedImageDecodeConfig *_config; //解码配置 22 | } 23 | 24 | @end 25 | 26 | @implementation QGAnimatedImageBufferManager 27 | 28 | - (instancetype)initWithConfig:(QGAnimatedImageDecodeConfig *)config { 29 | 30 | if (self = [super init]) { 31 | _config = config; 32 | [self createBuffersWithConfig:config]; 33 | } 34 | return self; 35 | } 36 | 37 | - (void)createBuffersWithConfig:(QGAnimatedImageDecodeConfig *)config { 38 | _buffers = [[QGVAPSafeMutableArray alloc] initWithCapacity:config.bufferCount]; 39 | } 40 | 41 | /** 42 | 取出指定的在缓冲区的帧,若不存在于缓冲区则返回空 43 | 44 | @param frameIndex 目标帧索引 45 | @return 帧数据 46 | */ 47 | - (QGBaseAnimatedImageFrame *)getBufferedFrame:(NSInteger)frameIndex { 48 | 49 | if (_buffers.count == 0) { 50 | //NSLog(@"fail buffer is nil"); 51 | return nil; 52 | } 53 | NSInteger bufferIndex = frameIndex%_buffers.count; 54 | if (bufferIndex > _buffers.count-1) { 55 | //NSLog(@"fail"); 56 | return nil; 57 | } 58 | id frame = [_buffers objectAtIndex:bufferIndex]; 59 | if (![frame isKindOfClass:[QGBaseAnimatedImageFrame class]] || ([(QGBaseAnimatedImageFrame*)frame frameIndex] != frameIndex)) { 60 | return nil; 61 | } 62 | return frame; 63 | } 64 | 65 | - (QGBaseAnimatedImageFrame *)popVideoFrame { 66 | if (!_buffers.count) { 67 | return nil; 68 | } 69 | 70 | if (![_buffers.firstObject isKindOfClass:[QGBaseAnimatedImageFrame class]]) { 71 | return nil; 72 | } 73 | 74 | QGBaseAnimatedImageFrame *frame = _buffers.firstObject; 75 | [_buffers removeObjectAtIndex:0]; 76 | 77 | return frame; 78 | } 79 | 80 | /** 81 | 判断当前缓冲区是否被填满 82 | 83 | @return 只有当缓冲区所有区域都被QGBaseAnimatedImageFrame类型的数据填满才算缓冲区满 84 | */ 85 | - (BOOL)isBufferFull { 86 | 87 | __block BOOL isFull = YES; 88 | [_buffers enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 89 | if (![obj isKindOfClass:[QGBaseAnimatedImageFrame class]]) { 90 | isFull = NO; 91 | *stop = YES; 92 | } 93 | }]; 94 | return isFull; 95 | } 96 | 97 | - (void)dealloc { 98 | 99 | } 100 | 101 | @end 102 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/VAPMacros.h: -------------------------------------------------------------------------------- 1 | // VAPMacros.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #ifndef VAPMacros_h 17 | #define VAPMacros_h 18 | 19 | #define STRINGIZE(x) #x 20 | #define STRINGIZE2(x) STRINGIZE(x) 21 | #define SHADER_STRING(text) @ STRINGIZE2(text) 22 | 23 | #ifndef HWDSYNTH_DYNAMIC_PROPERTY_OBJECT 24 | #define HWDSYNTH_DYNAMIC_PROPERTY_OBJECT(_dynamic_getter_, _dynamic_setter_, _association_policy_) \ 25 | - (void)_dynamic_setter_ : (id)object { \ 26 | [self willChangeValueForKey:@#_dynamic_getter_]; \ 27 | objc_setAssociatedObject(self, _cmd, object, _association_policy_); \ 28 | [self didChangeValueForKey:@#_dynamic_getter_]; \ 29 | } \ 30 | - (id)_dynamic_getter_ { \ 31 | return objc_getAssociatedObject(self, @selector(_dynamic_setter_:)); \ 32 | } 33 | #endif 34 | 35 | #ifndef HWDSYNTH_DYNAMIC_PROPERTY_CTYPE 36 | #define HWDSYNTH_DYNAMIC_PROPERTY_CTYPE(_dynamic_getter_, _dynamic_setter_, _type_) \ 37 | - (void)_dynamic_setter_ : (_type_)object { \ 38 | [self willChangeValueForKey:@#_dynamic_getter_]; \ 39 | NSValue *value = [NSValue value:&object withObjCType:@encode(_type_)]; \ 40 | objc_setAssociatedObject(self, _cmd, value, OBJC_ASSOCIATION_RETAIN); \ 41 | [self didChangeValueForKey:@#_dynamic_getter_]; \ 42 | } \ 43 | - (_type_)_dynamic_getter_ { \ 44 | _type_ cValue = { 0 }; \ 45 | NSValue *value = objc_getAssociatedObject(self, @selector(_dynamic_setter_:)); \ 46 | [value getValue:&cValue]; \ 47 | return cValue; \ 48 | } 49 | #endif 50 | 51 | #import "QGHWDShaderTypes.h" 52 | #import 53 | #import "QGVAPMaskInfo.h" 54 | 55 | extern NSInteger const kQGHWDMP4DefaultFPS; //默认fps 25 56 | extern NSInteger const kQGHWDMP4MinFPS; //最小fps 1 57 | extern NSInteger const QGHWDMP4MaxFPS; //最大fps 60 58 | 59 | extern NSInteger const VapMaxCompatibleVersion; //最大兼容版本 60 | 61 | @class QGVAPSourceDisplayItem; 62 | 63 | typedef UIView VAPView; //特效播放容器 64 | 65 | /* mp4素材中每一帧alpha通道数据的位置*/ 66 | typedef NS_ENUM(NSInteger, QGHWDTextureBlendMode){ 67 | 68 | QGHWDTextureBlendMode_AlphaLeft = 0, // 左侧alpha 69 | QGHWDTextureBlendMode_AlphaRight = 1, // 右侧alpha 70 | QGHWDTextureBlendMode_AlphaTop = 2, // 上侧alpha 71 | QGHWDTextureBlendMode_AlphaBottom = 3, // 下测alpha 72 | }; 73 | 74 | typedef void(^VAPImageCompletionBlock)(UIImage * image, NSError * error,NSString *imageURL); 75 | 76 | typedef void(^VAPGestureEventBlock)(UIGestureRecognizer *gestureRecognizer, BOOL insideSource, QGVAPSourceDisplayItem *source); 77 | 78 | #endif /* VAPMacros_h */ 79 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Logger/QGVAPLogger.h: -------------------------------------------------------------------------------- 1 | // QGVAPLogger.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | #define kQGVAPModuleCommon @"kQGVAPModuleCommon" 19 | 20 | NS_ASSUME_NONNULL_BEGIN 21 | 22 | #define VAP_Logger(level, module, format, ...) if(external_VAP_Logger)external_VAP_Logger(level, __FILE__, __LINE__, __FUNCTION__, module, format, ##__VA_ARGS__); else internal_VAP_Logger_handler(level, __FILE__, __LINE__, __FUNCTION__, module, format, ##__VA_ARGS__); 23 | 24 | #define VAP_Error(module, format, ...) VAP_Logger(VAPLogLevelError, module, format, ##__VA_ARGS__) 25 | #define VAP_Event(module, format, ...) VAP_Logger(VAPLogLevelEvent, module, format, ##__VA_ARGS__) 26 | #define VAP_Warn(module, format, ...) VAP_Logger(VAPLogLevelWarn, module, format, ##__VA_ARGS__) 27 | #define VAP_Info(module, format, ...) VAP_Logger(VAPLogLevelInfo, module, format, ##__VA_ARGS__) 28 | #define VAP_Debug(module, format, ...) VAP_Logger(VAPLogLevelDebug, module, format, ##__VA_ARGS__) 29 | 30 | typedef enum { 31 | VAPLogLevelAll = 0, 32 | VAPLogLevelDebug, // Detailed information on the flow through the system. 33 | VAPLogLevelInfo, // Interesting runtime events (startup/shutdown), should be conservative and keep to a minimum. 34 | VAPLogLevelEvent, 35 | VAPLogLevelWarn, // Other runtime situations that are undesirable or unexpected, but not necessarily "wrong". 36 | VAPLogLevelError, // Other runtime errors or unexpected conditions. 37 | VAPLogLevelFatal, // Severe errors that cause premature termination. 38 | VAPLogLevelNone, // Special level used to disable all log messages. 39 | } VAPLogLevel; 40 | 41 | typedef VAPLogLevel HWDLogLevel; 42 | 43 | //void qg_VAP_Logger(VAPLogLevel level, const char* file, int line, const char* func, NSString *MODULE, NSString *format, ...); 44 | typedef void (*QGVAPLoggerFunc)(VAPLogLevel, const char*, int, const char*, NSString *, NSString *, ...); 45 | 46 | #if defined __cplusplus 47 | extern "C" { 48 | #endif 49 | 50 | extern QGVAPLoggerFunc external_VAP_Logger; 51 | void internal_VAP_Logger_handler(VAPLogLevel level, const char* file, int line, const char* func, NSString *module, NSString *format, ...); 52 | 53 | #if defined __cplusplus 54 | }; 55 | #endif 56 | 57 | @interface QGVAPLogger : NSObject 58 | 59 | + (void)registerExternalLog:(QGVAPLoggerFunc)externalLog; 60 | 61 | + (void)log:(VAPLogLevel)level file:(NSString *)file line:(NSInteger)line func:(NSString *)func module:(NSString *)module message:(NSString *)message; 62 | 63 | @end 64 | 65 | NS_ASSUME_NONNULL_END 66 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/fishhook/fishhook.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Facebook, Inc. 2 | // All rights reserved. 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are met: 5 | // * Redistributions of source code must retain the above copyright notice, 6 | // this list of conditions and the following disclaimer. 7 | // * Redistributions in binary form must reproduce the above copyright notice, 8 | // this list of conditions and the following disclaimer in the documentation 9 | // and/or other materials provided with the distribution. 10 | // * Neither the name Facebook nor the names of its contributors may be used to 11 | // endorse or promote products derived from this software without specific 12 | // prior written permission. 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | 24 | #ifndef fishhook_h 25 | #define fishhook_h 26 | 27 | #include 28 | #include 29 | 30 | #if !defined(FISHHOOK_EXPORT) 31 | #define FISHHOOK_VISIBILITY __attribute__((visibility("hidden"))) 32 | #else 33 | #define FISHHOOK_VISIBILITY __attribute__((visibility("default"))) 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif //__cplusplus 39 | 40 | /* 41 | * A structure representing a particular intended rebinding from a symbol 42 | * name to its replacement 43 | */ 44 | struct rebinding { 45 | const char *name; 46 | void *replacement; 47 | void **replaced; 48 | }; 49 | 50 | /* 51 | * For each rebinding in rebindings, rebinds references to external, indirect 52 | * symbols with the specified name to instead point at replacement for each 53 | * image in the calling process as well as for all future images that are loaded 54 | * by the process. If rebind_functions is called more than once, the symbols to 55 | * rebind are added to the existing list of rebindings, and if a given symbol 56 | * is rebound more than once, the later rebinding will take precedence. 57 | */ 58 | FISHHOOK_VISIBILITY 59 | int rebind_symbols(struct rebinding rebindings[], size_t rebindings_nel); 60 | 61 | /* 62 | * Rebinds as above, but only in the specified image. The header should point 63 | * to the mach-o header, the slide should be the slide offset. Others as above. 64 | */ 65 | FISHHOOK_VISIBILITY 66 | int rebind_symbols_image(void *header, 67 | intptr_t slide, 68 | struct rebinding rebindings[], 69 | size_t rebindings_nel); 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif //__cplusplus 74 | 75 | #endif //fishhook_h 76 | 77 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/Config/MDConfigManager.h: -------------------------------------------------------------------------------- 1 | // weibo: http://weibo.com/xiaoqing28 2 | // blog: http://www.alonemonkey.com 3 | // 4 | // MDConfigManager.h 5 | // MonkeyDev 6 | // 7 | // Created by AloneMonkey on 2018/4/24. 8 | // Copyright © 2018年 AloneMonkey. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | #define MDCONFIG_CYCRIPT_KEY @"Cycript" 14 | #define MDCONFIG_LOADATLAUNCH_KEY @"LoadAtLaunch" 15 | 16 | #define MDCONFIG_TRACE_KEY @"MethodTrace" 17 | #define MDCONFIG_LOG_LEVEL_KEY @"LogLevel" 18 | #define MDCONFIG_LOG_WHEN_KEY @"LogWhen" 19 | #define MDCONFIG_LOG_REGEX_STRING_KEY @"LogRegexString" // 仅LogWhen=MDTraceLogWhenRegexString有效 20 | #define MDCONFIG_TRACE_FLAG_KEY @"TraceFlag" 21 | #define MDCONFIG_TRACE_OBJECT_KEY @"TraceObject" 22 | #define MDCONFIG_CLASS_REGEX_STRING_KEY @"ClassRegexString" // 仅TraceObject=MDTraceObjectRegexClass有效 23 | #define MDCONFIG_CORE_CLASS_LIST @"CORE_CLASS_LIST" 24 | #define MDCONFIG_USER_CLASS_LIST @"USER_CLASS_LIST" 25 | #define MDCONFIG_TRACE_MODE_KEY @"TraceMode" 26 | #define MDCONFIG_METHOD_WHITE_LIST_KEY @"MethodWhiteList" 27 | #define MDCONFIG_METHOD_BLACK_LIST_KEY @"MethodBlackList" 28 | 29 | // Trace日志级别 30 | typedef NS_ENUM(NSUInteger, MDTraceLogLevel) { 31 | MDTraceLogLeveError = 0, // 错误 32 | MDTraceLogLeveDebug = 1, // 调试 33 | MDTraceLogLeveMax 34 | }; 35 | 36 | // Trace日志输出时机 37 | typedef NS_ENUM(NSUInteger, MDTraceLogWhen) { 38 | MDTraceLogWhenStartup = 0, // 启动即输出日志 39 | MDTraceLogWhenVolume = 1, // 根据音量键控制输出日志(增加音量:输出日志;降低音量:关闭日志;默认时关闭日志) 40 | MDTraceLogWhenRegexString = 2, // 日志包含指定正则字符串才输出日志 41 | MDTraceLogWhenMax 42 | }; 43 | 44 | // Trace控制位(尽量在该处扩展) 45 | typedef NS_OPTIONS(NSUInteger, MDTraceFlag) { 46 | MDTraceFlagDoesNotUseDescription = 1 << 0, // 跳过调用对象description方法,避免不正规的description实现导致递归 47 | MDTraceFlagDumpClassListInfo = 1 << 1, // 打印类列表信息,便于调试 48 | MDTraceFlagDumpClassMethod = 1 << 2, // 打印某个类的方法(不包括父类方法),便于调试 49 | MDTraceFlagDumpSuperClassMethod = 1 << 3, // 打印某个类的父类方法(包括递归父类的方法),便于调试 50 | MDTraceFlagMask = 0xF, 51 | 52 | MDTraceFlagDefault = 0, 53 | }; 54 | 55 | // Trace对象 56 | typedef NS_ENUM(NSUInteger, MDTraceObject) { 57 | // 屏蔽trace所有类 58 | MDTraceObjectNone = 0, 59 | // trace引擎指定类的方法(仅测试验证使用),仅需要考虑CORE_CLASS_LIST 60 | MDTraceObjectCoreClass = 1, 61 | // trace用户指定类的方法,需要考虑USER_CLASS_LIST + "USER_CLASS_LIST和CORE_CLASS_LIST交集" 62 | MDTraceObjectUserClass = 2, 63 | // trace用户指定类 + 正则匹配类的方法,需要考虑USER_CLASS_LIST + "USER_CLASS_LIST和CORE_CLASS_LIST交集" + 64 | // "匹配ClassRegexString的CLASS_LIST和CORE_CLASS_LIST交集" 65 | MDTraceObjectRegexClass = 3, 66 | 67 | MDTraceObjectMax 68 | }; 69 | 70 | // Trace模式 71 | typedef NS_ENUM(NSUInteger, MDTraceMode) { 72 | MDTraceModeOff = 0, // 屏蔽trace方法 73 | MDTraceModeAll = 1, // trace所有方法 74 | MDTraceModeIncludeWhiteList = 2, // trace包含"白名单方法列表"的方法 75 | MDTraceModeExcludeBlackList = 3, // trace排除"黑名单方法列表"的方法 76 | MDTraceModeMax 77 | }; 78 | 79 | @interface MDConfigManager : NSObject 80 | 81 | + (instancetype)sharedInstance; 82 | 83 | - (NSDictionary*)readConfigByKey:(NSString*) key; 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/MyUtils/DKHelperConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // DKHelperConfig.h 3 | // testHookDylib 4 | // 5 | // Created by 朱德坤 on 2019/1/22. 6 | // Copyright © 2019 DKJone. All rights reserved. 7 | // 8 | // ██████╗ ██╗ ██╗ ██╗ ██████╗ ███╗ ██╗███████╗ 9 | // ██╔══██╗██║ ██╔╝ ██║██╔═══██╗████╗ ██║██╔════╝ 10 | // ██║ ██║█████╔╝ ██║██║ ██║██╔██╗ ██║█████╗ 11 | // ██║ ██║██╔═██╗ ██ ██║██║ ██║██║╚██╗██║██╔══╝ 12 | // ██████╔╝██║ ██╗╚█████╔╝╚██████╔╝██║ ╚████║███████╗ 13 | // ╚═════╝ ╚═╝ ╚═╝ ╚════╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝ 14 | // 15 | 16 | #import 17 | #import 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | @interface DKHelperConfig : NSObject 22 | 23 | @property (nonatomic, strong) NSTimer *bgTaskTimer; //后台任务定时器 24 | 25 | + (instancetype)shared; 26 | 27 | /// 程序进入后台处理 28 | - (void)enterBackgroundHandler; 29 | 30 | /// 自动抢红包 31 | +(BOOL)autoRedEnvelop; 32 | +(void)setAutoRedEnvelop:(BOOL)value; 33 | 34 | /// 消息防撤回 35 | +(BOOL)preventRevoke; 36 | +(void)setPreventRevoke:(BOOL)value; 37 | 38 | /// 修改步数 39 | +(BOOL)changeSteps; 40 | +(void)setChangeSteps:(BOOL)value; 41 | 42 | /// 运动步数 43 | +(NSInteger)changedSteps; 44 | +(void)setChangedSteps:(NSInteger)value; 45 | 46 | /// 小游戏作弊 47 | +(BOOL)gamePlugEnable; 48 | +(void)setGamePlugEnable:(BOOL)value; 49 | 50 | /// 后台抢红包 51 | +(BOOL)redEnvelopBackGround; 52 | +(void)setRedEnvelopBackGround:(BOOL)value; 53 | 54 | /// 抢红包延迟 55 | +(NSInteger)redEnvelopDelay; 56 | +(void)setRedEnvelopDelay:(NSInteger)value; 57 | 58 | /// 抢红包关键词过滤 59 | +(NSString *)redEnvelopTextFiter; 60 | +(void)setRedEnvelopTextFiter:(NSString*)value; 61 | 62 | /// 抢红包群组过滤 63 | +(NSArray *)redEnvelopGroupFiter; 64 | +(void)setRedEnvelopGroupFiter:(NSArray *)value; 65 | 66 | /// 抢自己的红包 67 | +(BOOL)redEnvelopCatchMe; 68 | +(void)setRedEnvelopCatchMe:(BOOL)value; 69 | 70 | /// 同事抢多个红包 71 | +(BOOL)redEnvelopMultipleCatch; 72 | +(void)setRedEnvelopMultipleCatch:(BOOL)value; 73 | 74 | +(BOOL)hasShowTips; 75 | +(void)setHasShowTips:(BOOL)value; 76 | 77 | /// 启用callkit 78 | +(BOOL)callKitEnable; 79 | +(void)setCallKitEnable:(BOOL)value; 80 | /// 启用朋友圈转发 81 | +(BOOL)timeLineForwardEnable; 82 | +(void)setTimeLineForwardEnable:(BOOL)value; 83 | 84 | /// 启用积攒助手 85 | +(BOOL)likeCommentEnable; 86 | +(void)setLikeCommentEnable:(BOOL)value; 87 | 88 | /// 赞的数量 89 | +(NSNumber *)likeCount; 90 | +(void)setLikeCount:(NSNumber *)value; 91 | 92 | /// 评论的数量 93 | +(NSNumber *)commentCount; 94 | +(void)setCommentCount:(NSNumber *)value; 95 | 96 | /// 评论 97 | +(NSString *)comments; 98 | +(void)setComments:(NSString *)value; 99 | 100 | 101 | /// 抢个人红包 102 | +(BOOL)personalRedEnvelopEnable; 103 | +(void)setPersonalRedEnvelopEnable:(BOOL)value; 104 | 105 | /// 清理好友 106 | +(BOOL)cleanFriendsEnable; 107 | +(void)setCleanFriendsEnable:(BOOL)value; 108 | 109 | /// 启用动态启动图 110 | +(BOOL)dkLaunchEnable; 111 | +(void)setDkLaunchEnable:(BOOL)value; 112 | 113 | /// 启用动态聊天背景 114 | +(BOOL)dkChatBgEnable; 115 | +(void)setDkChatBgEnable:(BOOL)value; 116 | 117 | 118 | /// 启动图index 119 | +(NSNumber *)dkLaunchIndex; 120 | +(void)setDkLaunchIndex:(NSNumber *)value; 121 | 122 | /// 聊天背景index 123 | +(NSNumber *)dkChatBGIndex; 124 | +(void)setDkChatBGIndex:(NSNumber *)value; 125 | 126 | 127 | @end 128 | 129 | 130 | 131 | NS_ASSUME_NONNULL_END 132 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/QGVAPMetalShaderFunctionLoader.m: -------------------------------------------------------------------------------- 1 | // QGVAPMetalShaderFunctionLoader.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGVAPMetalShaderFunctionLoader.h" 17 | #import "QGHWDMetalShaderSourceDefine.h" 18 | #import "QGHWDShaderTypes.h" 19 | #import "QGVAPLogger.h" 20 | 21 | @interface QGVAPMetalShaderFunctionLoader () { 22 | 23 | BOOL _alreadyLoadDefaultLibrary; 24 | BOOL _alreadyLoadHWDLibrary; 25 | } 26 | 27 | @property (nonatomic, strong) id device; 28 | @property (nonatomic, strong) id defaultLibrary; 29 | @property (nonatomic, strong) id hwdLibrary; 30 | 31 | @end 32 | 33 | @implementation QGVAPMetalShaderFunctionLoader 34 | 35 | - (instancetype)initWithDevice:(id)device { 36 | 37 | if (self = [super init]) { 38 | _device = device; 39 | } 40 | return self; 41 | } 42 | 43 | - (id)loadFunctionWithName:(NSString *)funcName { 44 | 45 | id program = nil; 46 | [self loadDefaultLibraryIfNeed]; 47 | program = [self.defaultLibrary newFunctionWithName:funcName]; 48 | //没有找到defaultLibrary文件 || defaultLibrary中不包含对应的fucntion 49 | if (!program) { 50 | [self loadHWDLibraryIfNeed]; 51 | program = [self.hwdLibrary newFunctionWithName:funcName]; 52 | } 53 | return program; 54 | } 55 | 56 | - (void)loadDefaultLibraryIfNeed { 57 | 58 | if (self.defaultLibrary || _alreadyLoadDefaultLibrary) { 59 | return ; 60 | } 61 | NSBundle *bundle = [NSBundle bundleForClass:self.class]; 62 | NSString *metalLibPath = [bundle pathForResource:@"default" ofType:@"metallib"]; 63 | if (metalLibPath.length == 0) { 64 | return ; 65 | } 66 | NSError *error = nil; 67 | id defaultLibrary = [self.device newLibraryWithFile:metalLibPath error:&error]; 68 | if (!defaultLibrary || error) { 69 | VAP_Error(kQGVAPModuleCommon, @"loadDefaultLibrary error!:%@", error); 70 | return ; 71 | } 72 | self.defaultLibrary = defaultLibrary; 73 | _alreadyLoadDefaultLibrary = YES; 74 | } 75 | 76 | - (void)loadHWDLibraryIfNeed { 77 | 78 | if (self.hwdLibrary || _alreadyLoadHWDLibrary) { 79 | return ; 80 | } 81 | NSError *error = nil; 82 | NSString *sourceString = [NSString stringWithFormat:@"%@%@%@", kQGHWDMetalShaderSourceImports, kQGHWDMetalShaderTypeDefines, kQGHWDMetalShaderSourceString]; 83 | id hwdLibrary = [self.device newLibraryWithSource:sourceString options:nil error:&error]; 84 | if (!hwdLibrary || error) { 85 | VAP_Error(kQGVAPModuleCommon, @"loadHWDLibrary error!:%@", error); 86 | return ; 87 | } 88 | self.hwdLibrary = hwdLibrary; 89 | _alreadyLoadHWDLibrary = YES; 90 | } 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/wechatHeaders/WCUIAlertView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. 5 | // 6 | 7 | #import 8 | 9 | @interface MMGrowTextView : UITextField 10 | 11 | @end 12 | 13 | @interface MMTipsViewController : UIAlertController 14 | - (NSString *)text; 15 | @end 16 | 17 | 18 | @interface WCUIAlertView : NSObject 19 | 20 | 21 | + (id)getTopVc; 22 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2 btnTitle:(id)arg3 handler:(id)arg4 btnTitle:(id)arg5 handler:(id)arg6; 23 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2 btnTitle:(id)arg3 handler:(id)arg4; 24 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2 btnTitle:(id)arg3 target:(id)arg4 sel:(SEL)arg5 btnTitle:(id)arg6 target:(id)arg7 sel:(SEL)arg8 btnTitle:(id)arg9 target:(id)arg10 sel:(SEL)arg11 view:(id)arg12; 25 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2 btnTitle:(id)arg3 target:(id)arg4 sel:(SEL)arg5 view:(id)arg6; 26 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2 cancelBtnTitle:(id)arg3 target:(id)arg4 sel:(SEL)arg5 btnTitle:(id)arg6 target:(id)arg7 sel:(SEL)arg8 view:(id)arg9; 27 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2 btnTitle:(id)arg3 target:(id)arg4 sel:(SEL)arg5 btnTitle:(id)arg6 target:(id)arg7 sel:(SEL)arg8 view:(id)arg9; 28 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2 destructiveBtnTitle:(id)arg3 target:(id)arg4 sel:(SEL)arg5 cancelBtnTitle:(id)arg6 target:(id)arg7 sel:(SEL)arg8 view:(id)arg9; 29 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2 btnTitle:(id)arg3 target:(id)arg4 sel:(SEL)arg5 btnTitle:(id)arg6 target:(id)arg7 sel:(SEL)arg8 rightBtnStyle:(long long)arg9 view:(id)arg10; 30 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2 btnTitle:(id)arg3 target:(id)arg4 sel:(SEL)arg5 btnTitle:(id)arg6 target:(id)arg7 sel:(SEL)arg8 btnTitle:(id)arg9 target:(id)arg10 sel:(SEL)arg11; 31 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2 btnTitle:(id)arg3 target:(id)arg4 sel:(SEL)arg5 btnTitle:(id)arg6 target:(id)arg7 sel:(SEL)arg8; 32 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2 btnTitle:(id)arg3 target:(id)arg4 sel:(SEL)arg5; 33 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2 btnTitle:(id)arg3; 34 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2; 35 | + (id)showAlertWithTitle:(id)arg1 message:(id)arg2 cancelBtnTitle:(id)arg3 target:(id)arg4 sel:(SEL)arg5 btnTitle:(id)arg6 target:(id)arg7 sel:(SEL)arg8; 36 | - (_Bool)isVisible; 37 | - (void)dismissAnimated:(_Bool)arg1; 38 | - (void)show; 39 | - (void)addBtnTitle:(id)arg1 target:(id)arg2 sel:(SEL)arg3 btnStyle:(long long)arg4; 40 | - (void)addCancelBtnTitle:(id)arg1 target:(id)arg2 sel:(SEL)arg3; 41 | - (void)addBtnTitle:(id)arg1 target:(id)arg2 sel:(SEL)arg3; 42 | - (id)getTextField; 43 | - (void)setTextFieldDefaultText:(id)arg1; 44 | - (void)showTextFieldWithMaxLen:(unsigned int)arg1; 45 | - (id)initWithTitle:(id)arg1 message:(id)arg2; 46 | - (void)dealloc; 47 | 48 | @end 49 | 50 | @interface WCUIActionSheet : UIWindow 51 | 52 | - (void)addDestructiveButtonTitle:(id)arg1 target:(id)arg2 sel:(SEL)arg3; 53 | - (void)addCancelBtnTitle:(id)arg1 target:(id)arg2 sel:(SEL)arg3; 54 | - (void)addBtnTitle:(id)arg1 target:(id)arg2 sel:(SEL)arg3; 55 | - (id)initWithTitle:(id)arg1; 56 | - (id)init; 57 | - (void)showInView:(id)arg1; 58 | 59 | @end 60 | 61 | //WCUIActionSheet *actionSheet = [[objc_getClass("WCUIActionSheet") alloc] initWithTitle:@"朋友圈转发"]; 62 | //for (NSString* str in @[@"转发给好友",@"转发到朋友圈"]){ 63 | // [actionSheet addBtnTitle:str target:self sel:@selector(startForword:)]; 64 | //} 65 | //[actionSheet showInView:self]; 66 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/NSNotificationCenter+VAPThreadSafe.h: -------------------------------------------------------------------------------- 1 | // NSNotificationCenter+VAPThreadSafe.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | 18 | @interface NSNotificationCenter (VAPThreadSafe) 19 | 20 | 21 | /** 22 | 该方法能够保证通知的执行和移除是线程安全的 23 | 不需要手动移除通知 24 | (iOS9以下系统方法addObserver:selector:name:object:通常用法是不安全的。 25 | 26 | @note 该方法适用于代替原来需要在dealloc内移除通知的场景 27 | 28 | @param observer Object registering as an observer. This value must not be nil. 29 | @param aSelector Selector that specifies the message the receiver sends observer to notify it of the notification posting. The method specified by aSelector must have one and only one argument (an instance of NSNotification). 30 | @param aName The name of the notification for which to register the observer; that is, only notifications with this name are delivered to the observer. 31 | If you pass nil, the notification center doesn’t use a notification’s name to decide whether to deliver it to the observer. 32 | @param anObject The object whose notifications the observer wants to receive; that is, only notifications sent by this sender are delivered to the observer. 33 | If you pass nil, the notification center doesn’t use a notification’s sender to decide whether to deliver it to the observer. 34 | */ 35 | - (void)hwd_addSafeObserver:(id)observer selector:(SEL)aSelector name:(NSNotificationName)aName object:(id)anObject; 36 | - (void)hwd_addWeakObserver:( id)weakObserver name:(NSNotificationName)aName usingBlock:(void (^)(NSNotification *note,id observer))block; 37 | 38 | 39 | /** 40 | 1.设置接收通知的queue 41 | 2.调用- (void)addSafeObserver:(id)observer selector:(SEL)aSelector name:(NSNotificationName)aName object:(id)anObject 42 | 43 | @param observer Object registering as an observer. This value must not be nil. 44 | @param aSelector Selector that specifies the message the receiver sends observer to notify it of the notification posting. The method specified by aSelector must have one and only one argument (an instance of NSNotification). 45 | @param aName The name of the notification for which to register the observer; that is, only notifications with this name are delivered to the observer. 46 | If you pass nil, the notification center doesn’t use a notification’s name to decide whether to deliver it to the observer. 47 | @param anObject The object whose notifications the observer wants to receive; that is, only notifications sent by this sender are delivered to the observer. 48 | If you pass nil, the notification center doesn’t use a notification’s sender to decide whether to deliver it to the observer. 49 | @param queue The operation queue to which callbackoperation should be added. 50 | If you pass nil, the block is run asynchronously on queue which hold by this notification. 51 | */ 52 | - (void)hwd_addSafeObserver:(id)observer selector:(SEL)aSelector name:(NSNotificationName)aName object:(id)anObject queue:(NSOperationQueue *)queue; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/Trace/a1a2-selectortramps-arm64.s: -------------------------------------------------------------------------------- 1 | /* 2 | * a1a2-selectortramps-arm64.s 3 | * OCMethodTrace 4 | * 5 | * https://github.com/omxcodec/OCMethodTrace.git 6 | * 7 | * Copyright (C) 2018 Michael Chen 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #if __arm64__ 23 | 24 | #include 25 | 26 | .text 27 | 28 | .private_extern __a1a2_selectorTrampHead 29 | .private_extern __a1a2_firstSelectorTramp 30 | .private_extern __a1a2_selectorTrampEnd 31 | 32 | msgSend: 33 | .quad 0 34 | 35 | .align PAGE_MAX_SHIFT 36 | __a1a2_selectorTrampHead: 37 | L_a1a2_selectorTrampHead: 38 | // 1. selector 39 | ldr x1, [x17] // selector -> _cmd 40 | // 2. msgSend 41 | adr x17, L_a1a2_selectorTrampHead 42 | sub x17, x17, #PAGE_MAX_SIZE 43 | ldr x16, [x17] 44 | br x16 // tail call msgSend 45 | 46 | // pad up to TrampolineSelectorPagePair header size 47 | nop 48 | nop 49 | nop 50 | 51 | .macro TrampolineEntry 52 | // load address of trampoline data (one page before this instruction) 53 | adr x17, -PAGE_MAX_SIZE 54 | b L_a1a2_selectorTrampHead 55 | .endmacro 56 | 57 | .macro TrampolineEntryX16 58 | TrampolineEntry 59 | TrampolineEntry 60 | TrampolineEntry 61 | TrampolineEntry 62 | 63 | TrampolineEntry 64 | TrampolineEntry 65 | TrampolineEntry 66 | TrampolineEntry 67 | 68 | TrampolineEntry 69 | TrampolineEntry 70 | TrampolineEntry 71 | TrampolineEntry 72 | 73 | TrampolineEntry 74 | TrampolineEntry 75 | TrampolineEntry 76 | TrampolineEntry 77 | .endmacro 78 | 79 | .macro TrampolineEntryX256 80 | TrampolineEntryX16 81 | TrampolineEntryX16 82 | TrampolineEntryX16 83 | TrampolineEntryX16 84 | 85 | TrampolineEntryX16 86 | TrampolineEntryX16 87 | TrampolineEntryX16 88 | TrampolineEntryX16 89 | 90 | TrampolineEntryX16 91 | TrampolineEntryX16 92 | TrampolineEntryX16 93 | TrampolineEntryX16 94 | 95 | TrampolineEntryX16 96 | TrampolineEntryX16 97 | TrampolineEntryX16 98 | TrampolineEntryX16 99 | .endmacro 100 | 101 | .align 3 102 | .private_extern __a1a2_firstSelectorTramp 103 | __a1a2_firstSelectorTramp: 104 | // 2048-4 trampolines to fill 16K page 105 | TrampolineEntryX256 106 | TrampolineEntryX256 107 | TrampolineEntryX256 108 | TrampolineEntryX256 109 | 110 | TrampolineEntryX256 111 | TrampolineEntryX256 112 | TrampolineEntryX256 113 | 114 | TrampolineEntryX16 115 | TrampolineEntryX16 116 | TrampolineEntryX16 117 | TrampolineEntryX16 118 | 119 | TrampolineEntryX16 120 | TrampolineEntryX16 121 | TrampolineEntryX16 122 | TrampolineEntryX16 123 | 124 | TrampolineEntryX16 125 | TrampolineEntryX16 126 | TrampolineEntryX16 127 | TrampolineEntryX16 128 | 129 | TrampolineEntryX16 130 | TrampolineEntryX16 131 | TrampolineEntryX16 132 | 133 | TrampolineEntry 134 | TrampolineEntry 135 | TrampolineEntry 136 | TrampolineEntry 137 | 138 | TrampolineEntry 139 | TrampolineEntry 140 | TrampolineEntry 141 | TrampolineEntry 142 | 143 | TrampolineEntry 144 | TrampolineEntry 145 | TrampolineEntry 146 | TrampolineEntry 147 | 148 | // TrampolineEntry 149 | // TrampolineEntry 150 | // TrampolineEntry 151 | // TrampolineEntry 152 | 153 | .private_extern __a1a2_selectorTrampEnd 154 | __a1a2_selectorTrampEnd: 155 | 156 | #endif 157 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Utils/Categorys/NSNotificationCenter+VAPThreadSafe.m: -------------------------------------------------------------------------------- 1 | // NSNotificationCenter+ThreadSafe.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "NSNotificationCenter+VAPThreadSafe.h" 17 | #import "QGVAPSafeMutableDictionary.h" 18 | #import 19 | #import 20 | 21 | @interface NSObject (SafeNotification) 22 | 23 | @property (nonatomic, strong) NSOperationQueue *notificationOperationQueue; 24 | 25 | @end 26 | 27 | @implementation NSObject (SafeNotification) 28 | 29 | - (NSOperationQueue *)notificationOperationQueue { 30 | @synchronized (self) { 31 | NSOperationQueue *queue = objc_getAssociatedObject(self, @"notificationOperationQueue"); 32 | if (!queue) { 33 | queue = [[NSOperationQueue alloc] init]; 34 | queue.maxConcurrentOperationCount = 1; 35 | self.notificationOperationQueue = queue; 36 | } 37 | return queue; 38 | } 39 | } 40 | 41 | - (void)setNotificationOperationQueue:(NSOperationQueue *)notificationOperationQueue { 42 | @synchronized (self) { 43 | objc_setAssociatedObject(self, @"notificationOperationQueue", notificationOperationQueue, OBJC_ASSOCIATION_RETAIN); 44 | } 45 | } 46 | 47 | @end 48 | 49 | @implementation NSNotificationCenter (VAPThreadSafe) 50 | 51 | - (void)hwd_addSafeObserver:(id)observer selector:(SEL)aSelector name:(NSNotificationName)aName object:(id)anObject { 52 | 53 | double sysVersion = [[[UIDevice currentDevice] systemVersion] doubleValue];; 54 | if (sysVersion >= 9.0) { 55 | return [self addObserver:observer selector:aSelector name:aName object:anObject]; 56 | } 57 | __weak typeof(observer) weakObserver = observer; 58 | __block NSObject *blockObserver = [self addObserverForName:aName object:anObject queue:aName.notificationOperationQueue usingBlock:^(NSNotification * _Nonnull note) { 59 | #pragma clang diagnostic push 60 | #pragma clang diagnostic ignored "-Warc-performSelector-leaks" 61 | __strong __typeof__(weakObserver) strongObserver = weakObserver; 62 | [strongObserver performSelector:aSelector withObject:note]; 63 | #pragma clang diagnostic pop 64 | if (!weakObserver) { 65 | [[NSNotificationCenter defaultCenter] removeObserver:blockObserver]; 66 | blockObserver = nil; 67 | } 68 | }]; 69 | } 70 | - (void)hwd_addWeakObserver:( id)Observer name:(NSNotificationName)aName usingBlock:(void (^)(NSNotification *note,id observer))block{ 71 | __weak id weakObserver=Observer; 72 | __block NSObject *blockObserver = [self addObserverForName:aName object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) { 73 | __strong id strongObserver = weakObserver; 74 | if(!weakObserver ){ 75 | [[NSNotificationCenter defaultCenter] removeObserver:blockObserver]; 76 | blockObserver = nil; 77 | }else{ 78 | block(note,strongObserver); 79 | } 80 | 81 | }]; 82 | } 83 | - (void)hwd_addSafeObserver:(id)observer selector:(SEL)aSelector name:(NSNotificationName)aName object:(id)anObject queue:(NSOperationQueue *)queue { 84 | 85 | aName.notificationOperationQueue = queue; 86 | [self hwd_addSafeObserver:observer selector:aSelector name:aName object:anObject]; 87 | } 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/AntiAntiDebug/AntiAntiDebug.m: -------------------------------------------------------------------------------- 1 | // weibo: http://weibo.com/xiaoqing28 2 | // blog: http://www.alonemonkey.com 3 | // 4 | // AntiAntiDebug.m 5 | // MonkeyDev 6 | // 7 | // Created by AloneMonkey on 2016/12/10. 8 | // Copyright © 2017年 MonkeyDev. All rights reserved. 9 | // 10 | 11 | #if TARGET_OS_SIMULATOR 12 | #error Do not support the simulator, please use the real iPhone Device. 13 | #endif 14 | 15 | #import "fishhook.h" 16 | #import 17 | #import 18 | 19 | typedef int (*ptrace_ptr_t)(int _request,pid_t _pid, caddr_t _addr,int _data); 20 | typedef void* (*dlsym_ptr_t)(void * __handle, const char* __symbol); 21 | typedef int (*syscall_ptr_t)(int, ...); 22 | typedef int (*sysctl_ptr_t)(int *,u_int, void*, size_t*,void*, size_t); 23 | 24 | 25 | static ptrace_ptr_t orig_ptrace = NULL; 26 | static dlsym_ptr_t orig_dlsym = NULL; 27 | static sysctl_ptr_t orig_sysctl = NULL; 28 | static syscall_ptr_t orig_syscall = NULL; 29 | 30 | int my_ptrace(int _request, pid_t _pid, caddr_t _addr, int _data); 31 | void* my_dlsym(void* __handle, const char* __symbol); 32 | int my_sysctl(int * name, u_int namelen, void * info, size_t * infosize, void * newinfo, size_t newinfosize); 33 | int my_syscall(int code, va_list args); 34 | 35 | int my_ptrace(int _request, pid_t _pid, caddr_t _addr, int _data){ 36 | if(_request != 31){ 37 | return orig_ptrace(_request,_pid,_addr,_data); 38 | } 39 | 40 | NSLog(@"[AntiAntiDebug] - ptrace request is PT_DENY_ATTACH"); 41 | 42 | return 0; 43 | } 44 | 45 | void* my_dlsym(void* __handle, const char* __symbol){ 46 | if(strcmp(__symbol, "ptrace") != 0){ 47 | return orig_dlsym(__handle, __symbol); 48 | } 49 | 50 | NSLog(@"[AntiAntiDebug] - dlsym get ptrace symbol"); 51 | 52 | return my_ptrace; 53 | } 54 | 55 | typedef struct kinfo_proc _kinfo_proc; 56 | 57 | int my_sysctl(int * name, u_int namelen, void * info, size_t * infosize, void * newinfo, size_t newinfosize){ 58 | if(namelen == 4 && name[0] == CTL_KERN && name[1] == KERN_PROC && name[2] == KERN_PROC_PID && info && infosize && ((int)*infosize == sizeof(_kinfo_proc))){ 59 | int ret = orig_sysctl(name, namelen, info, infosize, newinfo, newinfosize); 60 | struct kinfo_proc *info_ptr = (struct kinfo_proc *)info; 61 | if(info_ptr && (info_ptr->kp_proc.p_flag & P_TRACED) != 0){ 62 | NSLog(@"[AntiAntiDebug] - sysctl query trace status."); 63 | info_ptr->kp_proc.p_flag ^= P_TRACED; 64 | if((info_ptr->kp_proc.p_flag & P_TRACED) == 0){ 65 | NSLog(@"trace status reomve success!"); 66 | } 67 | } 68 | return ret; 69 | } 70 | return orig_sysctl(name, namelen, info, infosize, newinfo, newinfosize); 71 | } 72 | 73 | int my_syscall(int code, va_list args){ 74 | int request; 75 | va_list newArgs; 76 | va_copy(newArgs, args); 77 | if(code == 26){ 78 | #ifdef __LP64__ 79 | __asm__( 80 | "ldr %w[result], [fp, #0x10]\n" 81 | : [result] "=r" (request) 82 | : 83 | : 84 | ); 85 | #else 86 | request = va_arg(args, int); 87 | #endif 88 | if(request == 31){ 89 | NSLog(@"[AntiAntiDebug] - syscall call ptrace, and request is PT_DENY_ATTACH"); 90 | return 0; 91 | } 92 | } 93 | return orig_syscall(code, newArgs); 94 | } 95 | 96 | __attribute__((constructor)) static void entry(){ 97 | NSLog(@"[AntiAntiDebug Init]"); 98 | 99 | rebind_symbols((struct rebinding[1]){{"ptrace", my_ptrace, (void*)&orig_ptrace}},1); 100 | 101 | rebind_symbols((struct rebinding[1]){{"dlsym", my_dlsym, (void*)&orig_dlsym}},1); 102 | 103 | //some app will crash with _dyld_debugger_notification 104 | // rebind_symbols((struct rebinding[1]){{"sysctl", my_sysctl, (void*)&orig_sysctl}},1); 105 | 106 | rebind_symbols((struct rebinding[1]){{"syscall", my_syscall, (void*)&orig_syscall}},1); 107 | } 108 | 109 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/Trace/a1a2-selectortramps-arm.s: -------------------------------------------------------------------------------- 1 | /* 2 | * a1a2-selectortramps-arm.s 3 | * OCMethodTrace 4 | * 5 | * https://github.com/omxcodec/OCMethodTrace.git 6 | * 7 | * Copyright (C) 2018 Michael Chen 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #if __arm__ 23 | 24 | #include 25 | #include 26 | 27 | .syntax unified 28 | 29 | .text 30 | 31 | .private_extern __a1a2_selectorTrampHead 32 | .private_extern __a1a2_firstSelectorTramp 33 | .private_extern __a1a2_selectorTrampEnd 34 | 35 | // Trampoline machinery assumes the trampolines are Thumb function pointers 36 | #if !__thumb2__ 37 | # error sorry 38 | #endif 39 | 40 | .thumb 41 | .thumb_func __a1a2_selectorTrampHead 42 | .thumb_func __a1a2_firstSelectorTramp 43 | .thumb_func __a1a2_selectorTrampEnd 44 | 45 | .align PAGE_MAX_SHIFT 46 | __a1a2_selectorTrampHead: 47 | // Trampoline's data is one page before the trampoline text. 48 | // Also correct PC bias of 4 bytes. 49 | // 1. selector 50 | sub r12, #PAGE_MAX_SIZE 51 | ldr r1, [r12, #-4] // selector -> _cmd 52 | // 2. msgSend 53 | mov r12, pc 54 | sub r12, #PAGE_MAX_SIZE 55 | ldr pc, [r12, #-12] // tail call msgSend 56 | // not reached 57 | nop 58 | 59 | // Align trampolines to 8 bytes 60 | .align 3 61 | 62 | .macro TrampolineEntry 63 | mov r12, pc 64 | b __a1a2_selectorTrampHead 65 | .align 3 66 | .endmacro 67 | 68 | .macro TrampolineEntryX16 69 | TrampolineEntry 70 | TrampolineEntry 71 | TrampolineEntry 72 | TrampolineEntry 73 | 74 | TrampolineEntry 75 | TrampolineEntry 76 | TrampolineEntry 77 | TrampolineEntry 78 | 79 | TrampolineEntry 80 | TrampolineEntry 81 | TrampolineEntry 82 | TrampolineEntry 83 | 84 | TrampolineEntry 85 | TrampolineEntry 86 | TrampolineEntry 87 | TrampolineEntry 88 | .endmacro 89 | 90 | .macro TrampolineEntryX256 91 | TrampolineEntryX16 92 | TrampolineEntryX16 93 | TrampolineEntryX16 94 | TrampolineEntryX16 95 | 96 | TrampolineEntryX16 97 | TrampolineEntryX16 98 | TrampolineEntryX16 99 | TrampolineEntryX16 100 | 101 | TrampolineEntryX16 102 | TrampolineEntryX16 103 | TrampolineEntryX16 104 | TrampolineEntryX16 105 | 106 | TrampolineEntryX16 107 | TrampolineEntryX16 108 | TrampolineEntryX16 109 | TrampolineEntryX16 110 | .endmacro 111 | 112 | .private_extern __a1a2_firstSelectorTramp 113 | __a1a2_firstSelectorTramp: 114 | // 2048-3 trampolines to fill 16K page 115 | TrampolineEntryX256 116 | TrampolineEntryX256 117 | TrampolineEntryX256 118 | TrampolineEntryX256 119 | 120 | TrampolineEntryX256 121 | TrampolineEntryX256 122 | TrampolineEntryX256 123 | 124 | TrampolineEntryX16 125 | TrampolineEntryX16 126 | TrampolineEntryX16 127 | TrampolineEntryX16 128 | 129 | TrampolineEntryX16 130 | TrampolineEntryX16 131 | TrampolineEntryX16 132 | TrampolineEntryX16 133 | 134 | TrampolineEntryX16 135 | TrampolineEntryX16 136 | TrampolineEntryX16 137 | TrampolineEntryX16 138 | 139 | TrampolineEntryX16 140 | TrampolineEntryX16 141 | TrampolineEntryX16 142 | 143 | TrampolineEntry 144 | TrampolineEntry 145 | TrampolineEntry 146 | TrampolineEntry 147 | 148 | TrampolineEntry 149 | TrampolineEntry 150 | TrampolineEntry 151 | TrampolineEntry 152 | 153 | TrampolineEntry 154 | TrampolineEntry 155 | TrampolineEntry 156 | TrampolineEntry 157 | 158 | TrampolineEntry 159 | // TrampolineEntry 160 | // TrampolineEntry 161 | // TrampolineEntry 162 | 163 | .private_extern __a1a2_selectorTrampEnd 164 | __a1a2_selectorTrampEnd: 165 | 166 | #endif 167 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/Trace/a2a3-selectortramps-arm.s: -------------------------------------------------------------------------------- 1 | /* 2 | * a2a3-selectortramps-arm.s 3 | * OCMethodTrace 4 | * 5 | * https://github.com/omxcodec/OCMethodTrace.git 6 | * 7 | * Copyright (C) 2018 Michael Chen 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #if __arm__ 23 | 24 | #include 25 | #include 26 | 27 | .syntax unified 28 | 29 | .text 30 | 31 | .private_extern __a2a3_selectorTrampHead 32 | .private_extern __a2a3_firstSelectorTramp 33 | .private_extern __a2a3_selectorTrampEnd 34 | 35 | // Trampoline machinery assumes the trampolines are Thumb function pointers 36 | #if !__thumb2__ 37 | # error sorry 38 | #endif 39 | 40 | .thumb 41 | .thumb_func __a2a3_selectorTrampHead 42 | .thumb_func __a2a3_firstSelectorTramp 43 | .thumb_func __a2a3_selectorTrampEnd 44 | 45 | .align PAGE_MAX_SHIFT 46 | __a2a3_selectorTrampHead: 47 | // Trampoline's data is one page before the trampoline text. 48 | // Also correct PC bias of 4 bytes. 49 | // 1. selector 50 | sub r12, #PAGE_MAX_SIZE 51 | ldr r2, [r12, #-4] // _cmd = selector 52 | // 2. msgSend. Can't "ldr r12, msgSend", error: out of range pc-relative fixup value 53 | mov r12, pc 54 | sub r12, #PAGE_MAX_SIZE 55 | ldr pc, [r12, #-12] 56 | // not reached 57 | nop 58 | 59 | // Align trampolines to 8 bytes 60 | .align 3 61 | 62 | .macro TrampolineEntry 63 | mov r12, pc 64 | b __a2a3_selectorTrampHead 65 | .align 3 66 | .endmacro 67 | 68 | .macro TrampolineEntryX16 69 | TrampolineEntry 70 | TrampolineEntry 71 | TrampolineEntry 72 | TrampolineEntry 73 | 74 | TrampolineEntry 75 | TrampolineEntry 76 | TrampolineEntry 77 | TrampolineEntry 78 | 79 | TrampolineEntry 80 | TrampolineEntry 81 | TrampolineEntry 82 | TrampolineEntry 83 | 84 | TrampolineEntry 85 | TrampolineEntry 86 | TrampolineEntry 87 | TrampolineEntry 88 | .endmacro 89 | 90 | .macro TrampolineEntryX256 91 | TrampolineEntryX16 92 | TrampolineEntryX16 93 | TrampolineEntryX16 94 | TrampolineEntryX16 95 | 96 | TrampolineEntryX16 97 | TrampolineEntryX16 98 | TrampolineEntryX16 99 | TrampolineEntryX16 100 | 101 | TrampolineEntryX16 102 | TrampolineEntryX16 103 | TrampolineEntryX16 104 | TrampolineEntryX16 105 | 106 | TrampolineEntryX16 107 | TrampolineEntryX16 108 | TrampolineEntryX16 109 | TrampolineEntryX16 110 | .endmacro 111 | 112 | .private_extern __a2a3_firstSelectorTramp 113 | __a2a3_firstSelectorTramp: 114 | // 2048-2 trampolines to fill 16K page 115 | TrampolineEntryX256 116 | TrampolineEntryX256 117 | TrampolineEntryX256 118 | TrampolineEntryX256 119 | 120 | TrampolineEntryX256 121 | TrampolineEntryX256 122 | TrampolineEntryX256 123 | 124 | TrampolineEntryX16 125 | TrampolineEntryX16 126 | TrampolineEntryX16 127 | TrampolineEntryX16 128 | 129 | TrampolineEntryX16 130 | TrampolineEntryX16 131 | TrampolineEntryX16 132 | TrampolineEntryX16 133 | 134 | TrampolineEntryX16 135 | TrampolineEntryX16 136 | TrampolineEntryX16 137 | TrampolineEntryX16 138 | 139 | TrampolineEntryX16 140 | TrampolineEntryX16 141 | TrampolineEntryX16 142 | 143 | TrampolineEntry 144 | TrampolineEntry 145 | TrampolineEntry 146 | TrampolineEntry 147 | 148 | TrampolineEntry 149 | TrampolineEntry 150 | TrampolineEntry 151 | TrampolineEntry 152 | 153 | TrampolineEntry 154 | TrampolineEntry 155 | TrampolineEntry 156 | TrampolineEntry 157 | 158 | TrampolineEntry 159 | // TrampolineEntry 160 | // TrampolineEntry 161 | // TrampolineEntry 162 | 163 | .private_extern __a2a3_selectorTrampEnd 164 | __a2a3_selectorTrampEnd: 165 | 166 | #endif 167 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/DKGroupFilterController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DKGroupFilterController.m 3 | // testHookDylib 4 | // 5 | // Created by 朱德坤 on 2019/1/22. 6 | // Copyright © 2019 DKJone. All rights reserved. 7 | // 8 | 9 | #import "DKGroupFilterController.h" 10 | #import 11 | #import "MMUICommonUtil.h" 12 | 13 | @interface DKGroupFilterController (){ 14 | MMUIViewController *helper; 15 | } 16 | @property (strong, nonatomic) ContactSelectView *selectView; 17 | @property (strong, nonatomic) NSArray *blackList; 18 | @end 19 | 20 | @implementation DKGroupFilterController 21 | 22 | - (instancetype)initWithBlackList:(NSArray *)blackList { 23 | if (self = [super initWithNibName:nil bundle:nil]) { 24 | _blackList = blackList; 25 | helper = [[objc_getClass("MMUIViewController") alloc] init]; 26 | } 27 | return self; 28 | } 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | self.view.backgroundColor = [DKHelper backgroundColor]; 33 | [self initTitleArea]; 34 | [self initSelectView]; 35 | } 36 | 37 | - (void)viewWillAppear:(BOOL)animated { 38 | [super viewWillAppear:animated]; 39 | MMServiceCenter *serviceCenter = [objc_getClass("MMServiceCenter") defaultCenter]; 40 | CContactMgr *contactMgr = [serviceCenter getService:objc_getClass("CContactMgr")]; 41 | 42 | for (NSString *contactName in self.blackList) { 43 | CContact *contact = [contactMgr getContactByName:contactName]; 44 | [self.selectView addSelect:contact]; 45 | } 46 | } 47 | 48 | - (void)initTitleArea { 49 | self.navigationItem.leftBarButtonItem = [objc_getClass("MMUICommonUtil") getBarButtonWithTitle:@"取消" target:self action:@selector(onCancel:) style:0]; 50 | 51 | self.navigationItem.rightBarButtonItem = [self rightBarButtonWithSelectCount:self.blackList.count]; 52 | 53 | self.title = @"黑名单"; 54 | 55 | [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName: [UIFont boldSystemFontOfSize:18.0]}]; 56 | } 57 | 58 | - (UIBarButtonItem *)rightBarButtonWithSelectCount:(unsigned long)selectCount { 59 | 60 | UIBarButtonItem *barButtonItem; 61 | if (selectCount == 0) { 62 | barButtonItem = [objc_getClass("MMUICommonUtil") getBarButtonWithTitle:@"确定" target:self action:@selector(onDone:) style:2]; 63 | } else { 64 | NSString *title = [NSString stringWithFormat:@"确定(%lu)", selectCount]; 65 | barButtonItem = [objc_getClass("MMUICommonUtil") getBarButtonWithTitle:title target:self action:@selector(onDone:) style:4]; 66 | } 67 | return barButtonItem; 68 | } 69 | 70 | - (void)onCancel:(UIBarButtonItem *)item { 71 | if ([self.delegate respondsToSelector:@selector(onMultiSelectGroupCancel)]) { 72 | [self.delegate onMultiSelectGroupCancel]; 73 | } 74 | } 75 | 76 | - (void)onDone:(UIBarButtonItem *)item { 77 | if ([self.delegate respondsToSelector:@selector(onMultiSelectGroupReturn:)]) { 78 | NSArray *blacklist = [[self.selectView.m_dicMultiSelect allKeys] copy]; 79 | [self.delegate onMultiSelectGroupReturn:blacklist]; 80 | } 81 | 82 | } 83 | 84 | - (void)initSelectView { 85 | self.selectView = [[objc_getClass("ContactSelectView") alloc] initWithFrame:[DKHelper viewFrame] delegate:self]; 86 | 87 | self.selectView.m_uiGroupScene = 5; 88 | self.selectView.m_bMultiSelect = YES; 89 | [self.selectView initData:5]; 90 | self.selectView.m_bShowHistoryGroup = false; 91 | self.selectView.m_bShowRadarCreateRoom = false; 92 | 93 | [self.selectView initView]; 94 | 95 | [self.view addSubview:self.selectView]; 96 | } 97 | 98 | #pragma mark - ContactSelectViewDelegate 99 | - (void)onSelectContact:(CContact *)arg1 { 100 | self.navigationItem.rightBarButtonItem = [self rightBarButtonWithSelectCount:[self getTotalSelectCount]]; 101 | } 102 | 103 | - (unsigned long)getTotalSelectCount { 104 | return (unsigned long)[self.selectView.m_dicMultiSelect count]; 105 | 106 | } 107 | 108 | - (UIViewController *)getViewController{ 109 | return self; 110 | } 111 | 112 | // 没法设置父类,设置消息转发已调用相关类方法 113 | - (MMUIViewController *) forwardingTargetForSelector:(SEL)aSelector { 114 | if ([helper respondsToSelector:aSelector]) { 115 | return helper; 116 | } 117 | return nil; 118 | } 119 | @end 120 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Views/Metal/Vapx/QGVAPMetalView.m: -------------------------------------------------------------------------------- 1 | // QGVAPMetalView.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGVAPMetalView.h" 17 | #import "QGVAPMetalRenderer.h" 18 | #import "QGVAPLogger.h" 19 | 20 | #if TARGET_OS_SIMULATOR//模拟器 21 | 22 | @implementation QGVAPMetalView 23 | 24 | - (void)display:(CVPixelBufferRef)pixelBuffer mergeInfos:(NSArray *)infos {} 25 | 26 | - (void)dispose {} 27 | 28 | @end 29 | 30 | #else 31 | 32 | @interface QGVAPMetalView () 33 | 34 | @property (nonatomic, strong) CAMetalLayer *metalLayer; 35 | @property (nonatomic, strong) QGVAPMetalRenderer *renderer; 36 | @property (nonatomic, assign) BOOL drawableSizeShouldUpdate; 37 | 38 | @end 39 | 40 | @implementation QGVAPMetalView 41 | 42 | #pragma mark - override 43 | 44 | + (Class)layerClass { 45 | return [CAMetalLayer class]; 46 | } 47 | 48 | - (instancetype)initWithCoder:(NSCoder *)aDecoder { 49 | NSAssert(0, @"initWithCoder: has not been implemented"); 50 | if (self = [super initWithCoder:aDecoder]) { 51 | } 52 | return self; 53 | } 54 | 55 | - (instancetype)initWithFrame:(CGRect)frame { 56 | 57 | if (self = [super initWithFrame:frame]) { 58 | _drawableSizeShouldUpdate = YES; 59 | _metalLayer = (CAMetalLayer *)self.layer; 60 | _metalLayer.frame = self.frame; 61 | _metalLayer.opaque = NO; 62 | _renderer = [[QGVAPMetalRenderer alloc] initWithMetalLayer:_metalLayer]; 63 | _metalLayer.contentsScale = [UIScreen mainScreen].scale; 64 | _metalLayer.pixelFormat = MTLPixelFormatBGRA8Unorm; 65 | _metalLayer.framebufferOnly = YES; 66 | } 67 | return self; 68 | } 69 | 70 | - (void)didMoveToWindow { 71 | [super didMoveToWindow]; 72 | self.drawableSizeShouldUpdate = YES; 73 | } 74 | 75 | - (void)layoutSubviews { 76 | [super layoutSubviews]; 77 | self.drawableSizeShouldUpdate = YES; 78 | } 79 | 80 | - (void)dealloc { 81 | [self onMetalViewUnavailable]; 82 | } 83 | 84 | #pragma mark - getter&setter 85 | 86 | - (QGVAPCommonInfo *)commonInfo { 87 | return self.renderer.commonInfo; 88 | } 89 | 90 | - (void)setCommonInfo:(QGVAPCommonInfo *)commonInfo { 91 | [self.renderer setCommonInfo:commonInfo]; 92 | } 93 | 94 | - (void)setMaskInfo:(QGVAPMaskInfo *)maskInfo { 95 | [self.renderer setMaskInfo:maskInfo]; 96 | } 97 | 98 | #pragma mark - main 99 | 100 | - (void)display:(CVPixelBufferRef)pixelBuffer mergeInfos:(NSArray *)infos { 101 | 102 | if (!self.window) { 103 | VAP_Event(kQGVAPModuleCommon, @"quit display pixelbuffer, cuz window is nil!"); 104 | [self onMetalViewUnavailable]; 105 | return ; 106 | } 107 | if (self.drawableSizeShouldUpdate) { 108 | CGFloat nativeScale = [UIScreen mainScreen].nativeScale; 109 | CGSize drawableSize = CGSizeMake(CGRectGetWidth(self.bounds)*nativeScale, CGRectGetHeight(self.bounds)*nativeScale); 110 | self.metalLayer.drawableSize = drawableSize; 111 | VAP_Event(kQGVAPModuleCommon, @"update drawablesize :%@", [NSValue valueWithCGSize:drawableSize]); 112 | self.drawableSizeShouldUpdate = NO; 113 | } 114 | [self.renderer renderPixelBuffer:pixelBuffer metalLayer:self.metalLayer mergeInfos:infos]; 115 | } 116 | 117 | - (void)dispose { 118 | [self.renderer dispose]; 119 | } 120 | 121 | #pragma mark - private 122 | 123 | - (void)onMetalViewUnavailable{ 124 | 125 | if ([self.delegate respondsToSelector:@selector(onMetalViewUnavailable)]) { 126 | [self.delegate onMetalViewUnavailable]; 127 | } 128 | } 129 | 130 | @end 131 | 132 | #endif 133 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Views/Metal/QGHWDMetalView.m: -------------------------------------------------------------------------------- 1 | // QGHWDMetalView.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGHWDMetalView.h" 17 | #import "QGVAPLogger.h" 18 | #import "QGHWDMetalRenderer.h" 19 | 20 | #if TARGET_OS_SIMULATOR//模拟器 21 | 22 | @implementation QGHWDMetalView 23 | 24 | - (instancetype)initWithFrame:(CGRect)frame blendMode:(QGHWDTextureBlendMode)mode { 25 | return [self initWithFrame:frame]; 26 | } 27 | 28 | - (void)display:(CVPixelBufferRef)pixelBuffer {} 29 | 30 | -(void)dispose {} 31 | 32 | @end 33 | 34 | #else 35 | 36 | @interface QGHWDMetalView () 37 | 38 | @property (nonatomic, strong) CAMetalLayer *metalLayer; 39 | @property (nonatomic, strong) QGHWDMetalRenderer *renderer; 40 | @property (nonatomic, assign) BOOL drawableSizeShouldUpdate; 41 | 42 | @end 43 | 44 | @implementation QGHWDMetalView 45 | 46 | #pragma mark - override 47 | 48 | + (Class)layerClass { 49 | return [CAMetalLayer class]; 50 | } 51 | 52 | - (instancetype)initWithCoder:(NSCoder *)aDecoder { 53 | NSAssert(0, @"initWithCoder: has not been implemented"); 54 | return nil; 55 | } 56 | 57 | - (instancetype)initWithFrame:(CGRect)frame { 58 | 59 | if (self = [super initWithFrame:frame]) { 60 | _drawableSizeShouldUpdate = YES; 61 | _blendMode = QGHWDTextureBlendMode_AlphaLeft; 62 | } 63 | return self; 64 | } 65 | 66 | - (void)didMoveToWindow { 67 | [super didMoveToWindow]; 68 | self.drawableSizeShouldUpdate = YES; 69 | } 70 | 71 | - (void)layoutSubviews { 72 | [super layoutSubviews]; 73 | self.drawableSizeShouldUpdate = YES; 74 | } 75 | 76 | - (void)dealloc { 77 | [self onMetalViewUnavailable]; 78 | } 79 | 80 | #pragma mark - main 81 | 82 | - (instancetype)initWithFrame:(CGRect)frame blendMode:(QGHWDTextureBlendMode)mode { 83 | 84 | if (self = [super initWithFrame:frame]) { 85 | _drawableSizeShouldUpdate = YES; 86 | _blendMode = QGHWDTextureBlendMode_AlphaLeft; 87 | _metalLayer = (CAMetalLayer *)self.layer; 88 | _metalLayer.frame = self.frame; 89 | _metalLayer.opaque = NO; 90 | _blendMode = mode; 91 | _renderer = [[QGHWDMetalRenderer alloc] initWithMetalLayer:_metalLayer blendMode:mode]; 92 | _metalLayer.contentsScale = [UIScreen mainScreen].scale; 93 | _metalLayer.pixelFormat = MTLPixelFormatBGRA8Unorm; 94 | _metalLayer.framebufferOnly = YES; 95 | } 96 | return self; 97 | } 98 | 99 | - (void)display:(CVPixelBufferRef)pixelBuffer { 100 | if (!self.window) { 101 | VAP_Event(kQGVAPModuleCommon, @"quit display pixelbuffer, cuz window is nil!"); 102 | [self onMetalViewUnavailable]; 103 | return ; 104 | } 105 | if (self.drawableSizeShouldUpdate) { 106 | CGFloat nativeScale = [UIScreen mainScreen].nativeScale; 107 | CGSize drawableSize = CGSizeMake(CGRectGetWidth(self.bounds)*nativeScale, CGRectGetHeight(self.bounds)*nativeScale); 108 | self.metalLayer.drawableSize = drawableSize; 109 | VAP_Event(kQGVAPModuleCommon, @"update drawablesize :%@", [NSValue valueWithCGSize:drawableSize]); 110 | self.drawableSizeShouldUpdate = NO; 111 | } 112 | self.renderer.blendMode = self.blendMode; 113 | [self.renderer renderPixelBuffer:pixelBuffer metalLayer:self.metalLayer]; 114 | } 115 | 116 | /** 117 | 资源回收 118 | */ 119 | - (void)dispose { 120 | [self.renderer dispose]; 121 | } 122 | 123 | #pragma mark - private 124 | 125 | - (void)onMetalViewUnavailable{ 126 | 127 | if ([self.delegate respondsToSelector:@selector(onMetalViewUnavailable)]) { 128 | [self.delegate onMetalViewUnavailable]; 129 | } 130 | } 131 | 132 | @end 133 | 134 | #endif 135 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/dkhelperDylib.m: -------------------------------------------------------------------------------- 1 | // 2 | // dkhelperDylib.m 3 | // dkhelperDylib 4 | // 5 | // Created by 朱德坤 on 2019/1/23. 6 | // Copyright (c) 2019 DKJone. All rights reserved. 7 | // 8 | 9 | #import "dkhelperDylib.h" 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | 16 | //MARK: - 请求数据伪装 17 | 18 | CHDeclareClass(ASIdentifierManager) 19 | 20 | //广告标识符伪装 21 | CHMethod0(NSUUID *, ASIdentifierManager, advertisingIdentifier) 22 | { 23 | NSUUID *advertisingIdentifier; 24 | NSString *key = @"idfa"; 25 | 26 | NSString *idfa = [[NSUserDefaults standardUserDefaults] stringForKey:key]; 27 | 28 | if (idfa && idfa.length) 29 | { 30 | advertisingIdentifier = [[NSUUID alloc] initWithUUIDString:idfa]; 31 | } 32 | else 33 | { 34 | advertisingIdentifier = [NSUUID UUID]; 35 | 36 | [[NSUserDefaults standardUserDefaults] setObject:advertisingIdentifier.UUIDString forKey:key]; 37 | } 38 | 39 | return advertisingIdentifier; 40 | } 41 | 42 | @class BaseAuthReqInfo, BaseRequest, ManualAuthAesReqData; 43 | 44 | CHDeclareClass(ManualAuthAesReqData); 45 | 46 | 47 | //bundleId 伪装(待完善) 48 | CHMethod1(void, ManualAuthAesReqData, setBundleId, NSString *, bundleId) 49 | { 50 | NSLog(@"======-获取请求时验证数据-========"); 51 | if ([bundleId isEqualToString:[NSBundle mainBundle].bundleIdentifier]) 52 | { 53 | bundleId = @"com.tencent.xin"; 54 | } 55 | 56 | CHSuper1(ManualAuthAesReqData, setBundleId, bundleId); 57 | } 58 | 59 | //clientSeqId 伪装 60 | CHMethod1(void, ManualAuthAesReqData, setClientSeqId, NSString *, clientSeqId) 61 | { 62 | NSString *key = @"clientSeqId"; 63 | NSString *clientSeqId_fist = [[NSUserDefaults standardUserDefaults] stringForKey:key]; 64 | if (!clientSeqId_fist || clientSeqId_fist.length == 0) 65 | { 66 | clientSeqId_fist = [[NSUUID UUID].UUIDString stringByReplacingOccurrencesOfString:@"-" withString:@""]; 67 | [[NSUserDefaults standardUserDefaults] setObject:clientSeqId_fist forKey:key]; 68 | } 69 | 70 | NSString *newClientSeqId; 71 | 72 | if ([clientSeqId containsString:@"-"]) 73 | { 74 | NSRange range = [clientSeqId rangeOfString:@"-"]; 75 | NSString *clientSeqId_last = [clientSeqId substringFromIndex:range.location]; 76 | 77 | newClientSeqId = [NSString stringWithFormat:@"%@%@", clientSeqId_fist, clientSeqId_last]; 78 | } 79 | else 80 | { 81 | newClientSeqId = clientSeqId_fist; 82 | } 83 | 84 | CHSuper1(ManualAuthAesReqData, setClientSeqId, newClientSeqId); 85 | } 86 | 87 | //deviceName 伪装 88 | CHMethod1(void, ManualAuthAesReqData, setDeviceName, NSString *, deviceName) 89 | { 90 | //设置为默认名称 91 | deviceName = @"iPhone"; 92 | 93 | CHSuper1(ManualAuthAesReqData, setDeviceName, deviceName); 94 | } 95 | 96 | //过日志记录 97 | @class MMCrashReportExtLogMgr; 98 | 99 | CHDeclareClass(MMCrashReportExtLogMgr); 100 | 101 | CHMethod2(void, MMCrashReportExtLogMgr, addLogInfo, int *, arg1, withMessage, const char *, arg2) 102 | { 103 | return; 104 | } 105 | 106 | //过越狱检测 107 | @class JailBreakHelper; 108 | 109 | CHDeclareClass(JailBreakHelper); 110 | 111 | CHMethod0(BOOL, JailBreakHelper, HasInstallJailbreakPluginInvalidIAPPurchase) 112 | { 113 | return NO; 114 | } 115 | 116 | CHMethod1(BOOL, JailBreakHelper, HasInstallJailbreakPlugin, id, arg1) 117 | { 118 | return NO; 119 | } 120 | 121 | CHMethod0(BOOL, JailBreakHelper, IsJailBreak) 122 | { 123 | return NO; 124 | } 125 | 126 | //所有被hook的类和函数放在这里的构造函数中 127 | CHConstructor 128 | { 129 | @autoreleasepool 130 | { 131 | CHLoadLateClass(ASIdentifierManager); 132 | CHHook0(ASIdentifierManager, advertisingIdentifier); 133 | 134 | CHLoadLateClass(ManualAuthAesReqData); 135 | CHHook1(ManualAuthAesReqData, setBundleId); 136 | CHHook1(ManualAuthAesReqData, setClientSeqId); 137 | CHHook1(ManualAuthAesReqData, setDeviceName); 138 | 139 | CHLoadLateClass(MMCrashReportExtLogMgr); 140 | CHHook2(MMCrashReportExtLogMgr, addLogInfo, withMessage); 141 | 142 | CHLoadLateClass(JailBreakHelper); 143 | CHHook0(JailBreakHelper, HasInstallJailbreakPluginInvalidIAPPurchase); 144 | CHHook1(JailBreakHelper, HasInstallJailbreakPlugin); 145 | CHHook0(JailBreakHelper, IsJailBreak); 146 | 147 | 148 | 149 | 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/UIView+VAP.h: -------------------------------------------------------------------------------- 1 | // UIView+VAP.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import "VAPMacros.h" 18 | #import "QGVAPLogger.h" 19 | 20 | @class QGMP4AnimatedImageFrame,QGVAPConfigModel, QGVAPSourceInfo; 21 | /** 注意:回调方法会在子线程被执行。*/ 22 | @protocol HWDMP4PlayDelegate 23 | 24 | @optional 25 | //即将开始播放时询问,true马上开始播放,false放弃播放 26 | - (BOOL)shouldStartPlayMP4:(VAPView *)container config:(QGVAPConfigModel *)config; 27 | 28 | - (void)viewDidStartPlayMP4:(VAPView *)container; 29 | - (void)viewDidPlayMP4AtFrame:(QGMP4AnimatedImageFrame*)frame view:(VAPView *)container; 30 | - (void)viewDidStopPlayMP4:(NSInteger)lastFrameIndex view:(VAPView *)container; 31 | - (void)viewDidFinishPlayMP4:(NSInteger)totalFrameCount view:(VAPView *)container; 32 | - (void)viewDidFailPlayMP4:(NSError *)error; 33 | 34 | //vap APIs 35 | - (NSString *)contentForVapTag:(NSString *)tag resource:(QGVAPSourceInfo *)info; //替换配置中的资源占位符(不处理直接返回tag) 36 | - (void)loadVapImageWithURL:(NSString *)urlStr context:(NSDictionary *)context completion:(VAPImageCompletionBlock)completionBlock; //由于组件内不包含网络图片加载的模块,因此需要外部支持图片加载。 37 | 38 | @end 39 | 40 | @interface UIView (VAP) 41 | 42 | @property (nonatomic, weak) id hwd_Delegate; 43 | @property (nonatomic, readonly) QGMP4AnimatedImageFrame *hwd_currentFrame; 44 | @property (nonatomic, strong) NSString *hwd_MP4FilePath; 45 | @property (nonatomic, assign) NSInteger hwd_fps; //fps for dipslay, each frame's duration would be set by fps value before display. 46 | @property (nonatomic, assign) BOOL hwd_renderByOpenGL; //是否使用opengl渲染,默认使用metal 47 | 48 | - (void)playHWDMp4:(NSString *)filePath; 49 | - (void)playHWDMP4:(NSString *)filePath delegate:(id)delegate; 50 | - (void)playHWDMP4:(NSString *)filePath repeatCount:(NSInteger)repeatCount delegate:(id)delegate; 51 | 52 | - (void)stopHWDMP4; 53 | - (void)pauseHWDMP4; 54 | - (void)resumeHWDMP4; 55 | 56 | + (void)registerHWDLog:(QGVAPLoggerFunc)logger; 57 | 58 | @end 59 | 60 | @interface UIView (VAPGesture) 61 | 62 | //增加点击的手势识别 63 | - (void)addVapTapGesture:(VAPGestureEventBlock)handler; 64 | 65 | //手势识别通用接口 66 | - (void)addVapGesture:(UIGestureRecognizer *)gestureRecognizer callback:(VAPGestureEventBlock)handler; 67 | 68 | @end 69 | 70 | @interface UIView (VAPMask) 71 | 72 | @property (nonatomic, strong) QGVAPMaskInfo *vap_maskInfo; 73 | 74 | @end 75 | 76 | @interface UIView (MP4HWDDeprecated) 77 | 78 | - (void)playHWDMP4:(NSString *)filePath blendMode:(QGHWDTextureBlendMode)mode delegate:(id)delegate __attribute__((deprecated("QGHWDTextureBlendMode is no longer work in vap, use playHWDMP4:delegate: instead"))); 79 | - (void)playHWDMP4:(NSString *)filePath blendMode:(QGHWDTextureBlendMode)mode repeatCount:(NSInteger)repeatCount delegate:(id)delegate __attribute__((deprecated("QGHWDTextureBlendMode is no longer work in vap, use playHWDMP4:repeatCount:delegate: instead"))); 80 | - (void)playHWDMP4:(NSString *)filePath fps:(NSInteger)fps delegate:(id)delegate __attribute__((deprecated("customized fps is not recommended, use playHWDMP4:delegate: instead"))); 81 | - (void)playHWDMP4:(NSString *)filePath fps:(NSInteger)fps repeatCount:(NSInteger)repeatCount delegate:(id)delegate __attribute__((deprecated("customized fps is not recommended, use playHWDMP4:repeatCount:delegate: instead"))); 82 | - (void)playHWDMP4:(NSString *)filePath fps:(NSInteger)fps blendMode:(QGHWDTextureBlendMode)mode delegate:(id)delegate __attribute__((deprecated("customized fps is not recommended, use playHWDMP4:delegate: instead"))); 83 | - (void)playHWDMP4:(NSString *)filePath fps:(NSInteger)fps blendMode:(QGHWDTextureBlendMode)mode repeatCount:(NSInteger)repeatCount delegate:(id)delegate __attribute__((deprecated("customized fps is not recommended, use playHWDMP4:repeatCount:delegate: instead"))); 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DKWechatHelper 2 | 3 | 4 | 5 | 不止于抢红包,功能丰富的微信插件。本软件已成功运行在(iphone7-iphone14、iPad) 6 | 给个⭐️不迷路↗️ 7 | 8 | |[v1.1.0](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.1.0)适用微信8.0.38 |[v1.0.9](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.9)适用微信8.0.13 || 9 | | --- | --- | --- | 10 | | [v1.0.8](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.8)适用微信8.0.6 |[v1.0.7](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.7)适用微信8.0.1 | [v1.0.6](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.6)适用微信7.0.17 | 11 | | [v1.0.5](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.5)适用微信7.0.15 | [v1.0.4](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.4)适用微信7.0.14 | [v1.0.3](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.3)适用微信7.0.13 | 12 | |[v1.0.2](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.2)适用微信7.0.11 |[v1.0.1](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.1)适用微信7.0.8~7.0.10 |[v1.0.0](https://github.com/DKWechatHelper/DKWechatHelper/releases/tag/1.0.0) 适用微信7.0.0-7.0.3 | 13 | 14 | 更多更新内容请查看[CHANGELOG](./CHANGELOG.md) 15 | 图片加载失败可以到[掘金](https://juejin.cn/post/7009142365671817223)查看,本文将在[掘金](https://juejin.cn/post/7009142365671817223)同步更新。 16 | ## 特色 17 | 1.完全融入微信8.0UI风格,沉浸式体验 18 | 2.完全免费的全功能插件 19 | 3.非越狱可后台抢红包 20 | 4.安全高效源码公开 21 | 5.设置方便,手机无需越狱 22 | ## 功能 23 | 24 | * [x] 自动抢红包 25 | * [x] 后台抢红包 26 | * [x] 群聊过滤 27 | * [x] 关键词过滤 28 | * [x] 消息防撤回 29 | * [x] 微信步数修改 30 | * [x] 小游戏作弊(剪刀石头布和掷骰子) 31 | * [x] CallKit锁屏接视频语音 32 | * [x] 集赞助手 33 | * [x] 好友关系检测(已更新) 34 | * [x] 朋友圈转发 35 | * [x] 动态聊天背景 36 | * [x] 动态启动图 37 | 38 | 安装后在微信设置中点击“微信小助手” 39 | 更多请查看下图: 40 | 41 | ![IMG_0223](./IMG_0223.png) 42 | ![IMG_0223](./IMG_0031.JPG) 43 | 44 | ## 使用: 45 | ⚠️⚠️⚠️下载默认密码:`dkjone` 46 | 1.源码学习 47 | 下载本项目,下载砸壳后的微信(7.0以上)(我给你准备了个) 48 | 49 | |[8.0.38](https://url15.ctfile.com/f/24576815-874026915-d7c546?p=1756)|[8.0.13](https://url15.ctfile.com/f/24576815-513705776-0adb11) |[8.0.6](https://n802.com/f/24576815-496573913-9ce385)| 50 | |---| --- | --- | 51 | |[8.0.1](https://n802.com/f/24576815-480279421-6c84b9)|[7.0.17](https://n802.com/file/24576815-467161527)|[7.0.15](https://n802.com/file/24576815-463029595) | 52 | |[7.0.14](https://n802.com/file/24576815-452231690) |[7.0.13-*提取码: nx4m*](https://pan.baidu.com/s/1rqB0pV4zMEB6Z3VJTsTa8Q)|[7.0.11-*提取码: 2igg*](https://pan.baidu.com/s/1mU_mezsWhqL2-AY0PB-vVg) | 53 | | [7.0.8-*提取码:h54d*](https://pan.baidu.com/s/11VoUXPC4vb5zg8HzP3kC0Q) | [7.0.2](https://pan.baidu.com/s/1SHZHfu94Z_jhCkaaFDx8pA) | [7.0.0](https://pan.baidu.com/s/15pVma66Ea822YVGrBa2GHw) | 54 | 55 | 将下载的微信放到'/dkhelper/dkhelper/TargetApp/'目录下该目录下有一个空白文件’put ipa or app here‘,和它放在同一文件夹下即可,修改项目BundleId及签名信息,选择真机设备运行即可 56 | 57 | 2.开发者: 58 | 下载以下ipa后重签名应用: 59 | 60 | | [未签名版8.0.38](https://url15.ctfile.com/f/24576815-874026981-5029c9?p=1756)||| 61 | | --- | --- | --- | 62 | | [未签名版8.0.13](https://url15.ctfile.com/f/24576815-513705667-6aa955) |[未签名版8.0.6](https://n802.com/f/24576815-496574216-b01bf7) | [未签名版8.0.1](https://n802.com/f/24576815-480300249-d79448) | 63 | |[未签名版7.0.17](https://n802.com/file/24576815-467161662) |[未签名版7.0.15](https://n802.com/file/24576815-463034104)|[未签名版7.0.14](https://n802.com/file/24576815-452232682) | 64 | | [未签名版7.0.13-*提取码: fhes*](https://pan.baidu.com/s/1DgSl5u0Gip3cNdqZmRFEWw) | [未签名版7.0.11-*提取码: fe9f*](https://pan.baidu.com/s/1sOPCqnCPxSdIKq7TKuHK9g) | [未签名版7.0.0](https://pan.baidu.com/s/1-zEUQRGn3H4bZVqHpyffzQ) | 65 | 66 | 注:推荐使用[ios-app-signer](https://github.com/DanTheMan827/ios-app-signer)签名,使用方法自行百度 67 | 68 | 3.普通用户: 69 | 前往以下地址下载:上方未签名版 70 | 下载后使用 [Cydia Impactor](http://www.cydiaimpactor.com/)或者`爱思助手`或者[AltStore](https://github.com/rileytestut/AltStore)安装 71 | 72 | 4.越狱用户: 73 | 添加源`https://dkjone.github.io/`下载或直接下载deb文件: 74 | | [1.1.0deb](https://url15.ctfile.com/f/24576815-874029648-9fec88?p=1756 ) | [1.0.9deb](https://url15.ctfile.com/f/24576815-513707605-d0d6fb) | [1.0.8deb](https://n802.com/f/24576815-496575548-fa5b89) | [其他deb下载地址](https://gitee.com/DKJone/dkjone.github.io/tree/master/debs) | 75 | | --- | --- | --- |--- | 76 | 77 | 78 | 79 | ### 请我喝杯☕️ 80 | 81 | | 微信 | 支付宝 | 82 | | --- | --- | 83 | | ![IMG_4272](./IMG_4272.JPG) | ![IMG_4286](./IMG_4286.JPG)| 84 | 85 | 86 | 87 | 88 | ### 感谢: 89 | 本插件所有内容均为免费内容,其中使用了部分已存在项目源码构建。感谢以下项目的开源: 90 | 1.[WeChatPlugin-iOS](https://github.com/TKkk-iOSer/WeChatPlugin-iOS) 91 | 2.[WeChatRedEnvelop](https://github.com/buginux/WeChatRedEnvelop) 92 | 3.[MonkeyDev](https://github.com/AloneMonkey/MonkeyDev) 93 | 4.[微信共存防封版伪代码分析](https://www.jianshu.com/p/e797ba55e336) 94 | 95 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/MyUtils/DKHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // DKHelper.h 3 | // testHookDylib 4 | // 5 | // Created by 朱德坤 on 2019/1/21. 6 | // Copyright © 2019 DKJone. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //MARK: - wechat quick imports 12 | #import "UiUtil.h" 13 | #import "WechatHeaders.h" 14 | #import 15 | #import "WCUIAlertView.h" 16 | #import "DKHelperConfig.h" 17 | #import 18 | #import "NSArray+Utils.h" 19 | #import "DKLaunchHelper.h" 20 | #import "DKLaunchViewController.h" 21 | #import 22 | //MARK: - quick objc finds 23 | #define FUiUtil objc_getClass("UiUtil") 24 | #define FMMUICommonUtil objc_getClass("MMUICommonUtil") 25 | #define FWCTableViewCellManager objc_getClass("WCTableViewNormalCellManager") 26 | #define WK(object) autoreleasepool{} __weak typeof(object) weak##object = object 27 | #define ST(object) autoreleasepool{} __strong typeof(object) object = weak##object 28 | #define WS(weakSelf) __weak __typeof(&*self)weakSelf = self; 29 | #define SS(strongSelf) __strong __typeof(weakSelf)strongSelf = weakSelf; 30 | #define isDKForDeb (YES) 31 | #define documentPath [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] 32 | #define libPath [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject] 33 | #define vapPath [libPath stringByAppendingPathComponent:@"/dkjone/vapFiles"] 34 | 35 | typedef void(^BtnBlock)(UIButton *sender); 36 | 37 | 38 | @interface DKHelper : NSObject 39 | 40 | /// 好友关系是否检测完毕 41 | @property (nonatomic,assign)BOOL checkFriendsEnd; 42 | /// 已将你删除的好友 43 | @property (nonatomic,strong)NSMutableArray *notFriends; 44 | /// 账号被封的好友 45 | @property (nonatomic,strong)NSMutableArray *invalidFriends; 46 | /// 相互好友 47 | @property (nonatomic,strong)NSMutableArray *validFriends; 48 | 49 | @property (nonatomic,copy)NSString* groupURL; 50 | 51 | @property (nonatomic,copy)NSDictionary *currentCheckResult; 52 | 53 | @property (nonatomic ,strong) dispatch_semaphore_t friendCheckSem; 54 | 55 | +(void)checkFriends; 56 | +(BOOL)vapFileExit; 57 | + (instancetype)shared ; 58 | /// 所有好友(不包含公众号) 59 | + (NSArray *)allFriends; 60 | 61 | /// 朋友圈点赞用户集合 62 | + (NSMutableArray*)commentUsers; 63 | 64 | /// 朋友圈评论 65 | + (NSMutableArray*)commentWith:(WCDataItem *) origItem; 66 | 67 | + (UIBarButtonItem *)leftNavigationItem; 68 | 69 | + (UINavigationController *)navigationContrioller; 70 | 71 | + (UIColor *)backgroundColor; 72 | 73 | + (CGRect)viewFrame; 74 | 75 | + (WCTableViewManager *)tableManageWithViewFrame; 76 | 77 | + (WCTableViewSectionManager *) sectionManage; 78 | 79 | + (WCTableViewNormalCellManager *)cellWithSel:(SEL)sel target:(id)target title:(NSString *)title; 80 | + (WCTableViewNormalCellManager *)cellWithSel:(SEL)sel target:(id)target title:(NSString *)title rightValue:(NSString *)rightValue accessoryType:(long long) acctype; 81 | + (WCTableViewNormalCellManager *)switchCellWithSel:(SEL)sel target:(id)target title:(NSString *)title switchOn:(BOOL)switchOn; 82 | + (WCUIAlertView *)showAlertWithTitle:(NSString *)title message:(NSString *)msg btnTitle:(NSString *)btnTitle handler:(BtnBlock)handler; 83 | + (WCUIAlertView *)showAlertWithTitle:(NSString *)title message:(NSString *)msg btnTitle:(NSString *)btn1 handler:(BtnBlock)handler1 btnTitle:(NSString *)btn2 handler:(BtnBlock)handler2; 84 | + (void)sendMsg:(NSString *)msg toContactUsrName:(NSString *)userName; 85 | + (void)sendMsg:(NSString *)msg toContactUsrName:(NSString *)userName uiMsgType:(int)type; 86 | +(CMAccelerometerHandler)startAccelerometerUpdatesToQueue:(id)queue withHandler:(CMAccelerometerHandler )handle; 87 | 88 | + (void)Log:(NSString*)msg; 89 | @end 90 | 91 | @interface WeChatRedEnvelopParam : NSObject 92 | - (NSDictionary *)toParams; 93 | @property (strong, nonatomic) NSString *msgType; 94 | @property (strong, nonatomic) NSString *sendId; 95 | @property (strong, nonatomic) NSString *channelId; 96 | @property (strong, nonatomic) NSString *nickName; 97 | @property (strong, nonatomic) NSString *headImg; 98 | @property (strong, nonatomic) NSString *nativeUrl; 99 | @property (strong, nonatomic) NSString *sessionUserName; 100 | @property (strong, nonatomic) NSString *sign; 101 | @property (strong, nonatomic) NSString *timingIdentifier; 102 | 103 | @property (assign, nonatomic) BOOL isGroupSender; 104 | 105 | @end 106 | 107 | 108 | @interface WBRedEnvelopParamQueue : NSObject 109 | + (instancetype)sharedQueue; 110 | - (void)enqueue:(WeChatRedEnvelopParam *)param; 111 | - (WeChatRedEnvelopParam *)dequeue; 112 | - (WeChatRedEnvelopParam *)peek; 113 | - (BOOL)isEmpty; 114 | 115 | @end 116 | 117 | @class WeChatRedEnvelopParam; 118 | @interface WBReceiveRedEnvelopOperation : NSOperation 119 | 120 | - (instancetype)initWithRedEnvelopParam:(WeChatRedEnvelopParam *)param delay:(unsigned int)delaySeconds; 121 | 122 | @end 123 | 124 | @interface WBRedEnvelopTaskManager : NSObject 125 | 126 | + (instancetype)sharedManager; 127 | 128 | - (void)addNormalTask:(WBReceiveRedEnvelopOperation *)task; 129 | - (void)addSerialTask:(WBReceiveRedEnvelopOperation *)task; 130 | 131 | - (BOOL)serialQueueIsEmpty; 132 | 133 | @end 134 | 135 | 136 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Models/QGVAPConfigModel.h: -------------------------------------------------------------------------------- 1 | // QGVAPConfigModel.h 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import 17 | #import 18 | #import 19 | 20 | typedef NS_ENUM(NSInteger, QGVAPOrientation){ 21 | 22 | QGVAPOrientation_None = 0, // 兼容 23 | QGVAPOrientation_Portrait = 1, // 竖屏 24 | QGVAPOrientation_landscape = 2, // 横屏 25 | }; 26 | 27 | typedef NSString * QGAGAttachmentSourceType NS_EXTENSIBLE_STRING_ENUM;//资源类型 28 | typedef NSString * QGAGAttachmentSourceLoadType NS_EXTENSIBLE_STRING_ENUM;//资源加载类型 29 | typedef NSString * QGAGAttachmentSourceStyle NS_EXTENSIBLE_STRING_ENUM;//字体 30 | typedef NSString * QGAGAttachmentFitType NS_EXTENSIBLE_STRING_ENUM;//资源适配类型 31 | 32 | //资源适配类型 33 | UIKIT_EXTERN QGAGAttachmentFitType const kQGAGAttachmentFitTypeFitXY; //按指定尺寸缩放 34 | UIKIT_EXTERN QGAGAttachmentFitType const kQGAGAttachmentFitTypeCenterFull; //默认按资源尺寸展示,如果资源尺寸小于遮罩,则等比缩放至可填满 35 | //资源类型 36 | UIKIT_EXTERN QGAGAttachmentSourceType const kQGAGAttachmentSourceTypeTextStr; //文字 37 | UIKIT_EXTERN QGAGAttachmentSourceType const kQGAGAttachmentSourceTypeImgUrl; //图片 38 | 39 | UIKIT_EXTERN QGAGAttachmentSourceType const kQGAGAttachmentSourceTypeText; 40 | UIKIT_EXTERN QGAGAttachmentSourceType const kQGAGAttachmentSourceTypeImg; 41 | UIKIT_EXTERN QGAGAttachmentSourceLoadType const QGAGAttachmentSourceLoadTypeLocal; 42 | UIKIT_EXTERN QGAGAttachmentSourceLoadType const QGAGAttachmentSourceLoadTypeNet; 43 | 44 | //字体 45 | UIKIT_EXTERN QGAGAttachmentSourceStyle const kQGAGAttachmentSourceStyleBoldText; //粗体 46 | 47 | //https://docs.qq.com/sheet/DTGl0bXdidFVkS3pn?tab=7od8yj&c=C25A0I0 48 | @class QGVAPCommonInfo,QGVAPSourceInfo,QGVAPMergedInfo; 49 | @interface QGVAPConfigModel : NSObject 50 | 51 | @property (nonatomic, strong) QGVAPCommonInfo *info; 52 | @property (nonatomic, strong) NSArray *resources; 53 | @property (nonatomic, strong) NSDictionary *> *mergedConfig; ///@{帧,@[多个融合信息]} 54 | 55 | @end 56 | 57 | #pragma mark - 整体信息 58 | @interface QGVAPCommonInfo : NSObject 59 | 60 | @property (nonatomic, assign) NSInteger version; 61 | @property (nonatomic, assign) NSInteger framesCount; 62 | @property (nonatomic, assign) CGSize size; 63 | @property (nonatomic, assign) CGSize videoSize; 64 | @property (nonatomic, assign) QGVAPOrientation targetOrientaion; 65 | @property (nonatomic, assign) NSInteger fps; 66 | @property (nonatomic, assign) BOOL isMerged; 67 | @property (nonatomic, assign) CGRect alphaAreaRect; 68 | @property (nonatomic, assign) CGRect rgbAreaRect; 69 | 70 | @end 71 | 72 | #pragma mark - 渲染资源信息 73 | @interface QGVAPSourceInfo : NSObject 74 | 75 | //原始信息 76 | @property (nonatomic, strong) QGAGAttachmentSourceType type; 77 | @property (nonatomic, strong) QGAGAttachmentSourceLoadType loadType; 78 | @property (nonatomic, strong) NSString *contentTag; 79 | @property (nonatomic, strong) NSString *contentTagValue; 80 | @property (nonatomic, strong) UIColor *color; 81 | @property (nonatomic, strong) QGAGAttachmentSourceStyle style; 82 | @property (nonatomic, assign) CGSize size; 83 | @property (nonatomic, strong) QGAGAttachmentFitType fitType; 84 | 85 | //加载内容 86 | @property (nonatomic, strong) UIImage *sourceImage; 87 | @property (nonatomic, strong) id texture; 88 | @property (nonatomic, strong) id colorParamsBuffer; 89 | 90 | @end 91 | 92 | @interface QGVAPSourceDisplayItem : NSObject 93 | 94 | @property (nonatomic, assign) CGRect frame; 95 | @property (nonatomic, strong) QGVAPSourceInfo *sourceInfo; 96 | 97 | @end 98 | 99 | #pragma mark - 融合信息 100 | @interface QGVAPMergedInfo : NSObject 101 | 102 | @property (nonatomic, strong) QGVAPSourceInfo *source; 103 | @property (nonatomic, assign) NSInteger renderIndex; 104 | @property (nonatomic, assign) CGRect renderRect; 105 | @property (nonatomic, assign) BOOL needMask; 106 | @property (nonatomic, assign) CGRect maskRect; 107 | @property (nonatomic, assign) NSInteger maskRotation; 108 | 109 | //加载内容 110 | - (id)vertexBufferWithContainerSize:(CGSize)size maskContianerSize:(CGSize)mSize device:(id)device; 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /dkhelper/dkhelper/Config/MDConfig.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | MethodTrace 6 | 7 | LogLevel 8 | 1 9 | LogWhen 10 | 0 11 | LogRegexString 12 | 13 | TraceFlag 14 | 2 15 | TraceObject 16 | 2 17 | ClassRegexString 18 | 19 | CORE_CLASS_LIST 20 | 21 | MDConfigManager 22 | 23 | MDMethodTrace 24 | 25 | MDTraceClassInfo 26 | 27 | FastCoder 28 | 29 | NSManagedObject 30 | 31 | NSObject 32 | 33 | NSException 34 | 35 | NSTypesetter 36 | 37 | NSString 38 | 39 | NSCache 40 | 41 | NSPlaceholderString 42 | 43 | __NSCFString 44 | 45 | NSURL 46 | 47 | TraceMode 48 | 0 49 | MethodBlackList 50 | 51 | isKindOfClass: 52 | 53 | 54 | NSFont 55 | 56 | OS_object 57 | 58 | OS_xpc_object 59 | 60 | OS_dispatch_object 61 | 62 | OS_dispatch_queue 63 | 64 | NSSet 65 | 66 | NSOrderedSet 67 | 68 | __NSPlaceholderSet 69 | 70 | __NSPlaceholderOrderedSet 71 | 72 | NSMutableOrderedSet 73 | 74 | NSDictionary 75 | 76 | NSMutableDictionary 77 | 78 | __NSCFDictionary 79 | 80 | __NSDictionaryM 81 | 82 | __NSPlaceholderDictionary 83 | 84 | NSArray 85 | 86 | NSMutableArray 87 | 88 | __NSCFArray 89 | 90 | __NSArrayM 91 | 92 | __NSArrayI 93 | 94 | __NSPlaceholderArray 95 | 96 | NSDate 97 | 98 | __NSDate 99 | 100 | __NSPlaceholderDate 101 | 102 | NSNumber 103 | 104 | NSPlaceholderNumber 105 | 106 | NSPredicate 107 | 108 | NSRecursiveLock 109 | 110 | NSConcreteMapTable 111 | 112 | _UIPointVector 113 | 114 | NSConcreteHashTable 115 | 116 | FBSWorkspace 117 | 118 | FBSSerialQueue 119 | 120 | BSDescriptionBuilder 121 | 122 | FBSSceneImpl 123 | 124 | BSSettings 125 | 126 | FBSWorkspaceClient 127 | 128 | AVAudioSession 129 | 130 | 131 | USER_CLASS_LIST 132 | 133 | CContactMgr1 134 | 135 | TraceMode 136 | 1 137 | TraceFlag 138 | 1 139 | 140 | ContactSelectView1 141 | 142 | TraceMode 143 | 1 144 | TraceFlag 145 | 1 146 | 147 | CMessageMgr 148 | 149 | TraceMode 150 | 1 151 | TraceFlag 152 | 1 153 | 154 | CGroupMgr1 155 | 156 | TraceFlag 157 | 1 158 | MethodBlackList 159 | 160 | decodeData 161 | 162 | TraceMode 163 | 3 164 | 165 | 166 | 167 | Cycript 168 | 169 | nslog 170 | 171 | LoadAtLaunch 172 | 173 | priority 174 | 0 175 | content 176 | NSLog = function() { var types = 'v', args = [], count = arguments.length; for (var i = 0; i != count; ++i) { types += '@'; args.push(arguments[i]); } new Functor(dlsym(RTLD_DEFAULT, "NSLog"), types).apply(null, args); } 177 | 178 | ms 179 | 180 | LoadAtLaunch 181 | 182 | priority 183 | 1 184 | url 185 | https://raw.githubusercontent.com/AloneMonkey/MDCycript/master/MS.cy 186 | 187 | hook 188 | 189 | LoadAtLaunch 190 | 191 | priority 192 | 2 193 | content 194 | try{ 195 | var oldm = {}; 196 | HookMessage(CustomViewController, @selector(showChangeLog:), function(log) { 197 | NSLog("hooked by cycript!!!"); 198 | return oldm->call(this,log); 199 | }, oldm); 200 | }catch(err){ 201 | NSLog(err.toString()) 202 | } 203 | 204 | md 205 | 206 | LoadAtLaunch 207 | 208 | priority 209 | 3 210 | url 211 | https://raw.githubusercontent.com/AloneMonkey/MDCycript/master/md.cy 212 | 213 | 214 | 215 | 216 | -------------------------------------------------------------------------------- /dkhelper/dkhelperDylib/QGVAPlayer/class/Controllers/QGAnimatedImageDecodeManager.m: -------------------------------------------------------------------------------- 1 | // QGAnimatedImageDecodeManager.m 2 | // Tencent is pleased to support the open source community by making vap available. 3 | // 4 | // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 5 | // 6 | // Licensed under the MIT License (the "License"); you may not use this file except in 7 | // compliance with the License. You may obtain a copy of the License at 8 | // 9 | // http://opensource.org/licenses/MIT 10 | // 11 | // Unless required by applicable law or agreed to in writing, software distributed under the License is 12 | // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 13 | // either express or implied. See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #import "QGAnimatedImageDecodeManager.h" 17 | #import "QGAnimatedImageBufferManager.h" 18 | #import "QGBaseDecoder.h" 19 | #import "QGVAPSafeMutableArray.h" 20 | #import "QGMP4FrameHWDecoder.h" 21 | #import "QGVAPLogger.h" 22 | #import 23 | #import 24 | 25 | @interface QGAnimatedImageDecodeManager() { 26 | 27 | QGAnimatedImageDecodeConfig *_config; //解码配置 28 | QGBaseDFileInfo *_fileInfo; //sharpP文件信息 29 | NSMutableArray *_decoders; //解码器 30 | QGAnimatedImageBufferManager *_bufferManager; //缓冲管理 31 | AVAudioPlayer *_audioPlayer; 32 | } 33 | 34 | @end 35 | 36 | @implementation QGAnimatedImageDecodeManager 37 | 38 | - (instancetype)initWith:(QGBaseDFileInfo *)fileInfo 39 | config:(QGAnimatedImageDecodeConfig *)config 40 | delegate:(id)delegate { 41 | 42 | if (self = [super init]) { 43 | 44 | _config = config; 45 | _fileInfo = fileInfo; 46 | _decoderDelegate = delegate; 47 | [self createDecodersByConfig:config]; 48 | _bufferManager = [[QGAnimatedImageBufferManager alloc] initWithConfig:config]; 49 | [self initializeBuffers]; 50 | [self setupAudioPlayerIfNeed]; 51 | } 52 | return self; 53 | } 54 | 55 | /** 56 | 取出已解码的一帧并准备下一帧 57 | 58 | @param frameIndex 帧索引 59 | @return 帧内容 60 | */ 61 | - (QGBaseAnimatedImageFrame *)consumeDecodedFrame:(NSInteger)frameIndex { 62 | 63 | @synchronized (self) { 64 | // 控制何时命中第一帧,缓存满了才命中 65 | if (frameIndex == 0 && _bufferManager.buffers.count < _config.bufferCount) { 66 | return nil; 67 | } 68 | [self checkIfDecodeFinish:frameIndex]; 69 | QGBaseAnimatedImageFrame *frame = [_bufferManager popVideoFrame]; 70 | if (frame) { 71 | // pts顺序 72 | frame.frameIndex = frameIndex; 73 | [self decodeFrame:frameIndex+_config.bufferCount]; 74 | } 75 | return frame; 76 | } 77 | } 78 | 79 | - (void)tryToStartAudioPlay { 80 | if (!_audioPlayer) { 81 | return ; 82 | } 83 | [_audioPlayer play]; 84 | } 85 | 86 | #pragma mark - private methods 87 | 88 | - (void)checkIfDecodeFinish:(NSInteger)frameIndex { 89 | 90 | NSInteger decoderIndex = _decoders.count==1?0:frameIndex%_decoders.count; 91 | QGBaseDecoder *decoder = _decoders[decoderIndex]; 92 | if ([decoder isFrameIndexBeyondEnd:frameIndex]) { 93 | if ([self.decoderDelegate respondsToSelector:@selector(decoderDidFinishDecode:)]) { 94 | [self.decoderDelegate decoderDidFinishDecode:decoder]; 95 | } 96 | } 97 | } 98 | 99 | - (void)decodeFrame:(NSInteger)frameIndex { 100 | 101 | if (!_decoders || _decoders.count == 0) { 102 | //NSLog(@"error! can't find decoder"); 103 | return ; 104 | } 105 | NSInteger decoderIndex = _decoders.count==1?0:frameIndex%_decoders.count; 106 | QGBaseDecoder *decoder = _decoders[decoderIndex]; 107 | if ([decoder shouldStopDecode:frameIndex]) { 108 | return ; 109 | } 110 | [decoder decodeFrame:frameIndex buffers:_bufferManager.buffers]; 111 | } 112 | 113 | - (void)createDecodersByConfig:(QGAnimatedImageDecodeConfig *)config { 114 | 115 | if (!self.decoderDelegate || ![self.decoderDelegate respondsToSelector:@selector(decoderClassForManager:)]) { 116 | VAP_Event(kQGVAPModuleCommon, @"you MUST implement the delegate in invoker!"); 117 | NSAssert(0, @"you MUST implement the delegate in invoker!"); 118 | return ; 119 | } 120 | 121 | _decoders = [QGVAPSafeMutableArray new]; 122 | for (int i = 0; i < config.threadCount; i ++) { 123 | Class class = [self.decoderDelegate decoderClassForManager:self]; 124 | NSError *error = nil; 125 | QGBaseDecoder *decoder = [class alloc]; 126 | decoder = [decoder initWith:_fileInfo error:&error]; 127 | if (!decoder) { 128 | if ([self.decoderDelegate respondsToSelector:@selector(decoderDidFailDecode:error:)]) { 129 | [self.decoderDelegate decoderDidFailDecode:nil error:error]; 130 | } 131 | break ; 132 | } 133 | [_decoders addObject:decoder]; 134 | } 135 | } 136 | 137 | - (void)initializeBuffers { 138 | 139 | for (int i = 0; i < _config.bufferCount; i++) { 140 | [self decodeFrame:i]; 141 | } 142 | } 143 | 144 | - (void)setupAudioPlayerIfNeed { 145 | 146 | if ([_fileInfo isKindOfClass:[QGMP4HWDFileInfo class]]) { 147 | QGMP4ParserProxy *mp4Parser = [(QGMP4HWDFileInfo *)_fileInfo mp4Parser]; 148 | if (!mp4Parser.audioTrackBox) { 149 | _audioPlayer = nil; 150 | return ; 151 | } 152 | NSError *error; 153 | _audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:_fileInfo.filePath] error:&error]; 154 | } 155 | } 156 | 157 | - (void)dealloc { 158 | 159 | } 160 | 161 | @end 162 | --------------------------------------------------------------------------------