├── LICENSE ├── Makefile ├── README.md ├── Tweak.x ├── WeChatNoAds.plist └── control /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 hopeless 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | FINALPACKAGE=1 2 | 3 | # INSTALL_TARGET_PROCESSES = SpringBoard 4 | 5 | THEOS_PACKAGE_SCHEME=rootless 6 | 7 | ifeq ($(THEOS_PACKAGE_SCHEME), rootless) 8 | TARGET = iphone:clang:latest:15.0 9 | else 10 | TARGET = iphone:clang:latest:12.0 11 | endif 12 | 13 | 14 | include $(THEOS)/makefiles/common.mk 15 | 16 | TWEAK_NAME = WeChatNoAds 17 | 18 | WeChatNoAds_FILES = Tweak.x 19 | WeChatNoAds_CFLAGS = -fobjc-arc 20 | 21 | include $(THEOS_MAKE_PATH)/tweak.mk 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WechatNoAds 2 | 3 | ## Fuck WeChat ads! 4 | 5 | This tweak removes all wechat ads **including ads insdide articles and subscription pages!** 6 | 7 | The first tweak that removes almost all ads from wechat (except ads inside javascript WeApps.) 8 | 9 | ## Features 10 | 11 | * Remove all ads in moments 12 | * Remove all ads inside subscription channel articles 13 | * Remove all ads in subscription page 14 | * Remove hot word ads in main search page 15 | * Disable WeChat jailbreak detection 16 | 17 | ## Known issues 18 | 19 | * The only ads remains in WeApps, I can't find the specific function that creates WeApp Ads for now. 20 | -------------------------------------------------------------------------------- /Tweak.x: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | %hook WCFacade 4 | -(bool) isTimelineVideoSightAutoPlayEnable {return NO;} 5 | %end 6 | 7 | %hook WCDataItem 8 | -(bool) isVideoAd {return NO;} 9 | -(bool) isAd {return NO;} 10 | %end 11 | 12 | %hook WCMediaItem 13 | -(bool) isAd {return NO;} 14 | %end 15 | 16 | %hook WCAdvertiseStorage 17 | -(void) setOAdvertiseData:(id)x {} 18 | %end 19 | 20 | %hook JailBreakHelper 21 | -(bool) IsJailBreak {return NO;} 22 | -(bool) HasInstallJailbreakPlugin:(id)x {return NO;} 23 | -(bool) JailBroken {return NO;} 24 | %end 25 | 26 | %hook BTCanvasItemCellView 27 | -(void)popUpCanvas:(id)arg0 rect:(id)arg1 hexColor:(id)arg2 mode:(unsigned int)arg3 closeBlock:(id)arg4 {} 28 | -(double) canvasViewHeight {return 0;} 29 | -(double) getCanvasViewVisibleContainerHeight {return 0;} 30 | -(double) getCanvasViewVisibleOffsetY {return 0;} 31 | -(void) setViewModel:(id)x {} 32 | %end 33 | 34 | %hook BTCanvasItemCellViewModel 35 | -(double)viewHeight{return 0;} 36 | %end 37 | 38 | %hook __NSURLSessionLocal 39 | - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request 40 | completionHandler:(void (^)(NSData *data, 41 | NSURLResponse *response, 42 | NSError *error))completionHandler 43 | { 44 | NSString *url=request.URL.absoluteString; 45 | //NSLog(@"LOL:%@ %@", url, completionHandler); 46 | if ([url rangeOfString:@"getappmsgad"].location!=NSNotFound){ 47 | NSURL *x = [NSURL URLWithString:@"https://www.gstatic.com/generate_204"]; 48 | return %orig([NSMutableURLRequest requestWithURL:x], completionHandler); 49 | 50 | } 51 | else 52 | return %orig; 53 | }; 54 | %end 55 | 56 | %hook WSHotListContainerView 57 | -(bool) isSearchRecommendStyle {return NO;} 58 | %end 59 | 60 | %hook WAAppTask 61 | -(void) addSystemCoverViewIfNeeded {} 62 | -(void) splashAD_createSplashADWindow {} 63 | -(void) mainThread_splashAD_handleSplashADContainerIsPreload:(bool)x {} 64 | %end 65 | 66 | %hook WAAppTaskSplashADConfig 67 | -(bool) canShowSplashADWindow {return NO;} 68 | -(bool) launchShow {return NO;} 69 | %end 70 | 71 | %hook WCAdvertiseLiteAppUtils 72 | +(void) checkAdLiteAppPackageUpdate:(id)x {} 73 | %end 74 | 75 | %hook WCAdvertiseLogicMgr 76 | -(void)updateAdvertiseDataList:(id)x:(int)y {} 77 | -(void)pdateAdvertiseDataItemDetail:(id)x:(int)y {} 78 | -(void)updateDataItemDetail:(id)x:(int)y:(id)z {} 79 | -(bool) requestForSnsADObjectOpRequest:(id)x {return NO;} 80 | -(void) requestForSnsADObjectDetailRequest:(id)a:(int)b:(int)c:(id)d:(id)e:(int)f {} 81 | -(void) tryToPreloadWeAppForAdResource:(id)x {} 82 | -(void) tryToPreloadWeAppForAdCanvas:(id)x {} 83 | -(void) tryToPreloadWeApp:(id)x:(bool)y {} 84 | %end 85 | -------------------------------------------------------------------------------- /WeChatNoAds.plist: -------------------------------------------------------------------------------- 1 | { Filter = { Bundles = ( "com.tencent.xin" ); }; } 2 | -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Package: com.hopeless.wechatnoads 2 | Name: WeChatNoAds 3 | Version: 0.0.2 4 | Architecture: iphoneos-arm64 5 | Description: Fuck Wechat Ads 6 | Maintainer: hopeless 7 | Author: hopeless 8 | Section: Tweaks 9 | Depends: mobilesubstrate (>= 0.9.5000) 10 | --------------------------------------------------------------------------------