Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,3 @@ fastlane/test_output
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
xc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class BottomSheetPresentationController: UIPresentationController {
dimmingView.alpha = 0
containerView.addSubview(dimmingView)

presentedView.layer.cornerRadius = 12
presentedView.layer.cornerRadius = 24
presentedView.layer.masksToBounds = true
presentedView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]

Expand Down
13 changes: 10 additions & 3 deletions EasyCode/Source/DI/DependencyInjector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class DependencyInjector {
guard let dependency = dependencies[key], let typed = dependency as? T else {
throw DependencyError.providerNotFound(type: T.self)
}

return typed
}
}
Expand All @@ -44,8 +43,16 @@ public class DependencyInjector {
}
}

public func unregister<T>(type: T.Type) {
let key = String(describing: T.self)
public func unregister<T>(_ type: T.Type) {
let baseType: Any.Type
if let optionalMeta = type as? OptionalType.Type {
baseType = optionalMeta.wrappedType
} else {
baseType = type
}

let key = String(describing: baseType)

queue.async(flags: .barrier) {
self.dependencies.removeValue(forKey: key)
}
Expand Down
2 changes: 2 additions & 0 deletions EasyCode/Source/JailbreakDetection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public protocol JailbreakDetectionService {
/// A class for detecting jailbroken devices using various checks.
public class JailbreakDetection: JailbreakDetectionService {

public init() {}

/// Checks if the device is jailbroken.
///
/// - Returns: `true` if the device is jailbroken, `false` otherwise.
Expand Down
16 changes: 3 additions & 13 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
// swift-tools-version: 5.10
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "EasyCode",
platforms: [.iOS(.v14)],
products: [
.library(name: "EasyCode", targets: ["EasyCode"])
],
dependencies: [],
targets: [
.target(
name: "EasyCode",
dependencies: [],
path: "EasyCode/Source"
),
.testTarget(name: "EasyCodeTests", dependencies: ["EasyCode"])
],
products: [.library(name: "EasyCode", targets: ["EasyCode"])],
targets: [.target(name: "EasyCode", path: "EasyCode/Source")],
swiftLanguageVersions: [.v5]
)
50 changes: 50 additions & 0 deletions xc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

if [ -z "$1" ]; then
echo "Ошибка: Не указана схема для сборки."
exit 1
fi

SCHEME="$1"

echo "📦 Сборка проекта для iOS устройств (arm64)"
xcodebuild build \
-project "EasyCode.xcodeproj" \
-scheme "$SCHEME" \
-sdk iphoneos \
-configuration Release \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES || exit 1

echo "📦 Сборка проекта для iOS симуляторов (x86_64, arm64)"
xcodebuild build \
-project "EasyCode.xcodeproj" \
-scheme "$SCHEME" \
-sdk iphonesimulator \
-configuration Release \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES || exit 1

echo "📱 Архивация для iOS устройств"
xcodebuild archive \
-project "EasyCode.xcodeproj" \
-scheme "$SCHEME" \
-archivePath "./build/ios_devices.xcarchive" \
-sdk iphoneos \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES || exit 1

echo "🖥 Архивация для iOS симулятора"
xcodebuild archive \
-project "EasyCode.xcodeproj" \
-scheme "$SCHEME" \
-archivePath "./build/ios_simulators.xcarchive" \
-sdk iphonesimulator \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
EXCLUDED_ARCHS=arm64 || exit 1

echo "❇ Создание XCFramework"
xcodebuild -create-xcframework \
-framework "./build/ios_devices.xcarchive/Products/Library/Frameworks/EasyCode.framework" \
-framework "./build/ios_simulators.xcarchive/Products/Library/Frameworks/EasyCode.framework" \
-output "EasyCode.xcframework" || exit 1
echo "✅ XCFramework успешно создан!"
Loading