confirmedcode / Lockdown-iOS

GNU General Public License v3.0
888 stars 86 forks source link

(Community Question) - Has anyone complied and got this code working? #18

Closed mikegchambers closed 5 years ago

mikegchambers commented 5 years ago

I have managed to get the code running on an iOS device, but it's not working as expected.

As far as I can see I have all the dependencies (after al it compiles) but and I have updated all the Bundle Identifiers and changed them in the code.

When I run the app, it all looks like its working, the VPN is created and it connects, however no URLs that I test are blocked.

The logs are copious and the warnings and errors may not be relevant.

Just looking to see if anyone has this running?

Bastiaantjuhh commented 5 years ago

I have made an attempt to deploy the app to an iOS device. But I also got stuck. I then discovered that the code contains an identifier several times (used is some strings). If you do search and replace in xcode, everything works.

Search for: "group.com.confirmed"

And replace with your own group identifier Hope it works ;-)

mikegchambers commented 5 years ago

Yes, as I say, I spotted them. There where a number of different bundle and group ids, including the iCloud container ID. I have changed all I found. I might scrap my attempt and have another try.

mikegchambers commented 5 years ago

So I tried again. And I kept a 'live' notes log as I went. It seemed to be working in the end. This is what I did, maybe it will help someone else:

  1. Cloned the repo
  2. Ran 'pod install'
  3. Ran 'carthage update --no-use-binaries --platform ios'
  4. Xcode find and replace 'group.com.confimed' with 'group.com.[me]' then figured that I would have to:
  5. Xcode find and replace 'com.confimed' with 'com.[me]'

    Some could be found but had to be replaced by hand for some reason.

  6. Tested that find 'com.confirmed' within Workspace has no results.
  7. Changed signing to my team for all the targets.
  8. Ran 'fix issue' on Lockdown > Capabilities > Network Extensions (this also fixed Personal VPN)
  9. Ran 'fix issue' on Today > Capabilities > Network Extensions (this also fixed Personal VPN)
  10. Build and Run on device...
  11. Build complete with 169 warnings, no errors.
  12. App running in iOS, imediatly asks for me to 'Sign In to iTunes Store'. I do this.
  13. Tap 'Get Started'
  14. Select country ?? (I select Australia)
  15. Tap Enable metrics and confirm.
  16. Configure block list, turn on every list. As I do it asks to install VPN, I allow.

2019-08-04 18:33:35.633714+1000 Lockdown[1262:202079] [Warning] Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view. We're considering the collapse unintentional and using standard height instead. 2019-08-04 18:33:35.652551+1000 Lockdown[1262:202079] [] Failed to save the new configuration: Error Domain=NEVPNErrorDomain Code=1 "Missing server address" UserInfo={NSLocalizedDescription=Missing server address}

  1. Asks again for me to 'Sign In to iTunes Store'. Which I do. The following log may have been before or after this step, sorry I didn't notice.

LOG: 2019-08-04 18:35:05 [TunnelsSubscription:237]: Fetch receipt failed: networkError(error: Error Domain=SSErrorDomain Code=4 "Cannot connect to iTunes Store" UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store}) 2019-08-04 18:35:05.224621+1000 Lockdown[1262:203209] LOG: 2019-08-04 18:35:05 [TunnelsSubscription:237]: Fetch receipt failed: networkError(error: Error Domain=SSErrorDomain Code=4 "Cannot connect to iTunes Store" UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store}) Network error

  1. Notice that the VPN has activated.
  2. As I try to set the lists to blocked, some lists start to appear twice in the list.
  3. Add 'bbc.com' as an individual blocked domain. (As a test)

2019-08-04 18:41:03.943042+1000 Lockdown[1262:203962] LOG: 2019-08-04 18:41:03 [LockdownViewController:70]: Adding custom domain - bbc.com

then a little later:

2019-08-04 18:41:08.901796+1000 Lockdown[1262:203980] LOG: 2019-08-04 18:41:08 [VPNViewController:623]: Connected 2019-08-04 18:41:13.182519+1000 Lockdown[1262:203980] [] nw_socket_handle_socket_event [C1.4.1:2] Socket SO_ERROR [54: Connection reset by peer] 2019-08-04 18:41:13.183809+1000 Lockdown[1262:203980] TIC Read Status [1:0x2836dc180]: 1:54 2019-08-04 18:41:13.190972+1000 Lockdown[1262:203296] [] nw_socket_handle_socket_event [C2.1:2] Socket SO_ERROR [54: Connection reset by peer] 2019-08-04 18:41:13.191163+1000 Lockdown[1262:203296] TIC Read Status [2:0x2836da940]: 1:54 2019-08-04 18:41:13.196165+1000 Lockdown[1262:203296] [] nw_socket_handle_socket_event [C3.1:2] Socket SO_ERROR [54: Connection reset by peer] 2019-08-04 18:41:13.196310+1000 Lockdown[1262:203296] TIC Read Status [3:0x2836db240]: 1:54 2019-08-04 18:41:13.196706+1000 Lockdown[1262:203296] Task <B4A0CC22-4112-4456-BBD4-B01D495BEB8A>.<1> HTTP load failed (error code: -1005 [4:-4]) 2019-08-04 18:41:13.197029+1000 Lockdown[1262:203296] Task <B4A0CC22-4112-4456-BBD4-B01D495BEB8A>.<1> finished with error - code: -1005 2019-08-04 18:41:13.201786+1000 Lockdown[1262:203980] Task <B4A0CC22-4112-4456-BBD4-B01D495BEB8A>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={_kCFStreamErrorCodeKey=-4, NSUnderlyingError=0x280d63a50 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=-4, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <B4A0CC22-4112-4456-BBD4-B01D495BEB8A>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <B4A0CC22-4112-4456-BBD4-B01D495BEB8A>.<1>" ), NSLocalizedDescription=The network connection was lost., NSErrorFailingURLStringKey=https://bbc.com/apple-touch-icon.png, NSErrorFailingURLKey=https://bbc.com/apple-touch-icon.png, _kCFStreamErrorDomainKey=4} [-1005] 2019-08-04 18:41:13.208746+1000 Lockdown[1262:203296] [] nw_socket_handle_socket_event [C4.1:2] Socket SO_ERROR [54: Connection reset by peer] 2019-08-04 18:41:13.208883+1000 Lockdown[1262:203296] TIC Read Status [4:0x2836dbc00]: 1:54 2019-08-04 18:41:13.213390+1000 Lockdown[1262:203980] [] nw_socket_handle_socket_event [C5.1:2] Socket SO_ERROR [54: Connection reset by peer] 2019-08-04 18:41:13.213522+1000 Lockdown[1262:203980] TIC Read Status [5:0x2836df0c0]: 1:54 2019-08-04 18:41:13.217929+1000 Lockdown[1262:203980] [] nw_socket_handle_socket_event [C6.1:2] Socket SO_ERROR [54: Connection reset by peer] 2019-08-04 18:41:13.218065+1000 Lockdown[1262:203980] TIC Read Status [6:0x2836d1680]: 1:54 2019-08-04 18:41:13.218398+1000 Lockdown[1262:203980] Task <696DA555-A2F5-46D1-B53B-F5A1CAAF1799>.<2> HTTP load failed (error code: -1005 [4:-4]) 2019-08-04 18:41:13.218655+1000 Lockdown[1262:203296] Task <696DA555-A2F5-46D1-B53B-F5A1CAAF1799>.<2> finished with error - code: -1005 2019-08-04 18:41:13.219023+1000 Lockdown[1262:203980] Task <696DA555-A2F5-46D1-B53B-F5A1CAAF1799>.<2> load failed with error Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={_kCFStreamErrorCodeKey=-4, NSUnderlyingError=0x280d603c0 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=-4, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <696DA555-A2F5-46D1-B53B-F5A1CAAF1799>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <696DA555-A2F5-46D1-B53B-F5A1CAAF1799>.<2>" ), NSLocalizedDescription=The network connection was lost., NSErrorFailingURLStringKey=https://bbc.com/favicon.ico, NSErrorFailingURLKey=https://bbc.com/favicon.ico, _kCFStreamErrorDomainKey=4} [-1005]

  1. Asks AGAIN for me to 'Sign In to iTunes Store'. Which I do.

  2. Press save on 'Configure Blocking'

  3. Reports that Apple ID Verifaction Failed. (Did I type password incorrectly? Maybe)

  4. Shows '8' requests blocked.

  5. Open iOS Safari, and navigate to 'bbc.com'. Confirmed (pun noticed), it's blocked.

  6. Navigate to another site (amazon.com). Confirmed its not blocked.

Test complete.

mikegchambers commented 5 years ago

Issues I am facing:

Bastiaantjuhh commented 5 years ago

That's also how I did it. By the way I encounter exactly the same bugs, those from the iTunes login and the duplicate items bug

Bastiaantjuhh commented 5 years ago

Ohhhh and also (when adding a new list) that the text “ip ranges” appears very often on the screen. Otherwise a awesome app