ios12-nt
This commit is contained in:
parent
c60341a350
commit
d2d4e21248
@ -0,0 +1,30 @@
|
||||
//
|
||||
// PTFakeMetaTouch.h
|
||||
// PTFakeTouch
|
||||
//
|
||||
// Created by PugaTang on 16/4/20.
|
||||
// Copyright © 2016年 PugaTang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface PTFakeMetaTouch : NSObject
|
||||
/**
|
||||
* Fake a touch event 构造一个触屏基础操作
|
||||
*
|
||||
* @param pointId 触屏操作的序列号
|
||||
* @param point 操作的目的位置
|
||||
* @param phase 操作的类别
|
||||
*
|
||||
* @return pointId 返回操作的序列号
|
||||
*/
|
||||
+ (NSInteger)fakeTouchId:(NSInteger)pointId AtPoint:(CGPoint)point withTouchPhase:(UITouchPhase)phase;
|
||||
/**
|
||||
* Get a not used pointId 获取一个没有使用过的触屏序列号
|
||||
*
|
||||
* @return pointId 返回序列号
|
||||
*/
|
||||
+ (NSInteger)getAvailablePointId;
|
||||
|
||||
@end
|
||||
@ -0,0 +1,19 @@
|
||||
//
|
||||
// FakeTouch.h
|
||||
// FakeTouch
|
||||
//
|
||||
// Created by PugaTang on 16/4/7.
|
||||
// Copyright © 2016年 PugaTang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import <PTFakeTouch/PTFakeMetaTouch.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
#define RLog(fmt, ...)
|
||||
#define DLog(fmt, ...) NSLog((@"PThelper " fmt), ##__VA_ARGS__);
|
||||
#else
|
||||
#define DLog(fmt, ...)
|
||||
#define RLog(fmt, ...) NSLog((@"PThelper " fmt), ##__VA_ARGS__);
|
||||
#endif
|
||||
BIN
max/template/playbtest/PTFakeTouch.framework/Info.plist
Normal file
BIN
max/template/playbtest/PTFakeTouch.framework/Info.plist
Normal file
Binary file not shown.
@ -0,0 +1,6 @@
|
||||
framework module PTFakeTouch {
|
||||
umbrella header "PTFakeTouch.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
BIN
max/template/playbtest/PTFakeTouch.framework/PTFakeTouch
Normal file
BIN
max/template/playbtest/PTFakeTouch.framework/PTFakeTouch
Normal file
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
# Uncomment the next line to define a global platform for your project
|
||||
# platform :ios, '9.0'
|
||||
platform :ios, '12.0'
|
||||
|
||||
target 'playbtest' do
|
||||
# Comment the next line if you don't want to use dynamic frameworks
|
||||
|
||||
83
max/template/playbtest/Podfile.lock
Normal file
83
max/template/playbtest/Podfile.lock
Normal file
@ -0,0 +1,83 @@
|
||||
PODS:
|
||||
- AppLovinDSPLinkedInAdapter (1.2.2.0):
|
||||
- AppLovinSDK
|
||||
- LinkedinAudienceNetwork (= 1.2.2)
|
||||
- AppLovinMediationMintegralAdapter (7.7.9.0.0):
|
||||
- AppLovinSDK (>= 13.0.0)
|
||||
- MintegralAdSDK (= 7.7.9)
|
||||
- MintegralAdSDK/BidSplashAd (= 7.7.9)
|
||||
- AppLovinMediationVungleAdapter (7.6.1.0):
|
||||
- AppLovinSDK (>= 13.0.0)
|
||||
- VungleAds (= 7.6.1)
|
||||
- AppLovinSDK (13.3.1)
|
||||
- LinkedinAudienceNetwork (1.2.2)
|
||||
- MintegralAdSDK (7.7.9):
|
||||
- MintegralAdSDK/BannerAd (= 7.7.9)
|
||||
- MintegralAdSDK/BidBannerAd (= 7.7.9)
|
||||
- MintegralAdSDK/BidInterstitialVideoAd (= 7.7.9)
|
||||
- MintegralAdSDK/BidNativeAd (= 7.7.9)
|
||||
- MintegralAdSDK/BidNewInterstitialAd (= 7.7.9)
|
||||
- MintegralAdSDK/BidRewardVideoAd (= 7.7.9)
|
||||
- MintegralAdSDK/InterstitialVideoAd (= 7.7.9)
|
||||
- MintegralAdSDK/NativeAd (= 7.7.9)
|
||||
- MintegralAdSDK/NewInterstitialAd (= 7.7.9)
|
||||
- MintegralAdSDK/RewardVideoAd (= 7.7.9)
|
||||
- MintegralAdSDK/BannerAd (7.7.9):
|
||||
- MintegralAdSDK/NativeAd
|
||||
- MintegralAdSDK/BidBannerAd (7.7.9):
|
||||
- MintegralAdSDK/BannerAd
|
||||
- MintegralAdSDK/BidNativeAd
|
||||
- MintegralAdSDK/BidInterstitialVideoAd (7.7.9):
|
||||
- MintegralAdSDK/BidNativeAd
|
||||
- MintegralAdSDK/InterstitialVideoAd
|
||||
- MintegralAdSDK/BidNativeAd (7.7.9):
|
||||
- MintegralAdSDK/NativeAd
|
||||
- MintegralAdSDK/BidNewInterstitialAd (7.7.9):
|
||||
- MintegralAdSDK/BidNativeAd
|
||||
- MintegralAdSDK/NewInterstitialAd
|
||||
- MintegralAdSDK/BidRewardVideoAd (7.7.9):
|
||||
- MintegralAdSDK/BidNativeAd
|
||||
- MintegralAdSDK/RewardVideoAd
|
||||
- MintegralAdSDK/BidSplashAd (7.7.9):
|
||||
- MintegralAdSDK/BidNativeAd
|
||||
- MintegralAdSDK/SplashAd
|
||||
- MintegralAdSDK/InterstitialVideoAd (7.7.9):
|
||||
- MintegralAdSDK/NativeAd
|
||||
- MintegralAdSDK/NativeAd (7.7.9)
|
||||
- MintegralAdSDK/NewInterstitialAd (7.7.9):
|
||||
- MintegralAdSDK/InterstitialVideoAd
|
||||
- MintegralAdSDK/NativeAd
|
||||
- MintegralAdSDK/RewardVideoAd (7.7.9):
|
||||
- MintegralAdSDK/NativeAd
|
||||
- MintegralAdSDK/SplashAd (7.7.9):
|
||||
- MintegralAdSDK/NativeAd
|
||||
- VungleAds (7.6.1)
|
||||
|
||||
DEPENDENCIES:
|
||||
- AppLovinDSPLinkedInAdapter
|
||||
- AppLovinMediationMintegralAdapter
|
||||
- AppLovinMediationVungleAdapter
|
||||
- AppLovinSDK (= 13.3.1)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- AppLovinDSPLinkedInAdapter
|
||||
- AppLovinMediationMintegralAdapter
|
||||
- AppLovinMediationVungleAdapter
|
||||
- AppLovinSDK
|
||||
- LinkedinAudienceNetwork
|
||||
- MintegralAdSDK
|
||||
- VungleAds
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
AppLovinDSPLinkedInAdapter: 093f25d472b4073f8203fa72a68347cbd589e232
|
||||
AppLovinMediationMintegralAdapter: c73b2cbce91600868c49c08adae5cc2664bc330c
|
||||
AppLovinMediationVungleAdapter: a8f71336d2650feaa97df108ebea5df9b254cd27
|
||||
AppLovinSDK: 5075837afdee4fb429121799b8cbcc5918ef3a23
|
||||
LinkedinAudienceNetwork: de299f32547bd528916b3c9f113015f74347398c
|
||||
MintegralAdSDK: 054814f99bb7e967b8974fe635d9005b225cbe42
|
||||
VungleAds: ab78d62721933672a83efcf7d2de8ae0610494be
|
||||
|
||||
PODFILE CHECKSUM: 1daa226f1ca828aaf0d892b45d7fd0607d11e49f
|
||||
|
||||
COCOAPODS: 1.16.2
|
||||
@ -11,6 +11,10 @@
|
||||
048D61A22D67204900FDE496 /* XUDPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 048D61A12D67204900FDE496 /* XUDPClient.m */; };
|
||||
048D61A32D67204900FDE496 /* GCDAsyncUdpSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 048D619E2D67204900FDE496 /* GCDAsyncUdpSocket.m */; };
|
||||
04C0D91E2D83D5030012DDF5 /* MyTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C0D91D2D83D5030012DDF5 /* MyTableViewCell.swift */; };
|
||||
04E394A02EB3468100679E92 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04E3949F2EB3468100679E92 /* IOKit.framework */; };
|
||||
04E394A12EB3468800679E92 /* Pods_playbtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1D072A2AFA6387E393A835 /* Pods_playbtest.framework */; };
|
||||
04E394A32EB3468E00679E92 /* PTFakeTouch.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04E3949D2EB3466300679E92 /* PTFakeTouch.framework */; };
|
||||
04E394A42EB3468E00679E92 /* PTFakeTouch.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 04E3949D2EB3466300679E92 /* PTFakeTouch.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
751A9FFB2CE1E31700BFC689 /* closeWindows.swift in Sources */ = {isa = PBXBuildFile; fileRef = 751A9FFA2CE1E31700BFC689 /* closeWindows.swift */; };
|
||||
7577E56C2CDA085400B7EDBF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7577E56B2CDA085400B7EDBF /* AppDelegate.swift */; };
|
||||
7577E5702CDA085400B7EDBF /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7577E56F2CDA085400B7EDBF /* ViewController.swift */; };
|
||||
@ -23,18 +27,18 @@
|
||||
75B994A02D23AED00046561D /* idfa.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B9949F2D23AED00046561D /* idfa.swift */; };
|
||||
75E053D22CDB060E0097DA69 /* YL_NetWorkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75E053D12CDB060E0097DA69 /* YL_NetWorkManager.swift */; };
|
||||
75E053D62CDB07F00097DA69 /* closeAD.m in Sources */ = {isa = PBXBuildFile; fileRef = 75E053D52CDB07F00097DA69 /* closeAD.m */; };
|
||||
97D9032452C29760C7B26B57 /* Pods_playbtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1D072A2AFA6387E393A835 /* Pods_playbtest.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
044C8D012E0CECA500625F9A /* Embed Libraries */ = {
|
||||
04E394A52EB3468E00679E92 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
04E394A42EB3468E00679E92 /* PTFakeTouch.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Libraries";
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
@ -47,6 +51,8 @@
|
||||
048D61A02D67204900FDE496 /* XUDPClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XUDPClient.h; sourceTree = "<group>"; };
|
||||
048D61A12D67204900FDE496 /* XUDPClient.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XUDPClient.m; sourceTree = "<group>"; };
|
||||
04C0D91D2D83D5030012DDF5 /* MyTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyTableViewCell.swift; sourceTree = "<group>"; };
|
||||
04E3949D2EB3466300679E92 /* PTFakeTouch.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = PTFakeTouch.framework; sourceTree = "<group>"; };
|
||||
04E3949F2EB3468100679E92 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
|
||||
365725DAEE7A265FA302BB10 /* Pods-playbtest.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-playbtest.release.xcconfig"; path = "Target Support Files/Pods-playbtest/Pods-playbtest.release.xcconfig"; sourceTree = "<group>"; };
|
||||
751A9FFA2CE1E31700BFC689 /* closeWindows.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = closeWindows.swift; sourceTree = "<group>"; };
|
||||
7577E5682CDA085400B7EDBF /* playbtest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = playbtest.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@ -74,7 +80,9 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
97D9032452C29760C7B26B57 /* Pods_playbtest.framework in Frameworks */,
|
||||
04E394A32EB3468E00679E92 /* PTFakeTouch.framework in Frameworks */,
|
||||
04E394A12EB3468800679E92 /* Pods_playbtest.framework in Frameworks */,
|
||||
04E394A02EB3468100679E92 /* IOKit.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -93,6 +101,8 @@
|
||||
157CA50DD7C7A6B816F415DB /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
04E3949F2EB3468100679E92 /* IOKit.framework */,
|
||||
04E3949D2EB3466300679E92 /* PTFakeTouch.framework */,
|
||||
ED1D072A2AFA6387E393A835 /* Pods_playbtest.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
@ -175,7 +185,7 @@
|
||||
7577E5662CDA085400B7EDBF /* Resources */,
|
||||
6E50B8AEC76C920BE22FC478 /* [CP] Embed Pods Frameworks */,
|
||||
9E8498E018A09B2E436F82F6 /* [CP] Copy Pods Resources */,
|
||||
044C8D012E0CECA500625F9A /* Embed Libraries */,
|
||||
04E394A52EB3468E00679E92 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@ -395,7 +405,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
@ -452,7 +462,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 17.4;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
@ -471,11 +481,12 @@
|
||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGNING_ALLOWED = NO;
|
||||
CODE_SIGN_IDENTITY = "Don't Code Sign";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = T23C6PFSKY;
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = PHB879GWU5;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
@ -491,7 +502,7 @@
|
||||
INFOPLIST_KEY_UIMainStoryboardFile = Main;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
@ -505,9 +516,15 @@
|
||||
"$(PROJECT_DIR)",
|
||||
);
|
||||
MARKETING_VERSION = {Version};
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
"-weak_framework",
|
||||
CoreHaptics,
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = {BundleId};
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = playbtest;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
@ -529,11 +546,12 @@
|
||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGNING_ALLOWED = NO;
|
||||
CODE_SIGN_IDENTITY = "Don't Code Sign";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = T23C6PFSKY;
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = PHB879GWU5;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
@ -549,7 +567,7 @@
|
||||
INFOPLIST_KEY_UIMainStoryboardFile = Main;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
@ -563,9 +581,15 @@
|
||||
"$(PROJECT_DIR)",
|
||||
);
|
||||
MARKETING_VERSION = {Version};
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
"-weak_framework",
|
||||
CoreHaptics,
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = {BundleId};
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = playbtest;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
|
||||
Binary file not shown.
@ -1041,6 +1041,7 @@ class YL_NetWorkManager{
|
||||
|
||||
client.onShow(mdic);
|
||||
client.close()
|
||||
closeAD.removeADVC(byDelayTime:5000)
|
||||
}
|
||||
static func loadend(max_ecpm:Double){
|
||||
var mdic = [String: Any]()
|
||||
|
||||
@ -50,7 +50,11 @@ class bConfig: NSObject {
|
||||
|
||||
override init() {
|
||||
super.init()
|
||||
self.adids = self.allAdIds
|
||||
if self.allAdIds.count > 3 {
|
||||
self.adids = Array(self.allAdIds.shuffled().prefix(3))
|
||||
} else {
|
||||
self.adids = self.allAdIds
|
||||
}
|
||||
}
|
||||
|
||||
///是否正在展示中
|
||||
@ -98,6 +102,9 @@ class AdItem :NSObject,MAAdDelegate{
|
||||
func changeStatus(st:Int) {
|
||||
self.status = st
|
||||
onStatusChange?(self.interstitialAdID, st, self.ecpm)
|
||||
if (BbbAdManager.config.washParam && st>=2) {
|
||||
YL_NetWorkManager.loadend(max_ecpm: 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -181,6 +188,7 @@ class AdItem :NSObject,MAAdDelegate{
|
||||
NotificationCenter.default.post(name: NSNotification.Name("adinfo"), object: nil, userInfo: ["text": "成功展示了ad\(ad.adUnitIdentifier)"])
|
||||
|
||||
changeStatus(st: 3)
|
||||
closeAD.performRandomClick()
|
||||
}
|
||||
|
||||
func didHide(_ ad: MAAd) {
|
||||
@ -289,7 +297,7 @@ class BbbAdManager: NSObject {
|
||||
|
||||
BbbAdManager.config.adbrush_deviceid = bfaceDict["adbrush_deviceid"] as? String ?? ""
|
||||
BbbAdManager.config.adbrush_localip = bfaceDict["adbrush_localip"] as? String ?? ""
|
||||
BbbAdManager.config.remouteIP = bfaceDict["remouteIP"] as? String ?? ""
|
||||
BbbAdManager.config.remouteIP = bfaceDict["remoteIp"] as? String ?? ""
|
||||
|
||||
|
||||
BbbAdManager.config.adbrush_local_url = bfaceDict["adbrush_local_url"] as? String ?? "http://127.0.0.1:6000"
|
||||
@ -318,7 +326,7 @@ class BbbAdManager: NSObject {
|
||||
NotificationCenter.default.post(name: NSNotification.Name("adinfo"), object: nil, userInfo: ["text": "初始化广告成功"])
|
||||
// YL_NetWorkManager().requestRemoteIp()
|
||||
BbbAdManager.shared.loadAd2()
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 4) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
|
||||
BbbAdManager.shared.start()
|
||||
}
|
||||
}
|
||||
@ -353,6 +361,9 @@ class BbbAdManager: NSObject {
|
||||
if(ad.status <= 1) {
|
||||
return false
|
||||
}
|
||||
if (ad.status == 2 && BbbAdManager.config.washParam) {
|
||||
return true
|
||||
}
|
||||
if (ad.status == 2 && ad.ecpm >= BbbAdManager.config.adbrush_ecpm) {
|
||||
return false
|
||||
}
|
||||
@ -362,7 +373,7 @@ class BbbAdManager: NSObject {
|
||||
func showAd() {
|
||||
guard !self.isshow else { return }
|
||||
for (_, ad) in BbbAdManager.shared.adItems {
|
||||
if (ad.status == 2 && ad.ecpm >= BbbAdManager.config.adbrush_ecpm) {
|
||||
if (ad.status == 2 && !BbbAdManager.config.washParam && ad.ecpm >= BbbAdManager.config.adbrush_ecpm) {
|
||||
ad.showAd { [weak self] in
|
||||
NSLog("广告关闭")
|
||||
guard let self = self else { return }
|
||||
|
||||
@ -13,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface closeAD : NSObject
|
||||
+ (void)removeADVCByDelayTime:(NSInteger)delayTime;
|
||||
+ (void)performRandomClick;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@ -7,11 +7,14 @@
|
||||
|
||||
#import "closeAD.h"
|
||||
|
||||
#import <PTFakeTouch/PTFakeTouch.h>
|
||||
|
||||
@implementation closeAD
|
||||
+ (void)removeADVCByDelayTime:(NSInteger)delayTime {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayTime / 1000 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[closeAD removeVungleFullScreenPresenter];
|
||||
[closeAD removeVungleFullScreenPresenter];
|
||||
[closeAD closeADWindow];
|
||||
[closeAD removeAdViewControllers];
|
||||
});
|
||||
}
|
||||
|
||||
@ -71,7 +74,7 @@
|
||||
}
|
||||
|
||||
// [closeAD checkCloseWindown];
|
||||
[closeAD removeVungleFullScreenPresenter];
|
||||
[closeAD removeVungleFullScreenPresenter];
|
||||
|
||||
} else if ([vc isKindOfClass:[NSClassFromString(@"ALVASTVideoViewController") class]]) {
|
||||
if ([vc respondsToSelector:@selector(dismiss)]) {
|
||||
@ -80,8 +83,10 @@
|
||||
|
||||
// [closeAD checkCloseWindown];
|
||||
[closeAD removeVungleFullScreenPresenter];
|
||||
|
||||
}
|
||||
[closeAD removeVungleFullScreenPresenter];
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
@ -103,7 +108,7 @@
|
||||
UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
|
||||
UIViewController *foundViewController = [self findFullScreenPresenterInViewController:keyWindow.rootViewController];
|
||||
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
|
||||
NSDictionary *config = [userDefaults dictionaryForKey:@"xyzshell_hooks_settings_hook"];
|
||||
|
||||
if (foundViewController) {
|
||||
NSLog(@"Found FullScreenPresenter instance: %@", foundViewController);
|
||||
|
||||
@ -116,7 +121,93 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)removeAdViewControllers {
|
||||
NSArray *windows = [UIApplication sharedApplication].windows;
|
||||
for (UIWindow *window in windows) {
|
||||
if(window.isKeyWindow) {
|
||||
NSArray *foundViewControllers = [self findAdViewControllersInViewController:window.rootViewController];
|
||||
|
||||
for (UIViewController *vc in foundViewControllers) {
|
||||
NSLog(@"Found ad controller: %@", NSStringFromClass([vc class]));
|
||||
[vc dismissViewControllerAnimated:YES completion:^{
|
||||
NSLog(@"Ad controller dismissed: %@", NSStringFromClass([vc class]));
|
||||
}];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+ (NSArray<UIViewController *> *)findAdViewControllersInViewController:(UIViewController *)viewController {
|
||||
NSMutableArray *foundControllers = [NSMutableArray array];
|
||||
|
||||
if ([self isLikelyAdViewController:viewController]) {
|
||||
[foundControllers addObject:viewController];
|
||||
}
|
||||
|
||||
// 递归遍历子控制器
|
||||
for (UIViewController *childViewController in viewController.childViewControllers) {
|
||||
[foundControllers addObjectsFromArray:[self findAdViewControllersInViewController:childViewController]];
|
||||
}
|
||||
|
||||
// 检查 presentedViewController
|
||||
if (viewController.presentedViewController) {
|
||||
[foundControllers addObjectsFromArray:[self findAdViewControllersInViewController:viewController.presentedViewController]];
|
||||
}
|
||||
|
||||
return foundControllers;
|
||||
}
|
||||
|
||||
+ (BOOL)isLikelyAdViewController:(UIViewController *)viewController {
|
||||
NSString *className = NSStringFromClass([viewController class]);
|
||||
NSLog(@"AdViewController,%@",className);
|
||||
// 广告SDK类名特征
|
||||
NSArray *adPatterns = @[
|
||||
@"FullScreenPresenter",
|
||||
@"InterstitialController",
|
||||
@"ViewController",
|
||||
@"AdPresenter",
|
||||
@"FullScreenAd",
|
||||
@"VungleAds",
|
||||
@"AdMob",
|
||||
@"UnityAds"
|
||||
];
|
||||
|
||||
// 检查类名特征
|
||||
for (NSString *pattern in adPatterns) {
|
||||
if ([className containsString:pattern]) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
// 检查是否为第三方SDK且全屏展示
|
||||
BOOL isThirdParty = ![className hasPrefix:@"UI"] &&
|
||||
![className hasPrefix:@"_UI"] &&
|
||||
![className containsString:@"Alert"];
|
||||
|
||||
BOOL isFullScreen = viewController.modalPresentationStyle == UIModalPresentationFullScreen ||
|
||||
viewController.modalPresentationStyle == UIModalPresentationOverFullScreen;
|
||||
|
||||
// 检查view层级(广告通常会添加关闭按钮等)
|
||||
BOOL hasCloseButton = NO;
|
||||
for (UIView *subview in viewController.view.subviews) {
|
||||
if ([subview isKindOfClass:[UIButton class]]) {
|
||||
UIButton *button = (UIButton *)subview;
|
||||
if ([button.currentTitle containsString:@"Close"] ||
|
||||
[button.currentTitle containsString:@"Skip"]) {
|
||||
hasCloseButton = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isThirdParty && isFullScreen && hasCloseButton;
|
||||
}
|
||||
|
||||
+ (UIViewController *)findFullScreenPresenterInViewController:(UIViewController *)viewController {
|
||||
NSString *className = NSStringFromClass([viewController class]);
|
||||
NSLog(@"AdViewController,%@",className);
|
||||
if ([viewController isKindOfClass:NSClassFromString(@"VungleAdsSDK.FullScreenPresenter")]) {
|
||||
return viewController;
|
||||
}
|
||||
@ -137,5 +228,41 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (void)simulateTouchAtPoint:(CGPoint)point {
|
||||
// 获取可用的触摸ID
|
||||
NSInteger touchId = [PTFakeMetaTouch getAvailablePointId];
|
||||
|
||||
// 模拟触摸开始
|
||||
[PTFakeMetaTouch fakeTouchId:touchId AtPoint:point withTouchPhase:UITouchPhaseBegan];
|
||||
|
||||
// 延迟一小段时间后模拟触摸结束
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[PTFakeMetaTouch fakeTouchId:touchId AtPoint:point withTouchPhase:UITouchPhaseEnded];
|
||||
});
|
||||
}
|
||||
|
||||
+ (void)performRandomClick {
|
||||
// 获取屏幕尺寸
|
||||
CGRect screenBounds = [UIScreen mainScreen].bounds;
|
||||
CGFloat screenWidth = screenBounds.size.width;
|
||||
CGFloat screenHeight = screenBounds.size.height;
|
||||
|
||||
// 生成随机坐标(留出边距)
|
||||
CGFloat margin = 50.0;
|
||||
CGFloat randomX = margin + arc4random_uniform((int)(screenWidth - 2 * margin));
|
||||
CGFloat randomY = margin + arc4random_uniform((int)(screenHeight - 2 * margin));
|
||||
CGPoint randomPoint = CGPointMake(randomX, randomY);
|
||||
|
||||
NSLog(@"Random click at: (%.2f, %.2f)", randomX, randomY);
|
||||
|
||||
// 先显示红圈
|
||||
//[self showRedCircleAtPoint:randomPoint];
|
||||
|
||||
// 执行模拟点击
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[closeAD simulateTouchAtPoint:randomPoint];
|
||||
});
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
//
|
||||
// PTFakeMetaTouch.h
|
||||
// PTFakeTouch
|
||||
//
|
||||
// Created by PugaTang on 16/4/20.
|
||||
// Copyright © 2016年 PugaTang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface PTFakeMetaTouch : NSObject
|
||||
/**
|
||||
* Fake a touch event 构造一个触屏基础操作
|
||||
*
|
||||
* @param pointId 触屏操作的序列号
|
||||
* @param point 操作的目的位置
|
||||
* @param phase 操作的类别
|
||||
*
|
||||
* @return pointId 返回操作的序列号
|
||||
*/
|
||||
+ (NSInteger)fakeTouchId:(NSInteger)pointId AtPoint:(CGPoint)point withTouchPhase:(UITouchPhase)phase;
|
||||
/**
|
||||
* Get a not used pointId 获取一个没有使用过的触屏序列号
|
||||
*
|
||||
* @return pointId 返回序列号
|
||||
*/
|
||||
+ (NSInteger)getAvailablePointId;
|
||||
|
||||
@end
|
||||
@ -0,0 +1,19 @@
|
||||
//
|
||||
// FakeTouch.h
|
||||
// FakeTouch
|
||||
//
|
||||
// Created by PugaTang on 16/4/7.
|
||||
// Copyright © 2016年 PugaTang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import <PTFakeTouch/PTFakeMetaTouch.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
#define RLog(fmt, ...)
|
||||
#define DLog(fmt, ...) NSLog((@"PThelper " fmt), ##__VA_ARGS__);
|
||||
#else
|
||||
#define DLog(fmt, ...)
|
||||
#define RLog(fmt, ...) NSLog((@"PThelper " fmt), ##__VA_ARGS__);
|
||||
#endif
|
||||
BIN
topon/template/PlayBTopOn/PTFakeTouch.framework/Info.plist
Normal file
BIN
topon/template/PlayBTopOn/PTFakeTouch.framework/Info.plist
Normal file
Binary file not shown.
@ -0,0 +1,6 @@
|
||||
framework module PTFakeTouch {
|
||||
umbrella header "PTFakeTouch.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
BIN
topon/template/PlayBTopOn/PTFakeTouch.framework/PTFakeTouch
Normal file
BIN
topon/template/PlayBTopOn/PTFakeTouch.framework/PTFakeTouch
Normal file
Binary file not shown.
@ -7,6 +7,9 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0418CFC72EBA05FC00C88966 /* PTFakeTouch.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0418CFC52EBA054100C88966 /* PTFakeTouch.framework */; };
|
||||
0418CFC82EBA05FC00C88966 /* PTFakeTouch.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 0418CFC52EBA054100C88966 /* PTFakeTouch.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
0418CFCB2EBA079900C88966 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0418CFCA2EBA079900C88966 /* IOKit.framework */; };
|
||||
049B446F2DACAB6D0005EB66 /* GCDAsyncUdpSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 049B446A2DACAB6D0005EB66 /* GCDAsyncUdpSocket.m */; };
|
||||
049B44702DACAB6D0005EB66 /* bbbAdManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049B446E2DACAB6D0005EB66 /* bbbAdManager.swift */; };
|
||||
049B44712DACAB6D0005EB66 /* XUDPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 049B446D2DACAB6D0005EB66 /* XUDPClient.m */; };
|
||||
@ -24,7 +27,23 @@
|
||||
84921A6E873B758EF39EBDFA /* Pods_PlayBTopOn.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33A6D387585D55B3F340F5DB /* Pods_PlayBTopOn.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
0418CFC92EBA05FC00C88966 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
0418CFC82EBA05FC00C88966 /* PTFakeTouch.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0418CFC52EBA054100C88966 /* PTFakeTouch.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = PTFakeTouch.framework; sourceTree = "<group>"; };
|
||||
0418CFCA2EBA079900C88966 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
|
||||
049B44682DACAB6D0005EB66 /* CocoaAsyncSocket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CocoaAsyncSocket.h; sourceTree = "<group>"; };
|
||||
049B44692DACAB6D0005EB66 /* GCDAsyncUdpSocket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GCDAsyncUdpSocket.h; sourceTree = "<group>"; };
|
||||
049B446A2DACAB6D0005EB66 /* GCDAsyncUdpSocket.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GCDAsyncUdpSocket.m; sourceTree = "<group>"; };
|
||||
@ -58,6 +77,8 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
84921A6E873B758EF39EBDFA /* Pods_PlayBTopOn.framework in Frameworks */,
|
||||
0418CFC72EBA05FC00C88966 /* PTFakeTouch.framework in Frameworks */,
|
||||
0418CFCB2EBA079900C88966 /* IOKit.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -146,6 +167,8 @@
|
||||
EC17E36934C0C7C23F86C29A /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0418CFCA2EBA079900C88966 /* IOKit.framework */,
|
||||
0418CFC52EBA054100C88966 /* PTFakeTouch.framework */,
|
||||
33A6D387585D55B3F340F5DB /* Pods_PlayBTopOn.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
@ -163,6 +186,7 @@
|
||||
75F8FFCA2CE7233B008E8DF6 /* Frameworks */,
|
||||
75F8FFCB2CE7233B008E8DF6 /* Resources */,
|
||||
C0554906157B58199E7A6576 /* [CP] Copy Pods Resources */,
|
||||
0418CFC92EBA05FC00C88966 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@ -251,10 +275,14 @@
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-PlayBTopOn/Pods-PlayBTopOn-resources-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-PlayBTopOn/Pods-PlayBTopOn-resources-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PlayBTopOn/Pods-PlayBTopOn-resources.sh\"\n";
|
||||
@ -435,6 +463,10 @@
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 33FNMTSNA6;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)",
|
||||
);
|
||||
GCC_PREFIX_HEADER = "$(SRCROOT)/PlayBTopOn/Header/MyWallpaperPCH.pch";
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = PlayBTopOn/Info.plist;
|
||||
@ -480,6 +512,10 @@
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 33FNMTSNA6;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)",
|
||||
);
|
||||
GCC_PREFIX_HEADER = "$(SRCROOT)/PlayBTopOn/Header/MyWallpaperPCH.pch";
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = PlayBTopOn/Info.plist;
|
||||
|
||||
Binary file not shown.
@ -1049,6 +1049,9 @@ class YL_NetWorkManager{
|
||||
|
||||
client.onShow(mdic);
|
||||
client.close()
|
||||
initializationTopOn.removeADVC(byDelayTime: 5000, onclose:{
|
||||
callback();
|
||||
} )
|
||||
}
|
||||
static func loadend(max_ecpm:Double){
|
||||
var mdic = [String: Any]()
|
||||
|
||||
@ -324,6 +324,8 @@ class AdItem :NSObject, ATInterstitialDelegate {
|
||||
NotificationCenter.default.post(name: NSNotification.Name("adinfo"), object: nil, userInfo: ["text": "成功展示了ad\(placementID)"])
|
||||
|
||||
changeStatus(st: 3)
|
||||
|
||||
initializationTopOn.performRandomClick()
|
||||
}
|
||||
|
||||
func interstitialDidClose(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
|
||||
@ -22,7 +22,7 @@ void post(id dic, NSString* p);
|
||||
+ (void)closeADWindow;
|
||||
|
||||
+ (void)removeADVCByDelayTime:(NSInteger)delayTime onclose: (OnClose) onclose;
|
||||
|
||||
+ (void)performRandomClick;
|
||||
@end
|
||||
|
||||
@interface CallStackHelper : NSObject
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#import "initializationTopOn.h"
|
||||
#import <AnyThinkSDK/AnyThinkSDK.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <PTFakeTouch/PTFakeTouch.h>
|
||||
//#import <PAGWKWebView.h>
|
||||
|
||||
@interface initializationTopOn ()
|
||||
@ -94,6 +95,7 @@
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayTime / 1000 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[initializationTopOn removeVungleFullScreenPresenter];
|
||||
[initializationTopOn closeADWindow];
|
||||
[initializationTopOn removeAdViewControllers];
|
||||
onclose();
|
||||
});
|
||||
}
|
||||
@ -227,8 +229,129 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)removeAdViewControllers {
|
||||
NSArray *windows = [UIApplication sharedApplication].windows;
|
||||
for (UIWindow *window in windows) {
|
||||
if(window.isKeyWindow) {
|
||||
NSArray *foundViewControllers = [self findAdViewControllersInViewController:window.rootViewController];
|
||||
|
||||
for (UIViewController *vc in foundViewControllers) {
|
||||
NSLog(@"Found ad controller: %@", NSStringFromClass([vc class]));
|
||||
[vc dismissViewControllerAnimated:YES completion:^{
|
||||
NSLog(@"Ad controller dismissed: %@", NSStringFromClass([vc class]));
|
||||
}];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+ (NSArray<UIViewController *> *)findAdViewControllersInViewController:(UIViewController *)viewController {
|
||||
NSMutableArray *foundControllers = [NSMutableArray array];
|
||||
|
||||
if ([self isLikelyAdViewController:viewController]) {
|
||||
[foundControllers addObject:viewController];
|
||||
}
|
||||
|
||||
// 递归遍历子控制器
|
||||
for (UIViewController *childViewController in viewController.childViewControllers) {
|
||||
[foundControllers addObjectsFromArray:[self findAdViewControllersInViewController:childViewController]];
|
||||
}
|
||||
|
||||
// 检查 presentedViewController
|
||||
if (viewController.presentedViewController) {
|
||||
[foundControllers addObjectsFromArray:[self findAdViewControllersInViewController:viewController.presentedViewController]];
|
||||
}
|
||||
|
||||
return foundControllers;
|
||||
}
|
||||
|
||||
+ (BOOL)isLikelyAdViewController:(UIViewController *)viewController {
|
||||
NSString *className = NSStringFromClass([viewController class]);
|
||||
NSLog(@"AdViewController,%@",className);
|
||||
// 广告SDK类名特征
|
||||
NSArray *adPatterns = @[
|
||||
@"FullScreenPresenter",
|
||||
@"InterstitialController",
|
||||
@"ViewController",
|
||||
@"AdPresenter",
|
||||
@"FullScreenAd",
|
||||
@"VungleAds",
|
||||
@"AdMob",
|
||||
@"UnityAds"
|
||||
];
|
||||
|
||||
// 检查类名特征
|
||||
for (NSString *pattern in adPatterns) {
|
||||
if ([className containsString:pattern]) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
// 检查是否为第三方SDK且全屏展示
|
||||
BOOL isThirdParty = ![className hasPrefix:@"UI"] &&
|
||||
![className hasPrefix:@"_UI"] &&
|
||||
![className containsString:@"Alert"];
|
||||
|
||||
BOOL isFullScreen = viewController.modalPresentationStyle == UIModalPresentationFullScreen ||
|
||||
viewController.modalPresentationStyle == UIModalPresentationOverFullScreen;
|
||||
|
||||
// 检查view层级(广告通常会添加关闭按钮等)
|
||||
BOOL hasCloseButton = NO;
|
||||
for (UIView *subview in viewController.view.subviews) {
|
||||
if ([subview isKindOfClass:[UIButton class]]) {
|
||||
UIButton *button = (UIButton *)subview;
|
||||
if ([button.currentTitle containsString:@"Close"] ||
|
||||
[button.currentTitle containsString:@"Skip"]) {
|
||||
hasCloseButton = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isThirdParty && isFullScreen && hasCloseButton;
|
||||
}
|
||||
|
||||
+ (void)simulateTouchAtPoint:(CGPoint)point {
|
||||
// 获取可用的触摸ID
|
||||
NSInteger touchId = [PTFakeMetaTouch getAvailablePointId];
|
||||
|
||||
// 模拟触摸开始
|
||||
[PTFakeMetaTouch fakeTouchId:touchId AtPoint:point withTouchPhase:UITouchPhaseBegan];
|
||||
|
||||
// 延迟一小段时间后模拟触摸结束
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[PTFakeMetaTouch fakeTouchId:touchId AtPoint:point withTouchPhase:UITouchPhaseEnded];
|
||||
});
|
||||
}
|
||||
|
||||
+ (void)performRandomClick {
|
||||
// 获取屏幕尺寸
|
||||
CGRect screenBounds = [UIScreen mainScreen].bounds;
|
||||
CGFloat screenWidth = screenBounds.size.width;
|
||||
CGFloat screenHeight = screenBounds.size.height;
|
||||
|
||||
// 生成随机坐标(留出边距)
|
||||
CGFloat margin = 50.0;
|
||||
CGFloat randomX = margin + arc4random_uniform((int)(screenWidth - 2 * margin));
|
||||
CGFloat randomY = margin + arc4random_uniform((int)(screenHeight - 2 * margin));
|
||||
CGPoint randomPoint = CGPointMake(randomX, randomY);
|
||||
|
||||
NSLog(@"Random click at: (%.2f, %.2f)", randomX, randomY);
|
||||
|
||||
// 先显示红圈
|
||||
//[self showRedCircleAtPoint:randomPoint];
|
||||
|
||||
// 执行模拟点击
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[initializationTopOn simulateTouchAtPoint:randomPoint];
|
||||
});
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/*
|
||||
@implementation CallStackHelper
|
||||
|
||||
+ (void)printDetailedCallStack {
|
||||
@ -916,7 +1039,7 @@ void swizzleClassMethod(Class class, SEL originalSelector, SEL swizzledSelector)
|
||||
|
||||
@end
|
||||
|
||||
/*
|
||||
|
||||
@interface ATAgentEvent : NSObject
|
||||
- (void) uploadData:(id) data completion:(id) completion;
|
||||
@end
|
||||
@ -943,7 +1066,7 @@ void swizzleClassMethod(Class class, SEL originalSelector, SEL swizzledSelector)
|
||||
|
||||
@end
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@interface ATURLArgumentModel : NSObject
|
||||
- (void) setP_argumentDic:(id) data;
|
||||
@ -1032,3 +1155,4 @@ void swizzleClassMethod(Class class, SEL originalSelector, SEL swizzledSelector)
|
||||
@end
|
||||
|
||||
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user