25-3/18/1

This commit is contained in:
Hamza-Ayed
2025-03-18 14:54:52 +03:00
parent 60548527e1
commit 0126011f0e
154 changed files with 2236 additions and 279 deletions

View File

@@ -1,49 +1,10 @@
//import UIKit
//import Flutter
//import FirebaseCore
//import GoogleMaps
//
//@main
//@objc class AppDelegate: FlutterAppDelegate {
// override func application(
// _ application: UIApplication,
// didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
// ) -> Bool {
// GMSServices.provideAPIKey(Constants.googleMapsAPIKey)
// FirebaseApp.configure()
// GeneratedPluginRegistrant.register(with: self)
//
// if JailbreakDetection.isJailbroken() {
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
// self.showJailbreakAlert()
// }
// }
//
// return super.application(application, didFinishLaunchingWithOptions: launchOptions)
// }
//
// func showJailbreakAlert() {
// guard let rootVC = UIApplication.shared.keyWindow?.rootViewController else { return }
//
// let alert = UIAlertController(
// title: "تحذير أمني",
// message: "تم اكتشاف أن جهازك يحتوي على جيلبريك. لا يمكن تشغيل التطبيق على هذا الجهاز.",
// preferredStyle: .alert
// )
//
// alert.addAction(UIAlertAction(title: "إنهاء التطبيق", style: .destructive) { _ in
// exit(0)
// })
//
// rootVC.present(alert, animated: true, completion: nil)
// }
//}
import UIKit
import Flutter
import FirebaseCore
import GoogleMaps
@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
@@ -51,9 +12,14 @@ import GoogleMaps
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// Load API keys from a secure location (NOT in plain text!)
// See the "Secure API Key Storage" section below.
GMSServices.provideAPIKey(Constants.googleMapsAPIKey)
if let config = loadConfig() {
if let apiKey = config["APIKey"] as? String {
print("googleMapsAPIKey: \(Constants.googleMapsAPIKey)")
GMSServices.provideAPIKey(apiKey)
}
}
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
@@ -92,7 +58,7 @@ import GoogleMaps
guard let rootVC = UIApplication.shared.keyWindow?.rootViewController else {
// Handle the case where rootVC is nil (extremely unlikely, but good practice)
exit(0)
return
// return
}
let alert = UIAlertController(
@@ -154,7 +120,15 @@ import GoogleMaps
return apiKey
}
func loadConfig() -> [String: Any]? {
guard let path = Bundle.main.path(forResource: "Config", ofType: "plist"),
let config = NSDictionary(contentsOfFile: path) as? [String: Any] else {
return nil // Or handle the error appropriately
}
return config
}
}
// Add for prevent dismissing
extension AppDelegate: UIAdaptivePresentationControllerDelegate {

10
ios/Runner/Config.plist Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>APIKey</key>
<string>AIzaSyCf2mW2h0HD8ZYjwh4VOa2ladw6MJkCDTM</string>
<key>Environment</key>
<string>development</string>
</dict>
</plist>

View File

@@ -8,5 +8,5 @@
import Foundation
struct Constants {
static let googleMapsAPIKey = "AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0"
static let googleMapsAPIKey = "AIzaSyD0a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q"
}

View File

@@ -1,116 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>undecimus</string>
<string>sileo</string>
<string>zbra</string>
<string>filza</string>
<string>activator</string>
<string>cydia</string>
</array>
<key>NSContactsUsageDescription</key>
<string>This app requires contacts access to function properly.</string>
<key>LSMinimumSystemVersion</key>
<string>12.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.594687661098-8e26699cris2k3nj5msj1osi59it9kpf</string>
</array>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>googlechromes</string>
<string>comgooglemaps</string>
</array>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true />
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Tripz</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Tripz</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>96</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5.0.96</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>FirebaseAppDelegateProxyEnabled</key>
<string>NO</string>
<key>GMSApiKey</key>
<string>YOUR_API_KEY</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
<true />
<key>NSCameraUsageDescription</key>
<string>Sovo app requires access to your camera in order to scan QR codes and capture images
<dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>googlechromes</string>
<string>comgooglemaps</string>
</array>
<key>NSContactsUsageDescription</key>
<string>This app requires contacts access to function properly.</string>
<key>LSMinimumSystemVersion</key>
<string>12.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.594687661098-8e26699cris2k3nj5msj1osi59it9kpf</string>
</array>
</dict>
</array>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Tripz</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Tripz</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>100</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5.0.990</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>FirebaseAppDelegateProxyEnabled</key>
<string>NO</string>
<key>GMSApiKey</key>
<string>YOUR_API_KEY</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>Sovo app requires access to your camera in order to scan QR codes and capture images
for uploading and access to connect to a call.</string>
<key>NSFaceIDUsageDescription</key>
<string>Use Face ID to securely authenticate payment accounts.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app needs access to your location to provide you with the best ride experience.
<key>NSFaceIDUsageDescription</key>
<string>Use Face ID to securely authenticate payment accounts.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app needs access to your location to provide you with the best ride experience.
Your location data will be used to find the nearest available cars and connect you with
the closest captain for efficient and convenient rides.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This app needs access to location.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to your location to provide you with the best ride experience.
<key>NSLocationAlwaysUsageDescription</key>
<string>This app needs access to location.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to your location to provide you with the best ride experience.
Your location data will be used to find the nearest available cars and connect you with
the closest captain for efficient and convenient rides.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app requires access to your microphone to record audio, allowing you to add
<key>NSMicrophoneUsageDescription</key>
<string>This app requires access to your microphone to record audio, allowing you to add
voice recordings to your photos and videos and access to connect to a call.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Explanation of why your app needs access to the photo library.</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true />
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>location</string>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false />
</dict>
<key>NSPhotoLibraryUsageDescription</key>
<string>Explanation of why your app needs access to the photo library.</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>location</string>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>

View File

@@ -0,0 +1,59 @@
//
// KeychainHelper.swift
// Runner
//
// Created by Hamza Aleghwairyeen on 12/03/2025.
//
import Foundation
import Security
class KeychainHelper {
static let shared = KeychainHelper()
private init() {}
// حفظ البيانات في Keychain
func save(key: String, value: String) {
let data = value.data(using: .utf8)!
let query: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrAccount as String: key,
kSecValueData as String: data,
kSecAttrAccessible as String: kSecAttrAccessibleWhenUnlockedThisDeviceOnly
]
SecItemDelete(query as CFDictionary) // حذف أي قيمة قديمة بنفس المفتاح
SecItemAdd(query as CFDictionary, nil) // إضافة القيمة الجديدة
}
// استرجاع البيانات من Keychain
func get(key: String) -> String? {
let query: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrAccount as String: key,
kSecReturnData as String: kCFBooleanTrue!,
kSecMatchLimit as String: kSecMatchLimitOne
]
var dataTypeRef: AnyObject?
let status = SecItemCopyMatching(query as CFDictionary, &dataTypeRef)
guard status == errSecSuccess, let data = dataTypeRef as? Data else {
return nil
}
return String(data: data, encoding: .utf8)
}
// حذف البيانات من Keychain
func delete(key: String) {
let query: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrAccount as String: key
]
SecItemDelete(query as CFDictionary)
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>destination</key>
<string>export</string>
<key>method</key>
<string>release-testing</string>
<key>signingStyle</key>
<string>automatic</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>63CVT8G5P8</string>
<key>thinning</key>
<string>&lt;none&gt;</string>
</dict>
</plist>

Binary file not shown.

View File

@@ -12,6 +12,7 @@
#import "SecurityChecks.h"
#import <sys/stat.h>
#include <dlfcn.h>
#import <sys/sysctl.h>
#include <mach-o/dyld.h> // For _dyld_image_count and _dyld_get_image_name
#include <unistd.h> // for fork()
#include <sys/socket.h> //for socket, connect
@@ -89,7 +90,20 @@
return NO; // No jailbreak indicators found
}
+ (BOOL)isDebuggerAttached {
int mib[4];
struct kinfo_proc info;
size_t size = sizeof(info);
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PID;
mib[3] = getpid();
sysctl(mib, 4, &info, &size, NULL, 0);
return (info.kp_proc.p_flag & P_TRACED) != 0;
}
// Check for Frida's default port
+ (BOOL)isFridaListeningOnDefaultPort {
@@ -114,6 +128,26 @@
return NO;
}
+ (BOOL)isFridaDetected {
int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0 };
size_t length;
struct kinfo_proc *procs, *proc;
sysctl(name, 3, NULL, &length, NULL, 0);
procs = malloc(length);
sysctl(name, 3, procs, &length, NULL, 0);
for (proc = procs; (char *)proc < (char *)procs + length; proc++) {
if (strstr(proc->kp_proc.p_comm, "frida") != NULL) {
free(procs);
return YES;
}
}
free(procs);
return NO;
}
// Check for loaded dylibs that indicate Frida
+(BOOL) checkForFridaDylib{
uint32_t count = _dyld_image_count();
@@ -150,6 +184,12 @@
if([SecurityChecks checkProcessName]){
return YES;
}
// if ([SecurityChecks isDebuggerAttached]) {
// return YES;
// }
// if ([SecurityChecks isFridaDetected]) {
// return YES;
// }
return NO;
}