Commit e920cc85 authored by shenyong's avatar shenyong

2.2.3线上版本

parent 83205cfa
......@@ -526,14 +526,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-resources-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-resources.sh\"\n";
......@@ -547,14 +543,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-frameworks.sh\"\n";
......@@ -816,7 +808,7 @@
CODE_SIGN_ENTITLEMENTS = PhoneManager/PhoneManager.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 6K23946NQ5;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = PhoneManager/Info.plist;
......@@ -838,7 +830,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.2.2;
MARKETING_VERSION = 2.2.3;
PRODUCT_BUNDLE_IDENTIFIER = com.app.phonemanager;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -864,7 +856,7 @@
CODE_SIGN_ENTITLEMENTS = PhoneManager/PhoneManager.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 6K23946NQ5;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = PhoneManager/Info.plist;
......@@ -886,7 +878,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.2.2;
MARKETING_VERSION = 2.2.3;
PRODUCT_BUNDLE_IDENTIFIER = com.app.phonemanager;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
......@@ -1086,7 +1078,7 @@
repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 11.13.0;
minimumVersion = 11.14.0;
};
};
04CA06602DDDB3F8009A15E3 /* XCRemoteSwiftPackageReference "keychain-swift" */ = {
......
......@@ -33,8 +33,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk",
"state" : {
"revision" : "3663b1aa6c7a1bed67ee80fd09dc6d0f9c3bb660",
"version" : "11.13.0"
"revision" : "45d327fcbe7793747295346c2209ad419bdead74",
"version" : "11.14.0"
}
},
{
"identity" : "google-ads-on-device-conversion-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/googleads/google-ads-on-device-conversion-ios-sdk",
"state" : {
"revision" : "70a7857886f065a40486a7607268781c49db04ae",
"version" : "2.0.0"
}
},
{
......@@ -42,8 +51,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "543071966b3fb6613a2fc5c6e7112d1e998184a7",
"version" : "11.13.0"
"revision" : "406f72d0d5e9445fd1cf782db3e9e338cee2bed4",
"version" : "11.14.0"
}
},
{
......
......@@ -20,6 +20,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
UIViewController.swizzleViewDidAppear()
setupDefault()
window = UIWindow(frame: UIScreen.main.bounds)
......
......@@ -12,6 +12,8 @@ import AdSupport
import AppLovinSDK
import FBAudienceNetwork
import SVProgressHUD
import IronSource
import UnityAds
class ADManager : NSObject, FullScreenContentDelegate {
......@@ -53,34 +55,35 @@ class ADManager : NSObject, FullScreenContentDelegate {
/// 记录插屏上次展示广告的时间
private var interstitiallastAdShowTime: Date?
private var currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "2.2.2"
var onlineVersion = "2.2.2"
private var currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "2.2.3"
var onlineVersion = "2.2.3"
/// 默认每日免费删除次数
var defaultFreeTimes : Int {
get {
// 获取存储的时间
let saveTime = UserDefaults.standard.object(forKey: "saveTime")
if saveTime == nil {
UserDefaults.standard.set(Date(), forKey: "saveTime")
UserDefaults.standard.set(ADManager.shared.currentTimes, forKey: "saveAdvTimes")
return ADManager.shared.currentTimes
}else {
if let saveTime = UserDefaults.standard.object(forKey: "saveTime") as? Date{
// 判断时间是不是同一天
let calendar = Calendar.current
let isSameDay = calendar.isDate(saveTime as! Date, inSameDayAs: Date())
let isSameDay = calendar.isDate(saveTime, inSameDayAs: Date())
if isSameDay {
// 如果是同一天
let times = UserDefaults.standard.object(forKey: "saveAdvTimes") as! Int
if let times = UserDefaults.standard.object(forKey: "saveAdvTimes") as? Int{
return times
}
// 如果等于0 那啥也不做
return times
return 0
}else{
// 如果不是同一天,重置次数
UserDefaults.standard.set(Date(), forKey: "saveTime")
UserDefaults.standard.set(ADManager.shared.currentTimes, forKey: "saveAdvTimes")
return ADManager.shared.currentTimes
}
}else{
UserDefaults.standard.set(Date(), forKey: "saveTime")
UserDefaults.standard.set(ADManager.shared.currentTimes, forKey: "saveAdvTimes")
return ADManager.shared.currentTimes
}
}
}
......@@ -105,8 +108,15 @@ class ADManager : NSObject, FullScreenContentDelegate {
/// 初始化SDK
func initAdertisementSDK() {
getADConfig()
ALPrivacySettings.setDoNotSell(true)
LevelPlay.setConsent(true)
LevelPlay.setMetaDataWithKey("do_not_sell", value: "YES")
FBAdSettings.setAdvertiserTrackingEnabled(true)
let gdprMetaData = UADSMetaData()
gdprMetaData.set("gdpr.consent", value: true)
gdprMetaData.commit()
MobileAds.shared.start { status in
let adapterStatuses = status.adapterStatusesByClassName
for adapter in adapterStatuses {
......@@ -624,7 +634,7 @@ extension ADManager{
}
func dealVersionShowAD() -> Bool {
let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "2.2.2"
let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "2.2.3"
// 将版本号按点号分割成数组
let currentComponents = currentVersion.components(separatedBy: ".")
......
......@@ -133,6 +133,8 @@ enum APIReportEnum{
case EmailCleaner_show
case Contacts_show
case page_show(String) // 页面展示上报枚举
}
extension APIReportEnum{
......@@ -174,8 +176,30 @@ extension APIReportEnum{
case .Compress_show: return "Compress_show"
case .EmailCleaner_show: return "EmailCleaner_show"
case .Contacts_show: return "Contacts_show"
case .page_show(let className):
return "page_show_\(className)" // 页面展示上报枚举,使用类名作为标识
}
}
}
extension UIViewController {
static func swizzleViewDidAppear() {
guard let originalMethod = class_getInstanceMethod(UIViewController.self, #selector(viewDidAppear(_:))),
let swizzledMethod = class_getInstanceMethod(UIViewController.self, #selector(swizzled_viewDidAppear(_:))) else { return }
method_exchangeImplementations(originalMethod, swizzledMethod)
}
@objc func swizzled_viewDidAppear(_ animated: Bool) {
// Call the original viewDidAppear
swizzled_viewDidAppear(animated)
// Report class name
reportPageAppear(className: String(describing: type(of: self)))
}
func reportPageAppear(className: String) {
// Your reporting logic here
print("Page appeared: \(className)")
APIReportManager.shared.startReport(type: .page_show(className))
}
}
......@@ -795,11 +795,14 @@ extension PhotoManager{
return assets.filter { !identifierSet.contains($0.localIdentifier) }
}
/// 过滤分组中的资源
func filterGroups(_ groups: [[AssetModel]], byExcludingIDs ids: [String]) -> [[AssetModel]] {
let excludeSet = Set(ids)
return groups.filter { group in
// 检查子数组中是否所有元素的ID都不在排除列表中
group.allSatisfy { !excludeSet.contains($0.localIdentifier) }
return groups.compactMap { group in
// 过滤掉需要排除的元素
let filteredGroup = group.filter { !excludeSet.contains($0.localIdentifier) }
// 仅当过滤后的组至少包含2个元素时保留
return filteredGroup.count >= 2 ? filteredGroup : nil
}
}
......
......@@ -101,63 +101,63 @@ extension ContactViewController{
/// 初始化联系人数据
func initContatsInfo() {
let store = CNContactStore()
let keysToFetch = [
CNContactGivenNameKey as CNKeyDescriptor,
CNContactFamilyNameKey as CNKeyDescriptor,
CNContactPhoneNumbersKey as CNKeyDescriptor
]
do {
let request = CNContactFetchRequest(keysToFetch: keysToFetch)
// 创建数组
var incompleteContacts : [ContactModel] = []
var allContacts : [ContactModel] = []
var duplicates : [[ContactModel]] = []
var contactsByName: [String: [ContactModel]] = [:]
try store.enumerateContacts(with: request) { contact, stop in
if let model = ContactModel.init(contact: contact) {
if model.fullName.isEmpty || model.phoneNumber?.count ?? 0 <= 0 {
incompleteContacts.append(model)
}
allContacts.append(model)
if !model.fullName.isEmpty {
if contactsByName[model.fullName] == nil {
contactsByName[model.fullName] = [model]
} else {
contactsByName[model.fullName]?.append(model)
DispatchQueue.global(qos: .userInitiated).async {
let store = CNContactStore()
let keysToFetch = [
CNContactGivenNameKey as CNKeyDescriptor,
CNContactFamilyNameKey as CNKeyDescriptor,
CNContactPhoneNumbersKey as CNKeyDescriptor
]
do {
let request = CNContactFetchRequest(keysToFetch: keysToFetch)
var incompleteContacts: [ContactModel] = []
var allContacts: [ContactModel] = []
var duplicates: [[ContactModel]] = []
var contactsByName: [String: [ContactModel]] = [:]
try store.enumerateContacts(with: request) { contact, stop in
if let model = ContactModel.init(contact: contact) {
if model.fullName.isEmpty || model.phoneNumber?.count ?? 0 <= 0 {
incompleteContacts.append(model)
}
allContacts.append(model)
if !model.fullName.isEmpty {
if contactsByName[model.fullName] == nil {
contactsByName[model.fullName] = [model]
} else {
contactsByName[model.fullName]?.append(model)
}
}
duplicates = contactsByName.values.filter { $0.count > 1 }
}
duplicates = contactsByName.values.filter { $0.count > 1 }
}
}
self.dataSourceModel = ContactModuleModel.init(duplicates: sortDupDataSource(orgData: duplicates), incompleteContacts: incompleteContacts, backups: [], allContacts: allContacts)
DispatchQueue.main.async {
self.updateModuleData()
self.moduleView.tableView.reloadData()
}
} catch {
DispatchQueue.main.async {
print("获取联系人信息时发生错误: \(error)")
}
}
// 获取备份数据
let vm = BackupViewModel()
vm.retrieveContactsFromBackup { model, error in
if let error = error {
Print("请求备份数据失败,\(error.localizedDescription)")
return
let dataSource = ContactModuleModel.init(
duplicates: self.sortDupDataSource(orgData: duplicates),
incompleteContacts: incompleteContacts,
backups: [],
allContacts: allContacts
)
DispatchQueue.main.async {
self.dataSourceModel = dataSource
self.updateModuleData()
self.moduleView.tableView.reloadData()
}
} catch {
DispatchQueue.main.async {
print("获取联系人信息时发生错误: \(error)")
}
}
DispatchQueue.main.async {
self.dataSourceModel.backups = model!
self.updateModuleData()
self.moduleView.tableView.reloadData()
// 获取备份数据
let vm = BackupViewModel()
vm.retrieveContactsFromBackup { model, error in
if let error = error {
Print("请求备份数据失败,\(error.localizedDescription)")
return
}
DispatchQueue.main.async {
self.dataSourceModel.backups = model!
self.updateModuleData()
self.moduleView.tableView.reloadData()
}
}
}
}
......
......@@ -821,11 +821,12 @@ extension HomePhotosDetailViewController:WaterfallMutiSectionDelegate,UICollecti
func updateFreeTimes(){
// 删除成功后更新次数
var times = UserDefaults.standard.object(forKey: "saveAdvTimes") as! Int
if times > 0 {
// 如果免费次数大于0
times = times - 1
UserDefaults.standard.set(times, forKey: "saveAdvTimes")
if var times = UserDefaults.standard.object(forKey: "saveAdvTimes") as? Int{
if times > 0 {
// 如果免费次数大于0
times = times - 1
UserDefaults.standard.set(times, forKey: "saveAdvTimes")
}
}
}
......
......@@ -672,11 +672,12 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie
func updateFreeTimes(){
// 删除成功后更新次数
var times = UserDefaults.standard.object(forKey: "saveAdvTimes") as! Int
if times > 0 {
// 如果免费次数大于0
times = times - 1
UserDefaults.standard.set(times, forKey: "saveAdvTimes")
if var times = UserDefaults.standard.object(forKey: "saveAdvTimes") as? Int{
if times > 0 {
// 如果免费次数大于0
times = times - 1
UserDefaults.standard.set(times, forKey: "saveAdvTimes")
}
}
}
......
......@@ -302,11 +302,12 @@ extension TrashSubView {
func updateFreeTimes(){
// 删除成功后更新次数
var times = UserDefaults.standard.object(forKey: "saveAdvTimes") as! Int
if times > 0 {
// 如果免费次数大于0
times = times - 1
UserDefaults.standard.set(times, forKey: "saveAdvTimes")
if var times = UserDefaults.standard.object(forKey: "saveAdvTimes") as? Int{
if times > 0 {
// 如果免费次数大于0
times = times - 1
UserDefaults.standard.set(times, forKey: "saveAdvTimes")
}
}
}
}
......@@ -99,7 +99,9 @@ class PMShowImgVideoController: BaseViewController {
make.bottom.equalToSuperview().offset(-(cWindow?.safeAreaInsets.bottom ?? 0))
}
self.view.layoutIfNeeded()
self.MaxCollection.scrollToItem(at: IndexPath(row: currentIdx, section: 0), at: .centeredHorizontally, animated: false)
if currentIdx < imageVideoPath.count {
self.MaxCollection.scrollToItem(at: IndexPath(row: currentIdx, section: 0), at: .centeredHorizontally, animated: false)
}
changeNavInfo()
backView.setShadow(cornerRadius: 0, sColor: UIColor.colorWithHex(hexStr: "#1475B9"), offset: CGSizeMake(3, -1),opacity: 0.15)
......@@ -278,7 +280,10 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
collectionView.contentOffset = CGPointMake( idx * (68 + 10) , 0)
}
self.currentIdx = Int(idx)
MaxCollection.scrollToItem(at: IndexPath(row: Int(idx), section: 0), at: .centeredHorizontally, animated: true)
if Int(idx) < imageVideoPath.count {
MaxCollection.scrollToItem(at: IndexPath(row: Int(idx), section: 0), at: .centeredHorizontally, animated: true)
}
}
}
......@@ -296,7 +301,7 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if collectionView == bottItems {
if (indexPath.row > self.homeDataSource?.count ?? 0) {
if indexPath.row > (self.homeDataSource?.count ?? 0) - 1 {
return
}
if state != .secret {
......@@ -317,7 +322,7 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
collectionView.reloadData()
}else{
self.currentIdx = indexPath.row;
if indexPath.row >= imageVideoPath.count{
if indexPath.row < imageVideoPath.count{
self.MaxCollection.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
}
}
......
......@@ -346,11 +346,12 @@ extension TrashViewController:UIScrollViewDelegate{
func updateFreeTimes(){
// 删除成功后更新次数
var times = UserDefaults.standard.object(forKey: "saveAdvTimes") as! Int
if times > 0 {
// 如果免费次数大于0
times = times - 1
UserDefaults.standard.set(times, forKey: "saveAdvTimes")
if var times = UserDefaults.standard.object(forKey: "saveAdvTimes") as? Int{
if times > 0 {
// 如果免费次数大于0
times = times - 1
UserDefaults.standard.set(times, forKey: "saveAdvTimes")
}
}
}
......
......@@ -23,6 +23,8 @@ target 'PhoneManager' do
#广告适配器
pod 'GoogleMobileAdsMediationAppLovin'
pod 'GoogleMobileAdsMediationIronSource'
pod 'GoogleMobileAdsMediationUnity'
#pod 'GoogleMobileAdsMediationFacebook'
post_install do |installer|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment