Explorar o código

update fix warning for ios 16

alqindiirsyam %!s(int64=2) %!d(string=hai) anos
pai
achega
8a88c3fd5d

+ 22 - 22
appbuilder-ios/AppBuilder/AppBuilder.xcodeproj/project.pbxproj

@@ -14,7 +14,7 @@
 		2401CEA1275490DB00B323BB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2401CE9F275490DB00B323BB /* Main.storyboard */; };
 		2401CEA3275490E600B323BB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2401CEA2275490E600B323BB /* Assets.xcassets */; };
 		2401CEA6275490E600B323BB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2401CEA4275490E600B323BB /* LaunchScreen.storyboard */; };
-		25C03557815094948D1AD132 /* Pods_AppBuilder.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5E5DD081C8AF3DD05C9600B /* Pods_AppBuilder.framework */; };
+		6A1AAD5594A3ADA4004FCB5E /* Pods_AppBuilder.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3FFED8CAB1CDCC508B26534 /* Pods_AppBuilder.framework */; };
 		A413B18727EACB20006D16EB /* PrefsUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = A413B18627EACB20006D16EB /* PrefsUtil.swift */; };
 		A42ED92227F30BA200B0FAB7 /* FirstTabViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A42ED92127F30BA200B0FAB7 /* FirstTabViewController.swift */; };
 		A42ED92427F3FC2F00B0FAB7 /* SecondTabViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A42ED92327F3FC2F00B0FAB7 /* SecondTabViewController.swift */; };
@@ -67,16 +67,16 @@
 		2401CEA2275490E600B323BB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		2401CEA5275490E600B323BB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
 		2401CEA7275490E600B323BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+		4AED6D4546F413D444322B4A /* Pods-AppBuilder.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppBuilder.release.xcconfig"; path = "Target Support Files/Pods-AppBuilder/Pods-AppBuilder.release.xcconfig"; sourceTree = "<group>"; };
+		51FC202AB7A6251E5D8E4A4A /* Pods-AppBuilder.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppBuilder.debug.xcconfig"; path = "Target Support Files/Pods-AppBuilder/Pods-AppBuilder.debug.xcconfig"; sourceTree = "<group>"; };
 		A413B18627EACB20006D16EB /* PrefsUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrefsUtil.swift; sourceTree = "<group>"; };
 		A42ED92127F30BA200B0FAB7 /* FirstTabViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstTabViewController.swift; sourceTree = "<group>"; };
 		A42ED92327F3FC2F00B0FAB7 /* SecondTabViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondTabViewController.swift; sourceTree = "<group>"; };
 		A42ED92527F439A200B0FAB7 /* ThirdTabViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThirdTabViewController.swift; sourceTree = "<group>"; };
-		A5E5DD081C8AF3DD05C9600B /* Pods_AppBuilder.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AppBuilder.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		CDEE3DC929B06E1E00B420E5 /* NotificationService.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = NotificationService.appex; sourceTree = BUILT_PRODUCTS_DIR; };
 		CDEE3DCB29B06E1E00B420E5 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
 		CDEE3DCD29B06E1E00B420E5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
-		FA28423157D422B0E2CBE36B /* Pods-AppBuilder.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppBuilder.release.xcconfig"; path = "Target Support Files/Pods-AppBuilder/Pods-AppBuilder.release.xcconfig"; sourceTree = "<group>"; };
-		FB48B311F4E2C64B42F806E9 /* Pods-AppBuilder.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppBuilder.debug.xcconfig"; path = "Target Support Files/Pods-AppBuilder/Pods-AppBuilder.debug.xcconfig"; sourceTree = "<group>"; };
+		F3FFED8CAB1CDCC508B26534 /* Pods_AppBuilder.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AppBuilder.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -84,7 +84,7 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				25C03557815094948D1AD132 /* Pods_AppBuilder.framework in Frameworks */,
+				6A1AAD5594A3ADA4004FCB5E /* Pods_AppBuilder.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -105,7 +105,7 @@
 				CDEE3DCA29B06E1E00B420E5 /* NotificationService */,
 				2401CE97275490DB00B323BB /* Products */,
 				6E32BCCF4DE50EE1A90E8AAE /* Pods */,
-				282481C89D04CEE88BE559C9 /* Frameworks */,
+				F447D4FDA48B6AE856E8E648 /* Frameworks */,
 			);
 			sourceTree = "<group>";
 		};
@@ -137,19 +137,11 @@
 			path = AppBuilder;
 			sourceTree = "<group>";
 		};
-		282481C89D04CEE88BE559C9 /* Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				A5E5DD081C8AF3DD05C9600B /* Pods_AppBuilder.framework */,
-			);
-			name = Frameworks;
-			sourceTree = "<group>";
-		};
 		6E32BCCF4DE50EE1A90E8AAE /* Pods */ = {
 			isa = PBXGroup;
 			children = (
-				FB48B311F4E2C64B42F806E9 /* Pods-AppBuilder.debug.xcconfig */,
-				FA28423157D422B0E2CBE36B /* Pods-AppBuilder.release.xcconfig */,
+				51FC202AB7A6251E5D8E4A4A /* Pods-AppBuilder.debug.xcconfig */,
+				4AED6D4546F413D444322B4A /* Pods-AppBuilder.release.xcconfig */,
 			);
 			path = Pods;
 			sourceTree = "<group>";
@@ -163,6 +155,14 @@
 			path = NotificationService;
 			sourceTree = "<group>";
 		};
+		F447D4FDA48B6AE856E8E648 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				F3FFED8CAB1CDCC508B26534 /* Pods_AppBuilder.framework */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -170,13 +170,13 @@
 			isa = PBXNativeTarget;
 			buildConfigurationList = 2401CEC0275490E600B323BB /* Build configuration list for PBXNativeTarget "AppBuilder" */;
 			buildPhases = (
-				F4227C9ECD517EF1D09C8F6B /* [CP] Check Pods Manifest.lock */,
+				BAFB8F04195A34C763120412 /* [CP] Check Pods Manifest.lock */,
 				2401CE92275490DB00B323BB /* Sources */,
 				2401CE93275490DB00B323BB /* Frameworks */,
 				2401CE94275490DB00B323BB /* Resources */,
 				247E0A722796969200430E5F /* Embed Frameworks */,
 				CDEE3DD129B06E1E00B420E5 /* Embed Foundation Extensions */,
-				EC3D7E44D57E376F1B55D6C3 /* [CP] Embed Pods Frameworks */,
+				7308A40BA057C8BA0FAA3439 /* [CP] Embed Pods Frameworks */,
 			);
 			buildRules = (
 			);
@@ -262,7 +262,7 @@
 /* End PBXResourcesBuildPhase section */
 
 /* Begin PBXShellScriptBuildPhase section */
-		EC3D7E44D57E376F1B55D6C3 /* [CP] Embed Pods Frameworks */ = {
+		7308A40BA057C8BA0FAA3439 /* [CP] Embed Pods Frameworks */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
@@ -279,7 +279,7 @@
 			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AppBuilder/Pods-AppBuilder-frameworks.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
-		F4227C9ECD517EF1D09C8F6B /* [CP] Check Pods Manifest.lock */ = {
+		BAFB8F04195A34C763120412 /* [CP] Check Pods Manifest.lock */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
@@ -475,7 +475,7 @@
 		};
 		2401CEC1275490E600B323BB /* Debug */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = FB48B311F4E2C64B42F806E9 /* Pods-AppBuilder.debug.xcconfig */;
+			baseConfigurationReference = 51FC202AB7A6251E5D8E4A4A /* Pods-AppBuilder.debug.xcconfig */;
 			buildSettings = {
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
@@ -507,7 +507,7 @@
 		};
 		2401CEC2275490E600B323BB /* Release */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = FA28423157D422B0E2CBE36B /* Pods-AppBuilder.release.xcconfig */;
+			baseConfigurationReference = 4AED6D4546F413D444322B4A /* Pods-AppBuilder.release.xcconfig */;
 			buildSettings = {
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;

+ 1 - 1
appbuilder-ios/AppBuilder/AppBuilder/AppDelegate.swift

@@ -16,7 +16,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         if PrefsUtil.getCpaasMode() == PrefsUtil.CPAAS_MODE_FLOATING || PrefsUtil.getCpaasMode() == PrefsUtil.CPAAS_MODE_MIX {
             showButton = true
         }
-        Nexilis.connect(apiKey: "***REPLACE***WITH***YOUR***ACCOUNT***", delegate: self, showButton: showButton, fromMAB: true) //AA6164AA13F0A6262677AC7443C37E3F6F0A342E8BEE84B700CB59C876166FE0(AWS) //1C4FA430BC9F44484AFBE99C8974D70B68CE7891DBE83505CBF01205DE51FC18(CBN)
+        Nexilis.connect(apiKey: "***REPLACE***WITH***YOUR***ACCOUNT***", delegate: self, showButton: showButton, fromMAB: true) //51D0C44F35AD837B27B2970885F9AE731EB1F867F542DDA173AF31497E01037A(CBN Palio Mall) //1C4FA430BC9F44484AFBE99C8974D70B68CE7891DBE83505CBF01205DE51FC18(CBN)
         let tabBarAppearance: UITabBarAppearance = UITabBarAppearance()
         tabBarAppearance.configureWithTransparentBackground()
         if Bundle.main.displayName == "DigiNetS" {

BIN=BIN
appbuilder-ios/DigiXLite/DigiXLite.xcworkspace/xcuserdata/akhmadalqindiirsyam.xcuserdatad/UserInterfaceState.xcuserstate


+ 67 - 66
appbuilder-ios/DigiXLite/DigiXLite/Source/DigiX.swift

@@ -146,82 +146,83 @@ public class DigiX: NSObject {
             DigiX.dispatch = nil
             
 //            DigiX.initiateAudio()
-            
-            if(!id.isEmpty && (UserDefaults.standard.string(forKey: "me") == nil)){
-                if let response = DigiX.writeSync(message: CoreMessage_TMessageBank.getSignUpApi(api: apiKey, p_pin: id), timeout: 30 * 1000){
-                    id = response.getBody(key: CoreMessage_TMessageKey.F_PIN, default_value: "")
-                    let enable_signup = (response.getBody(key: CoreMessage_TMessageKey.IS_ENABLED_ANONYMOUS, default_value: "0")) == "1"
-                    Utils.setForceAnonymous(value: enable_signup)
-                    if(!id.isEmpty) {
-                        DigiX.changeUser(f_pin: id)
-                        UserDefaults.standard.setValue(id, forKey: "me")
+            DispatchQueue.main.async {
+                if(!id.isEmpty && (UserDefaults.standard.string(forKey: "me") == nil)){
+                    if let response = DigiX.writeSync(message: CoreMessage_TMessageBank.getSignUpApi(api: apiKey, p_pin: id), timeout: 30 * 1000){
+                        id = response.getBody(key: CoreMessage_TMessageKey.F_PIN, default_value: "")
+                        let enable_signup = (response.getBody(key: CoreMessage_TMessageKey.IS_ENABLED_ANONYMOUS, default_value: "0")) == "1"
+                        Utils.setForceAnonymous(value: enable_signup)
+                        if(!id.isEmpty) {
+                            DigiX.changeUser(f_pin: id)
+                            UserDefaults.standard.setValue(id, forKey: "me")
+                        }
                     }
                 }
-            }
 
-            if UserDefaults.standard.string(forKey: "apiKey") == nil {
-                UserDefaults.standard.setValue(apiKey, forKey: "apiKey")
-            }
-            
-            if let me = UserDefaults.standard.string(forKey: "me") {
-                if Utils.getForceAnonymous() || (!Utils.getForceAnonymous() && Utils.getSetProfile()) {
-                    Database.shared.database?.inTransaction({ (fmdb, rollback) in
-                        if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT * FROM BUDDY where f_pin = '\(me)' ") {
-                            if !cursorData.next() {
-                                _ = DigiX.write(message: CoreMessage_TMessageBank.getPostRegistration(p_pin: me))
+                if UserDefaults.standard.string(forKey: "apiKey") == nil {
+                    UserDefaults.standard.setValue(apiKey, forKey: "apiKey")
+                }
+                
+                if let me = UserDefaults.standard.string(forKey: "me") {
+                    if Utils.getForceAnonymous() || (!Utils.getForceAnonymous() && Utils.getSetProfile()) {
+                        Database.shared.database?.inTransaction({ (fmdb, rollback) in
+                            if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT * FROM BUDDY where f_pin = '\(me)' ") {
+                                if !cursorData.next() {
+                                    _ = DigiX.write(message: CoreMessage_TMessageBank.getPostRegistration(p_pin: me))
+                                }
+                                cursorData.close()
                             }
-                            cursorData.close()
-                        }
-                    })
-                    Database.shared.database?.inTransaction({ (fmdb, rollback) in
-                        if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT image_id FROM GROUPZ where group_type = 1 AND official = 1"), cursorData.next() {
-                            do {
-                                let documentDir = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
-                                let file = documentDir.appendingPathComponent(cursorData.string(forColumnIndex: 0)!)
-                                if !FileManager().fileExists(atPath: file.path) {
-                                    Download().startHTTP(forKey: cursorData.string(forColumnIndex: 0)!) { (name, progress) in}
+                        })
+                        Database.shared.database?.inTransaction({ (fmdb, rollback) in
+                            if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT image_id FROM GROUPZ where group_type = 1 AND official = 1"), cursorData.next() {
+                                do {
+                                    let documentDir = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
+                                    let file = documentDir.appendingPathComponent(cursorData.string(forColumnIndex: 0)!)
+                                    if !FileManager().fileExists(atPath: file.path) {
+                                        Download().startHTTP(forKey: cursorData.string(forColumnIndex: 0)!) { (name, progress) in}
+                                    }
+                                } catch {}
+                                cursorData.close()
+                            }
+                        })
+                    }
+                    getServiceBank()
+                    getPullWorkingArea()
+                    getPullGroupNoMember()
+                    delegate.onSuccess(userId: me)
+                    getPullDefaultCC()
+                    if showButton {
+                        DispatchQueue.main.async {
+                            var viewController = UIApplication.shared.windows.first?.rootViewController
+                            var notNull = false
+                            while !notNull {
+                                viewController = UIApplication.shared.windows.first?.rootViewController
+                                if viewController != nil {
+                                    notNull = true
                                 }
-                            } catch {}
-                            cursorData.close()
-                        }
-                    })
-                }
-                getServiceBank()
-                getPullWorkingArea()
-                getPullGroupNoMember()
-                delegate.onSuccess(userId: me)
-                getPullDefaultCC()
-                if showButton {
-                    DispatchQueue.main.async {
-                        var viewController = UIApplication.shared.windows.first?.rootViewController
-                        var notNull = false
-                        while !notNull {
-                            viewController = UIApplication.shared.windows.first?.rootViewController
-                            if viewController != nil {
-                                notNull = true
                             }
-                        }
-                        let fb = FloatingButton()
-                        if fromMAB {
-                            var vc = viewController
-                            if viewController is UINavigationController {
-                                vc = (viewController as! UINavigationController).rootViewController
+                            let fb = FloatingButton()
+                            if fromMAB {
+                                var vc = viewController
+                                if viewController is UINavigationController {
+                                    vc = (viewController as! UINavigationController).rootViewController
+                                }
+                                vc?.view.addSubview(fb)
+                                fb.mySettingDelegate = vc as? any SettingMABDelegate
+                            } else {
+                                viewController?.view.addSubview(fb)
                             }
-                            vc?.view.addSubview(fb)
-                            fb.mySettingDelegate = vc as? any SettingMABDelegate
-                        } else {
-                            viewController?.view.addSubview(fb)
                         }
                     }
                 }
-            }
-            DigiX.destroyAll()
-            OutgoingThread.default.run()
-            
-            InquiryThread.default.run()
-            
-            if UIFont.systemFont(ofSize: 12).familyName == ".AppleSystemUIFont" {
-                UIFont.libOverrideInitialize()
+                DigiX.destroyAll()
+                OutgoingThread.default.run()
+                
+                InquiryThread.default.run()
+                
+                if UIFont.systemFont(ofSize: 12).familyName == ".AppleSystemUIFont" {
+                    UIFont.libOverrideInitialize()
+                }
             }
             //print(("MANIA \(UIFont.systemFont(ofSize: 12)) <> \(UIFont.italicSystemFont(ofSize: 12)) <> \(UIFont.boldSystemFont(ofSize: 12))")
         }

+ 67 - 66
appbuilder-ios/NexilisLite/NexilisLite/Source/Nexilis.swift

@@ -146,82 +146,83 @@ public class Nexilis: NSObject {
             Nexilis.dispatch = nil
             
 //            Nexilis.initiateAudio()
-            
-            if(!id.isEmpty && (UserDefaults.standard.string(forKey: "me") == nil)){
-                if let response = Nexilis.writeSync(message: CoreMessage_TMessageBank.getSignUpApi(api: apiKey, p_pin: id), timeout: 30 * 1000){
-                    id = response.getBody(key: CoreMessage_TMessageKey.F_PIN, default_value: "")
-                    let enable_signup = (response.getBody(key: CoreMessage_TMessageKey.IS_ENABLED_ANONYMOUS, default_value: "0")) == "1"
-                    Utils.setForceAnonymous(value: enable_signup)
-                    if(!id.isEmpty) {
-                        Nexilis.changeUser(f_pin: id)
-                        UserDefaults.standard.setValue(id, forKey: "me")
+            DispatchQueue.main.async {
+                if(!id.isEmpty && (UserDefaults.standard.string(forKey: "me") == nil)){
+                    if let response = Nexilis.writeSync(message: CoreMessage_TMessageBank.getSignUpApi(api: apiKey, p_pin: id), timeout: 30 * 1000){
+                        id = response.getBody(key: CoreMessage_TMessageKey.F_PIN, default_value: "")
+                        let enable_signup = (response.getBody(key: CoreMessage_TMessageKey.IS_ENABLED_ANONYMOUS, default_value: "0")) == "1"
+                        Utils.setForceAnonymous(value: enable_signup)
+                        if(!id.isEmpty) {
+                            Nexilis.changeUser(f_pin: id)
+                            UserDefaults.standard.setValue(id, forKey: "me")
+                        }
                     }
                 }
-            }
 
-            if UserDefaults.standard.string(forKey: "apiKey") == nil {
-                UserDefaults.standard.setValue(apiKey, forKey: "apiKey")
-            }
-            
-            if let me = UserDefaults.standard.string(forKey: "me") {
-                if Utils.getForceAnonymous() || (!Utils.getForceAnonymous() && Utils.getSetProfile()) {
-                    Database.shared.database?.inTransaction({ (fmdb, rollback) in
-                        if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT * FROM BUDDY where f_pin = '\(me)' ") {
-                            if !cursorData.next() {
-                                _ = Nexilis.write(message: CoreMessage_TMessageBank.getPostRegistration(p_pin: me))
+                if UserDefaults.standard.string(forKey: "apiKey") == nil {
+                    UserDefaults.standard.setValue(apiKey, forKey: "apiKey")
+                }
+                
+                if let me = UserDefaults.standard.string(forKey: "me") {
+                    if Utils.getForceAnonymous() || (!Utils.getForceAnonymous() && Utils.getSetProfile()) {
+                        Database.shared.database?.inTransaction({ (fmdb, rollback) in
+                            if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT * FROM BUDDY where f_pin = '\(me)' ") {
+                                if !cursorData.next() {
+                                    _ = Nexilis.write(message: CoreMessage_TMessageBank.getPostRegistration(p_pin: me))
+                                }
+                                cursorData.close()
                             }
-                            cursorData.close()
-                        }
-                    })
-                    Database.shared.database?.inTransaction({ (fmdb, rollback) in
-                        if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT image_id FROM GROUPZ where group_type = 1 AND official = 1"), cursorData.next() {
-                            do {
-                                let documentDir = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
-                                let file = documentDir.appendingPathComponent(cursorData.string(forColumnIndex: 0)!)
-                                if !FileManager().fileExists(atPath: file.path) {
-                                    Download().startHTTP(forKey: cursorData.string(forColumnIndex: 0)!) { (name, progress) in}
+                        })
+                        Database.shared.database?.inTransaction({ (fmdb, rollback) in
+                            if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT image_id FROM GROUPZ where group_type = 1 AND official = 1"), cursorData.next() {
+                                do {
+                                    let documentDir = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
+                                    let file = documentDir.appendingPathComponent(cursorData.string(forColumnIndex: 0)!)
+                                    if !FileManager().fileExists(atPath: file.path) {
+                                        Download().startHTTP(forKey: cursorData.string(forColumnIndex: 0)!) { (name, progress) in}
+                                    }
+                                } catch {}
+                                cursorData.close()
+                            }
+                        })
+                    }
+                    getServiceBank()
+                    getPullWorkingArea()
+                    getPullGroupNoMember()
+                    delegate.onSuccess(userId: me)
+                    getPullDefaultCC()
+                    if showButton {
+                        DispatchQueue.main.async {
+                            var viewController = UIApplication.shared.windows.first?.rootViewController
+                            var notNull = false
+                            while !notNull {
+                                viewController = UIApplication.shared.windows.first?.rootViewController
+                                if viewController != nil {
+                                    notNull = true
                                 }
-                            } catch {}
-                            cursorData.close()
-                        }
-                    })
-                }
-                getServiceBank()
-                getPullWorkingArea()
-                getPullGroupNoMember()
-                delegate.onSuccess(userId: me)
-                getPullDefaultCC()
-                if showButton {
-                    DispatchQueue.main.async {
-                        var viewController = UIApplication.shared.windows.first?.rootViewController
-                        var notNull = false
-                        while !notNull {
-                            viewController = UIApplication.shared.windows.first?.rootViewController
-                            if viewController != nil {
-                                notNull = true
                             }
-                        }
-                        let fb = FloatingButton()
-                        if fromMAB {
-                            var vc = viewController
-                            if viewController is UINavigationController {
-                                vc = (viewController as! UINavigationController).rootViewController
+                            let fb = FloatingButton()
+                            if fromMAB {
+                                var vc = viewController
+                                if viewController is UINavigationController {
+                                    vc = (viewController as! UINavigationController).rootViewController
+                                }
+                                vc?.view.addSubview(fb)
+                                fb.mySettingDelegate = vc as? any SettingMABDelegate
+                            } else {
+                                viewController?.view.addSubview(fb)
                             }
-                            vc?.view.addSubview(fb)
-                            fb.mySettingDelegate = vc as? any SettingMABDelegate
-                        } else {
-                            viewController?.view.addSubview(fb)
                         }
                     }
                 }
-            }
-            Nexilis.destroyAll()
-            OutgoingThread.default.run()
-            
-            InquiryThread.default.run()
-            
-            if UIFont.systemFont(ofSize: 12).familyName == ".AppleSystemUIFont" {
-                UIFont.libOverrideInitialize()
+                Nexilis.destroyAll()
+                OutgoingThread.default.run()
+                
+                InquiryThread.default.run()
+                
+                if UIFont.systemFont(ofSize: 12).familyName == ".AppleSystemUIFont" {
+                    UIFont.libOverrideInitialize()
+                }
             }
             //print("MANIA \(UIFont.systemFont(ofSize: 12)) <> \(UIFont.italicSystemFont(ofSize: 12)) <> \(UIFont.boldSystemFont(ofSize: 12))")
         }