Created
October 22, 2022 07:44
-
-
Save danpashin/51a6a3c42128bbe3ad7c3d88c485501a to your computer and use it in GitHub Desktop.
VK for iOS SSL pinning bypass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <Security/Security.h> | |
typedef NS_ENUM(NSInteger, TSKTrustDecision) { | |
TSKTrustDecisionShouldAllowConnection, | |
TSKTrustDecisionShouldBlockConnection, | |
TSKTrustDecisionDomainNotPinned, | |
}; | |
%hook TSKPinningValidator | |
- (TSKTrustDecision)evaluateTrust:(SecTrustRef)certificate forHostname:(NSString *)hostname { | |
return TSKTrustDecisionDomainNotPinned; | |
} | |
%end | |
%hook Cronet | |
+ (void)setEnablePublicKeyPinningBypassForLocalTrustAnchors:(BOOL)enable { | |
%orig(YES); | |
} | |
%end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment