From 12361ecbb7fbd836195f8183950f7545627c6481 Mon Sep 17 00:00:00 2001 From: Geoffrey Giordano Date: Sat, 6 Jul 2024 16:23:30 -0400 Subject: [PATCH 1/3] Set the android namespace Specify a more current version of ScreenProtectorKit. This resolves iOS17 issues. --- CHANGELOG.md | 7 ++++++- android/build.gradle | 2 ++ example/pubspec.lock | 2 +- ios/no_screenshot.podspec | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2254278..2a37dfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,4 +29,9 @@ Updated readme and added sample usage. ## 0.0.1+6 -- Removed the non implemented override functions in android life-cycle \ No newline at end of file +- Removed the non implemented override functions in android life-cycle + +## 0.0.1+7 + +- Set the namespace for android +- Specify a more current version of ScreenProtectorKit. This resolves iOS17 issues. diff --git a/android/build.gradle b/android/build.gradle index 9a5f93b..6b7525e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -25,6 +25,8 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + + namespace "com.flutterplaza.no_screenshot" compileSdkVersion 31 compileOptions { diff --git a/example/pubspec.lock b/example/pubspec.lock index 712900e..2fd7540 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -101,7 +101,7 @@ packages: path: ".." relative: true source: path - version: "0.0.1+6" + version: "0.0.1+7" path: dependency: transitive description: diff --git a/ios/no_screenshot.podspec b/ios/no_screenshot.podspec index a6b139c..8e8c420 100644 --- a/ios/no_screenshot.podspec +++ b/ios/no_screenshot.podspec @@ -15,7 +15,7 @@ A new Flutter plugin project. s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' - s.dependency 'ScreenProtectorKit', '~> 1.2.0' + s.dependency 'ScreenProtectorKit', '~> 1.3.*' s.platform = :ios, '10.0' # Flutter.framework does not contain a i386 slice. From 7ff69d0b0a0a494d3f604787b733ef094b86a7aa Mon Sep 17 00:00:00 2001 From: Geoffrey Giordano Date: Sat, 6 Jul 2024 16:42:52 -0400 Subject: [PATCH 2/3] ignore vscode and fvm. Also update package versions --- .gitignore | 7 ++++ example/pubspec.lock | 95 +++++++++++++++++++++++++++++--------------- 2 files changed, 69 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index 96486fd..74779bd 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,12 @@ .buildlog/ .history .svn/ +.vscode/* migrate_working_dir/ +# fvm related +.fvmrc + # IntelliJ related *.iml *.ipr @@ -28,3 +32,6 @@ migrate_working_dir/ .dart_tool/ .packages build/ + +# FVM Version Cache +.fvm/ \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index 2fd7540..b5c4ac3 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,49 +5,56 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.10.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" source: hosted version: "1.2.1" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" source: hosted version: "1.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" flutter: @@ -59,7 +66,8 @@ packages: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" source: hosted version: "2.0.1" flutter_test: @@ -67,32 +75,44 @@ packages: description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" + source: hosted + version: "0.6.5" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + url: "https://pub.dev" source: hosted version: "2.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" source: hosted version: "1.8.0" no_screenshot: @@ -101,19 +121,21 @@ packages: path: ".." relative: true source: path - version: "0.0.1+7" + version: "0.0.1+6" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" source: hosted version: "1.8.2" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a + url: "https://pub.dev" source: hosted version: "2.1.3" sky_engine: @@ -125,51 +147,58 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.4.16" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" sdks: dart: ">=2.18.2 <3.0.0" flutter: ">=2.5.0" From 77ee4a5a37c14511e71c9658f5ca1676968c1b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Fonkam?= Date: Mon, 15 Jul 2024 02:11:31 -0400 Subject: [PATCH 3/3] fix: update ios 17 --- example/android/build.gradle | 2 +- example/ios/Flutter/AppFrameworkInfo.plist | 2 +- example/ios/Podfile | 2 +- example/ios/Podfile.lock | 16 ++--- example/ios/Runner.xcodeproj/project.pbxproj | 61 ++++++++++--------- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- example/lib/main.dart | 2 +- example/pubspec.lock | 4 +- ios/Classes/SwiftNoScreenshotPlugin.swift | 10 ++- ios/no_screenshot.podspec | 6 +- test_driver/app_test.dart | 11 ++-- 11 files changed, 61 insertions(+), 57 deletions(-) diff --git a/example/android/build.gradle b/example/android/build.gradle index 83ae220..3cdaac9 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 9625e10..7c56964 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/example/ios/Podfile b/example/ios/Podfile index 88359b2..279576f 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '11.0' +# platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 8733349..72987e5 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,9 +1,9 @@ PODS: - Flutter (1.0.0) - - no_screenshot (0.0.1): + - "no_screenshot (0.0.1+4)": - Flutter - - ScreenProtectorKit (~> 1.2.0) - - ScreenProtectorKit (1.2.0) + - ScreenProtectorKit (~> 1.3.1) + - ScreenProtectorKit (1.3.1) DEPENDENCIES: - Flutter (from `Flutter`) @@ -20,10 +20,10 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/no_screenshot/ios" SPEC CHECKSUMS: - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 - no_screenshot: 85ed02c4d27c344d72e3ae376c97cc85a18b06c6 - ScreenProtectorKit: 823e5b0342eea5acd7e9b8d92956a5a7f9c2ce40 + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + no_screenshot: 67d110f12466f4913b488803d4e498d03ef2889e + ScreenProtectorKit: 83a6281b02c7a5902ee6eac4f5045f674e902ae4 -PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 +PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011 -COCOAPODS: 1.11.3 +COCOAPODS: 1.15.2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 11412b2..7c79571 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,17 +3,17 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ + 0814FB06D267CE31EABF78B0 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 698C11874CD746C99897BBF7 /* Pods_Runner.framework */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - CCBC7B611A5FD2E48601E0F3 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B9D1B571F0A390229A737590 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -30,14 +30,14 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0BBE2FA8D63EBF8B4CD211B6 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 1C83BDA86114E95372A97511 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 698C11874CD746C99897BBF7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9267DCF63049471B2653F152 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -45,8 +45,8 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - B9D1B571F0A390229A737590 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F554EF76088E822313F80AAA /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + A6EF89069952D5FDBCB028A7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + C3244B7C683D691A8D4831D0 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -54,32 +54,24 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - CCBC7B611A5FD2E48601E0F3 /* Pods_Runner.framework in Frameworks */, + 0814FB06D267CE31EABF78B0 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 7F9318418A0C0FF028C04684 /* Pods */ = { + 4BF1BA6E527616F5CA5ACC42 /* Pods */ = { isa = PBXGroup; children = ( - F554EF76088E822313F80AAA /* Pods-Runner.debug.xcconfig */, - 0BBE2FA8D63EBF8B4CD211B6 /* Pods-Runner.release.xcconfig */, - 1C83BDA86114E95372A97511 /* Pods-Runner.profile.xcconfig */, + 9267DCF63049471B2653F152 /* Pods-Runner.debug.xcconfig */, + A6EF89069952D5FDBCB028A7 /* Pods-Runner.release.xcconfig */, + C3244B7C683D691A8D4831D0 /* Pods-Runner.profile.xcconfig */, ); name = Pods; path = Pods; sourceTree = ""; }; - 8190C14D4C311E8833C7012A /* Frameworks */ = { - isa = PBXGroup; - children = ( - B9D1B571F0A390229A737590 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -97,8 +89,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 7F9318418A0C0FF028C04684 /* Pods */, - 8190C14D4C311E8833C7012A /* Frameworks */, + 4BF1BA6E527616F5CA5ACC42 /* Pods */, + FD51E6B3E9DAF57D8093A6D7 /* Frameworks */, ); sourceTree = ""; }; @@ -125,6 +117,14 @@ path = Runner; sourceTree = ""; }; + FD51E6B3E9DAF57D8093A6D7 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 698C11874CD746C99897BBF7 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -132,14 +132,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - E252C179BFD8F3BBBF219E6E /* [CP] Check Pods Manifest.lock */, + CABA82BDCCB5DE42A41D7B6F /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - B9B459A54E41A98CF7522F89 /* [CP] Embed Pods Frameworks */, + 99C723D8C882D8BED156EBD0 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -156,7 +156,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -200,10 +200,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -214,6 +216,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -226,7 +229,7 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - B9B459A54E41A98CF7522F89 /* [CP] Embed Pods Frameworks */ = { + 99C723D8C882D8BED156EBD0 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -243,7 +246,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - E252C179BFD8F3BBBF219E6E /* [CP] Check Pods Manifest.lock */ = { + CABA82BDCCB5DE42A41D7B6F /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -340,7 +343,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -418,7 +421,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -467,7 +470,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a..5e31d3d 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ { return MaterialApp( home: Scaffold( appBar: AppBar( - title: const Text('Plugin example app'), + title: const Text('NoScreenShot Plugin app'), ), body: Center( child: Column( diff --git a/example/pubspec.lock b/example/pubspec.lock index 76c0646..cf2d64e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -150,10 +150,10 @@ packages: dependency: transitive description: name: plugin_platform_interface - sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.8" sky_engine: dependency: transitive description: flutter diff --git a/ios/Classes/SwiftNoScreenshotPlugin.swift b/ios/Classes/SwiftNoScreenshotPlugin.swift index 6952fc0..c7f7065 100644 --- a/ios/Classes/SwiftNoScreenshotPlugin.swift +++ b/ios/Classes/SwiftNoScreenshotPlugin.swift @@ -2,7 +2,6 @@ import Flutter import UIKit import ScreenProtectorKit - public class SwiftNoScreenshotPlugin: NSObject, FlutterPlugin { private var screenProtectorKit: ScreenProtectorKit? = nil private static var channel: FlutterMethodChannel? = nil @@ -12,8 +11,8 @@ public class SwiftNoScreenshotPlugin: NSObject, FlutterPlugin { self.screenProtectorKit = screenProtectorKit } - public static func register(with registrar: FlutterPluginRegistrar) { + // Corrected the domain name in the method channel to match a typical domain format SwiftNoScreenshotPlugin.channel = FlutterMethodChannel(name: "com.flutterplaza.no_screenshot", binaryMessenger: registrar.messenger()) let window = UIApplication.shared.delegate?.window @@ -25,7 +24,6 @@ public class SwiftNoScreenshotPlugin: NSObject, FlutterPlugin { registrar.addApplicationDelegate(instance) } - public func applicationWillResignActive(_ application: UIApplication) { if SwiftNoScreenshotPlugin.preventScreenShot == true { screenProtectorKit?.enabledPreventScreenshot() @@ -51,8 +49,9 @@ public class SwiftNoScreenshotPlugin: NSObject, FlutterPlugin { SwiftNoScreenshotPlugin.preventScreenShot = true shotOn() } else if (call.method == "toggleScreenshot") { - SwiftNoScreenshotPlugin.preventScreenShot = !SwiftNoScreenshotPlugin.preventScreenShot; - SwiftNoScreenshotPlugin.preventScreenShot ? shotOn() : shotOff() + let res:Bool = SwiftNoScreenshotPlugin.preventScreenShot + SwiftNoScreenshotPlugin.preventScreenShot = !res + res ? shotOff() : shotOn() } result(true) } @@ -62,7 +61,6 @@ public class SwiftNoScreenshotPlugin: NSObject, FlutterPlugin { } private func shotOn() { - screenProtectorKit?.disablePreventScreenshot() } diff --git a/ios/no_screenshot.podspec b/ios/no_screenshot.podspec index 8e8c420..6436798 100644 --- a/ios/no_screenshot.podspec +++ b/ios/no_screenshot.podspec @@ -15,10 +15,12 @@ A new Flutter plugin project. s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' - s.dependency 'ScreenProtectorKit', '~> 1.3.*' + # Updated the dependency version to remove the wildcard and use a specific version range + s.dependency 'ScreenProtectorKit', '~> 1.3.1' s.platform = :ios, '10.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } - s.swift_version = ["4.0", "4.1", "4.2", "5.0", "5.1", "5.2", "5.3", "5.4", "5.5"] + # Updated swift_version to a single version as an array is not supported for this attribute + s.swift_version = "5.0" end diff --git a/test_driver/app_test.dart b/test_driver/app_test.dart index 675e696..fb65faf 100644 --- a/test_driver/app_test.dart +++ b/test_driver/app_test.dart @@ -18,12 +18,13 @@ void main() { .setMockMethodCallHandler(channel, (MethodCall methodCall) async { switch (methodCall.method) { case screenShotOffConst: - break; + return true; case screenShotOnConst: - break; + return true; case toggleScreenShotConst: - break; + return true; default: + return false; } }); }); @@ -68,8 +69,8 @@ void main() { forthScreenshot = await driver.screenshot(); expect(thirdScreenshot != forthScreenshot, true); } - final fithScreenshot = await driver.screenshot(); - expect(forthScreenshot == fithScreenshot, true); + final fifthScreenshot = await driver.screenshot(); + expect(forthScreenshot == fifthScreenshot, true); }); }); tearDown(() {