velikanov / swiftpasscodelock Goto Github PK
View Code? Open in Web Editor NEWThis project forked from yankodimitrov/swiftpasscodelock
An iOS passcode lock with TouchID authentication written in Swift.
License: MIT License
This project forked from yankodimitrov/swiftpasscodelock
An iOS passcode lock with TouchID authentication written in Swift.
License: MIT License
Because it may conflict with other libraries. For example https://github.com/terryworona/TWMessageBarManager
Hi guys,
I have touchID prompt enabled, and when i put the app in background, and bring it back few seconds later, even though PasscodeLock is not yet triggered, i get this touchID prompt by iOS which you can press cancel to bypass! is there a way to stop it from happening?
I added github "velikanov/SwiftPasscodeLock" to my cartfile
then I ran: carthage update SwiftPasscodeLock --platform iOS
I get:
The following build commands failed:
Check dependencies
(1 failure)
** BUILD FAILED **c
In log file it says:
/usr/bin/xcrun xcodebuild -project /Users/th/Developer/AppStack/Projects/Vaccy_iOS/Repo/Vaccy/Carthage/Checkouts/SwiftPasscodeLock/PasscodeLock.xcodeproj -scheme PasscodeLock -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean buildBuild settings from command line:
BITCODE_GENERATION_MODE = bitcode
CARTHAGE = YES
CODE_SIGN_IDENTITY =
CODE_SIGNING_REQUIRED = NO
ONLY_ACTIVE_ARCH = NO
SDKROOT = iphoneos10.3
=== CLEAN TARGET PasscodeLock OF PROJECT PasscodeLock WITH CONFIGURATION Release ===
Check dependencies
“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
=== BUILD TARGET PasscodeLock OF PROJECT PasscodeLock WITH CONFIGURATION Release ===
Check dependencies
“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
I think you must specify the SWIFT_VERSION in your Projects Targets to Swift 3 in Build Settings Tab.
Could you do that?
Thanks for the great effort maintaining this library!
Please refer to the screenshot below captured after repeatedly putting the Demo app into background, then to foreground to unlock, and background again:
It appears that the method dismissPasscodeLock(animated: Bool = true)
will be called many times, is that the expected behaviour? I was testing why the dismiss animation only works for the first time unlock but not the subsequent unlock, then found this.
Please advise.
Migrated issue (yankodimitrov#26)
@waltermvp commented on Oct 20
The text with keyboard is not working.
When i return the screen is locked but the keyboard is visible.
Changing the main window's windowLevel will cause some unexpected issues, such as using the library with Intercom: https://github.com/intercom/intercom-ios because the Intercom window is using windowLevel = 0.1 or some other values.
This library should use a value less than 0 to be the windowLevel for it's private passcodeLockWindow
, and never change the windowLevel of the main window.
When presenting the passcodeLockWindow, it's window level can be a bigger number (such UIWindowLevelStatusBar - 1), but once it's dismissed, it should be set back to a number less than UIWindowLevelNormal.
Anyone working on it?
The case is:
The expectation is normal use the app, however, a touch ID panel is there. Although I can press cancel and use the app normally, it should be a bug.
When looking into the Library, there should be a coding error in PasscodeLockViewController.swift
in func authenticateWithBiometrics, it should also check the passcodeConfiguration.repository.hasPasscode.
Please update the library, Thanks.
This library doesn't build with the latest Xcode/Swift.
Are there plans to update this? Is this project still maintained?
I'm calling:
let presenter = PasscodeLockPresenter(mainWindow: UIApplication.shared.keyWindow, configuration: configuration)
presenter.presentPasscodeLock()
from didFinishLaunchingWithOptions
and applicationDidEnterBackground
but it doesn't seem to work properly.
On launch, only the Touch ID alert shows up, and the passcode screen doesn't.
On going to background, the passcode screen shows up in the task switcher, but when selecting the app, the screen goes away, and the Touch ID alert is not shown at all.
Seems like it's something window related. This is on iOS 11.1
IOS extensions like share, document provider, etc do not allow access to UIAplication.shared.
This results in a compile time error due to
PasscodeLockPresenter.swift line 55.
Migrated issue (yankodimitrov#28)
@karlml commented on Nov 17
It would be great to see this implemented with keychain
@waltermvp commented 25 days ago
@yankodimitrov I have a implementation already done. Should I send a PR?
@twofish187 commented 21 days ago
Can you please implement the secure splash view in this new version?
@waltermvp commented 20 days ago
What secure splash screen?
@twofish187 commented 20 days ago
When the taskmanager in iOS is called and the content of the app is blurred out. In a previous version this was implemented by adding a "splashview". So was it called in code.
@waltermvp commented 20 days ago
@twofish187 please create a new issue this is a unrelated topic
Hi
I have an app that requires the user to authenticate against a server with user credentials before accessing the app. I am using a combination of Pin and/or TouchId depending on device capabilities so that the user doesn't have to manually enter their credentials each time.
When using this control with TouchId, I'd like to have a way of injecting the TouchId reason at run time. I can't use the static .strings file because I need to include data in the reason that I'll only know at run time.
maximumInccorectPasscodeAttempts
should be maximumIncorrectPasscodeAttempts
animatePlacehodlerAtIndex
should be animatePlaceholderAtIndex
unfortunately, fixing this will break backward compatibility in the case when users have created their own States or Configurations (they probably will)
Hey guys.
First, thanks for forking and reviving this project. While the documentation could use some improvement, I really like this component and it's a shame the original maintainer has basically abandoned the project.
But anyway, to the point:
Like the title says, deletePasscode() doesn't seem to be getting called at all. Here's some code:
It presents the view controller without any issues:
let configuration = PasscodeLockConfiguration()
let passcodeViewController = PasscodeLockViewController(state: .RemovePasscode, configuration: configuration)
presentViewController(passcodeViewController, animated: true, completion: nil)
The PasscodeLockConfiguration and PasscodeLockRepository look like this:
let MignoriUserAccount = "com.ios.fairese.Mignori.LocksmithUserAccount.Default"
struct PasscodeLockConfiguration: PasscodeLockConfigurationType {
let repository: PasscodeRepositoryType
let passcodeLength = 4
var isTouchIDAllowed = Settings.lockScreenPasscodeSettingsSupportTouchID
let shouldRequestTouchIDImmediately = true
let maximumInccorectPasscodeAttempts = -1
init(repository: PasscodeRepositoryType) {
self.repository = repository
}
init() {
self.repository = LocksmithPasscodeRepository()
}
}
class LocksmithPasscodeRepository: PasscodeRepositoryType {
var passcode: [String]? {
return Locksmith.loadDataForUserAccount(MignoriUserAccount)?["passcode"] as? [String]
}
var hasPasscode: Bool {
get {
return Locksmith.loadDataForUserAccount(MignoriUserAccount) != nil
}
}
func savePasscode(passcode: [String]) {
do {
Collector.logEvent("Passcode", withParameters: ["State" : "Enabled"])
try Locksmith.deleteDataForUserAccount(MignoriUserAccount) // There is no "update password" method sooo yeah.
try Locksmith.saveData(["passcode": passcode], forUserAccount: MignoriUserAccount)
} catch let e {
Collector.logEvent("Failed to Save Passcode", withParameters: ["message" : "\(e)"])
}
}
func deletePasscode() {
print("bro?")
do {
try Locksmith.deleteDataForUserAccount(MignoriUserAccount)
Collector.logEvent("Passcode", withParameters: ["State" : "Disabled"])
} catch let e {
print("Wut err \(e)")
Collector.logEvent("Failed to Remove Passcode", withParameters: ["message" : "\(e)"])
}
}
}
The print("bro?")
line never gets executed, so let alone the rest of the lines inside the deletePasscode
method. The other three methods get called with no issue, but for some reason deletePasscode doesn't get called, not even when the view controller is presented and I put in my passcode to remove it.
How will we deal with the landscape view?
Now it looks just not-so-good…
Opened it in the forked repository as well.
This bug allows to brute force the passcode lock by quitting the app before reaching the maximum > attempts limit and then opening the app again.
A solution could be to store the value in the NSUserDefaults or the Keychain.
Migrated Issue (yankodimitrov#25)
@kiokumicu commented on Oct 19
Hi!
I compile framework with Carthage, and add PasscodeLockView.xib, PasscodeSignButton.swift, PasscodeSignPlaceholderView.swift to project.
For PasscodeLockView.xib set owner PasscodeLockViewController class.
After compile passcode show normal, but after tap on number pad got error "PasscodeLock was compiled with optimization - stepping may behave oddly; variables may not be available."
What am i doing wrong ?
@guidelfrate commented on Oct 27
Same problem here! :/
Seems to be something related to the placeholders. I checked all connections and everything is fine.
@gblotter commented on Oct 27
I've been seeing similar weirdnesses and there actually is an open radar: https://openradar.appspot.com/23114017
@guidelfrate commented on Oct 27
@gblotter, really there is a problem with @IBInspectable and @IBDesignable. But I think I solved this copying PasscodeSignButton.swift and PasscodeSignPlaceholderView.swift to my project.
Now my XIB have correct buttons and placeholder, and I can change its properties in Interface Builder, but exactly how @kiokumicu said, I got the error when I tap on any number.
No errors are throw when I use the same XIB on Demo Project. What are we missing?
@guidelfrate commented on Oct 28
I found a temporary solution: using Carthage, I replaced the PasscodeLockView.xib found in /Carthage/Checkouts/SwiftPasscodeLock/PasscodeLock by my custom XIB. Then I compiled the framework again using carthage build. Remember to remove your custom XIB from your project, since it is embedded directly in the framework now.
As alternative, you can add a Run Script build phase that invokes Carthage like so:
/usr/local/bin/carthage build --platform "$PLATFORM_NAME" "$SRCROOT".For now it works, but it should work as described out of box. I'm looking forward for a definitive solution. :)
@velikanov commented an hour ago
have anybody a working example of extending the PasscodeLockView.xib?
I just don't understand what I need to do to make this happen
Please add clear LICENSE information to this project, including copyright strings.
Swift 3 support is not live. Pod keeps downloading older 1.0.2 version
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.