Skip to content

Commit d20cfaa

Browse files
committed
Fix SPM structure: move files to correct ios/permission_handler_apple/Sources location
- Moved all source files to ios/permission_handler_apple/Sources/permission_handler_apple/ - Moved headers to include/permission_handler_apple/ subdirectory - Updated podspec to reference correct file paths - Created Package.swift in correct location with proper configuration - Removed duplicate files and directories
1 parent 3d17310 commit d20cfaa

File tree

99 files changed

+191
-2292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+191
-2292
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
//
4+
// Generated file. Do not edit.
5+
//
6+
7+
import PackageDescription
8+
9+
let package = Package(
10+
name: "FlutterGeneratedPluginSwiftPackage",
11+
platforms: [
12+
.iOS("12.0")
13+
],
14+
products: [
15+
.library(name: "FlutterGeneratedPluginSwiftPackage", type: .static, targets: ["FlutterGeneratedPluginSwiftPackage"])
16+
],
17+
dependencies: [
18+
.package(name: "url_launcher_ios", path: "/Users/ened/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.3/ios/url_launcher_ios")
19+
],
20+
targets: [
21+
.target(
22+
name: "FlutterGeneratedPluginSwiftPackage",
23+
dependencies: [
24+
.product(name: "url-launcher-ios", package: "url_launcher_ios")
25+
]
26+
)
27+
]
28+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//
2+
// Generated file. Do not edit.
3+
//
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
import lldb
6+
7+
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
8+
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
9+
base = frame.register["x0"].GetValueAsAddress()
10+
page_len = frame.register["x1"].GetValueAsUnsigned()
11+
12+
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
13+
# first page to see if handled it correctly. This makes diagnosing
14+
# misconfiguration (e.g. missing breakpoint) easier.
15+
data = bytearray(page_len)
16+
data[0:8] = b'IHELPED!'
17+
18+
error = lldb.SBError()
19+
frame.GetThread().GetProcess().WriteMemory(base, data, error)
20+
if not error.Success():
21+
print(f'Failed to write into {base}[+{page_len}]', error)
22+
return
23+
24+
def __lldb_init_module(debugger: lldb.SBDebugger, _):
25+
target = debugger.GetDummyTarget()
26+
# Caveat: must use BreakpointCreateByRegEx here and not
27+
# BreakpointCreateByName. For some reasons callback function does not
28+
# get carried over from dummy target for the later.
29+
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
30+
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
31+
bp.SetAutoContinue(True)
32+
print("-- LLDB integration loaded --")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
command script import --relative-to-command-file flutter_lldb_helper.py
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
//
4+
// Generated file. Do not edit.
5+
//
6+
7+
import PackageDescription
8+
9+
let package = Package(
10+
name: "FlutterGeneratedPluginSwiftPackage",
11+
platforms: [
12+
.iOS("12.0")
13+
],
14+
products: [
15+
.library(name: "FlutterGeneratedPluginSwiftPackage", type: .static, targets: ["FlutterGeneratedPluginSwiftPackage"])
16+
],
17+
dependencies: [
18+
.package(name: "url_launcher_ios", path: "/Users/ened/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.3/ios/url_launcher_ios")
19+
],
20+
targets: [
21+
.target(
22+
name: "FlutterGeneratedPluginSwiftPackage",
23+
dependencies: [
24+
.product(name: "url-launcher-ios", package: "url_launcher_ios")
25+
]
26+
)
27+
]
28+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//
2+
// Generated file. Do not edit.
3+
//
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
import lldb
6+
7+
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
8+
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
9+
base = frame.register["x0"].GetValueAsAddress()
10+
page_len = frame.register["x1"].GetValueAsUnsigned()
11+
12+
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
13+
# first page to see if handled it correctly. This makes diagnosing
14+
# misconfiguration (e.g. missing breakpoint) easier.
15+
data = bytearray(page_len)
16+
data[0:8] = b'IHELPED!'
17+
18+
error = lldb.SBError()
19+
frame.GetThread().GetProcess().WriteMemory(base, data, error)
20+
if not error.Success():
21+
print(f'Failed to write into {base}[+{page_len}]', error)
22+
return
23+
24+
def __lldb_init_module(debugger: lldb.SBDebugger, _):
25+
target = debugger.GetDummyTarget()
26+
# Caveat: must use BreakpointCreateByRegEx here and not
27+
# BreakpointCreateByName. For some reasons callback function does not
28+
# get carried over from dummy target for the later.
29+
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
30+
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
31+
bp.SetAutoContinue(True)
32+
print("-- LLDB integration loaded --")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
command script import --relative-to-command-file flutter_lldb_helper.py

permission_handler_apple/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
</Testables>
@@ -45,11 +46,13 @@
4546
buildConfiguration = "Debug"
4647
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4748
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
49+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4850
launchStyle = "0"
4951
useCustomWorkingDirectory = "NO"
5052
ignoresPersistentStateOnLaunch = "NO"
5153
debugDocumentVersioning = "YES"
5254
debugServiceExtension = "internal"
55+
enableGPUValidationMode = "1"
5356
allowLocationSimulation = "YES">
5457
<BuildableProductRunnable
5558
runnableDebuggingMode = "0">

permission_handler_apple/example/ios/Runner/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import UIKit
22
import Flutter
33

4-
@UIApplicationMain
4+
@main
55
@objc class AppDelegate: FlutterAppDelegate {
66
override func application(
77
_ application: UIApplication,

0 commit comments

Comments
 (0)