Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS zmNinja sends token for platform Android #960

Closed
crowston opened this issue Aug 21, 2020 · 3 comments
Closed

iOS zmNinja sends token for platform Android #960

crowston opened this issue Aug 21, 2020 · 3 comments
Labels

Comments

@crowston
Copy link

crowston commented Aug 21, 2020

Platform & OS Version
iPadOS 13.6

The version of zmNinja you are reporting:
1.3.010 (ios)

The version and OS of ZoneMinder you are using:
1.32.3, Ubuntu Focal Fossa (20.04.1 LTS)

Device details:
iPad Pro

What is the nature of your issue
Bug
(one of Bug, Enhancement, Question)

Details

Describe in detail. If its a bug, please describe what is happening, what should happen and how to reproduce if its not obvious

When I turn on the event server in zmNinja, it registers with the event server, but the token that is sent and recorded in the tokens.txt file says platform android instead of ios. I edited tokens.txt to change the platform to ios and the pushes worked, but it gets changed back when zmNinja connects.

zmNinja Debug Logs

Aug 21, 2020 09:13:13 AM DEBUG EventSever: sendMessage: received->{"event":"push","data":{"type":"token","platform":"android","token":"c......K","monlist":"1,2,3,4,5,6,7","intlist":"0,0,0,0,0,0,0","state":"enabled"}}

(Sorry it's just one line, but I think it makes the point. )

Zoneminder Logs (if applicable)


Web Server Error Logs (if applicable, especially for streaming errors or API error)


Thanks!

@welcome
Copy link

welcome bot commented Aug 21, 2020

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you follow the issue template or I may not respond.

@pliablepixels
Copy link
Member

Hmm this is the second time I've heard this. My android devices say android and ios says android.

I deleted my tokens.txt file and re-registered my iOS device and see that it sends iOS.

Can you do this:

  1. Go to zmNinja, clear logs, clear API cache, quit the app

  2. Go to ES, clear out tokens.txt, and restart ES

  3. Start zmNinja (it should register with ES)

  4. Send me zmNinja logs

@crowston
Copy link
Author

Apparently zmNinja updated overnight because in the log it is now reporting Version 1.4.010. Here are the first log entries. It might be a bit confused because the mail button on the logs didn’t work, so I copy and pasted, which meant I switched apps a few times. Oddly, I see it registering initially as android, and then again as iOS (once). The current token file says android though.

Aug 22, 2020 08:10:48 AM INFO --------->Setting up global key handler...
Aug 22, 2020 08:10:48 AM INFO --------->Setting up network state handlers....
Aug 22, 2020 08:10:46 AM DEBUG Real value of PRIVACY is:0
Aug 22, 2020 08:10:46 AM DEBUG EventServer: ok to send message
Aug 22, 2020 08:10:46 AM DEBUG EventSever: sendMessage: received->{"event":"push","data":{"type":"token","platform":"ios","token":"c*******g:A**********K","monlist":"1,2,3,4,5,6,7","intlist":"0,0,0,0,0,0,0","state":"enabled"}}
Aug 22, 2020 08:10:46 AM DEBUG EventSever: loading saved monitor list and interval of 1,2,3,4,5,6,7>>0,0,0,0,0,0,0
Aug 22, 2020 08:10:46 AM DEBUG obfuscate: original:6247 obfuscated:1644 scheme:lzs
Aug 22, 2020 08:10:46 AM DEBUG Setting groups_associations to unsupported
Aug 22, 2020 08:10:46 AM DEBUG Error retrieving groups:{"status":404,"headers":{"server":"Apache/2.4.41 (Ubuntu)","keep-alive":"timeout=5, max=100","content-type":"application/json; charset=UTF-8","content-length":"1055","connection":"Keep-Alive","date":"Sat, 22 Aug 2020 12:10:46 GMT"},"url":"http://emohawk.home/zm/api/groups/associations.json?&auth=<removed>
Aug 22, 2020 08:10:46 AM INFO CACHE: error with http get {"status":404,"headers":{"server":"Apache/2.4.41 (Ubuntu)","keep-alive":"timeout=5, max=100","content-type":"application/json; charset=UTF-8","content-length":"1055","connection":"Keep-Alive","date":"Sat, 22 Aug 2020 12:10:46 GMT"},"url":"http://emohawk.home/zm/api/groups/associations.json?&auth=<removed>
Aug 22, 2020 08:10:46 AM DEBUG ***  Inside native HTTP error for url:{"status":404,"headers":{"server":"Apache/2.4.41 (Ubuntu)","keep-alive":"timeout=5, max=100","content-type":"application/json; charset=UTF-8","content-length":"1055","connection":"Keep-Alive","date":"Sat, 22 Aug 2020 12:10:46 GMT"},"url":"http://emohawk.home/zm/api/groups/associations.json?&auth=<removed>
Aug 22, 2020 08:10:46 AM DEBUG CACHE: NOT found for:cached_zmgroups reverting to HTTP
Aug 22, 2020 08:10:46 AM DEBUG Loading hidden/unhidden status for profile:
Aug 22, 2020 08:10:46 AM DEBUG Storing streaming=http://emohawk.home/zm/cgi-bin recording=http://emohawk.home/zm
Aug 22, 2020 08:10:46 AM DEBUG No servers matched, filling defaults...
Aug 22, 2020 08:10:46 AM DEBUG Storing streaming=http://emohawk.home/zm/cgi-bin recording=http://emohawk.home/zm
Aug 22, 2020 08:10:46 AM DEBUG No servers matched, filling defaults...
Aug 22, 2020 08:10:46 AM DEBUG Storing streaming=http://emohawk.home/zm/cgi-bin recording=http://emohawk.home/zm
Aug 22, 2020 08:10:46 AM DEBUG No servers matched, filling defaults...
Aug 22, 2020 08:10:46 AM DEBUG Storing streaming=http://emohawk.home/zm/cgi-bin recording=http://emohawk.home/zm
Aug 22, 2020 08:10:46 AM DEBUG No servers matched, filling defaults...
Aug 22, 2020 08:10:46 AM DEBUG Storing streaming=http://emohawk.home/zm/cgi-bin recording=http://emohawk.home/zm
Aug 22, 2020 08:10:46 AM DEBUG No servers matched, filling defaults...
Aug 22, 2020 08:10:46 AM DEBUG Storing streaming=http://emohawk.home/zm/cgi-bin recording=http://emohawk.home/zm
Aug 22, 2020 08:10:46 AM DEBUG No servers matched, filling defaults...
Aug 22, 2020 08:10:46 AM DEBUG Storing streaming=http://emohawk.home/zm/cgi-bin recording=http://emohawk.home/zm
Aug 22, 2020 08:10:46 AM DEBUG No servers matched, filling defaults...
Aug 22, 2020 08:10:46 AM DEBUG default multi-server protocol will be:http://
Aug 22, 2020 08:10:46 AM INFO multi server list loaded
Aug 22, 2020 08:10:46 AM DEBUG obfuscate: original:23 obfuscated:20 scheme:lzs
Aug 22, 2020 08:10:46 AM DEBUG CACHE: encrypting request
Aug 22, 2020 08:10:46 AM DEBUG CACHE: storing key data in cache now, with expiry of 86400
Aug 22, 2020 08:10:46 AM DEBUG CACHE: NOT found for:cached_multi_servers reverting to HTTP
Aug 22, 2020 08:10:46 AM INFO Monitor load was successful, loaded 7 monitors
Aug 22, 2020 08:10:46 AM DEBUG Now trying to get multi-server data, if present
Aug 22, 2020 08:10:46 AM DEBUG Inside getMonitors, will also regen connkeys
Aug 22, 2020 08:10:46 AM DEBUG Loading hidden/unhidden status for profile:
Aug 22, 2020 08:10:46 AM DEBUG After duplicate processing, we have: 7 monitors
Aug 22, 2020 08:10:46 AM DEBUG Before duplicate processing, we have: 7 monitors
Aug 22, 2020 08:10:46 AM DEBUG obfuscate: original:14668 obfuscated:3119 scheme:lzs
Aug 22, 2020 08:10:46 AM DEBUG CACHE: encrypting request
Aug 22, 2020 08:10:46 AM DEBUG CACHE: storing key data in cache now, with expiry of 86400
Aug 22, 2020 08:10:46 AM DEBUG CACHE: NOT found for:cached_monitors reverting to HTTP
Aug 22, 2020 08:10:46 AM DEBUG Monitor URL to fetch is:http://emohawk.home/zm/api/monitors/index/Type !=:WebSite.json?&auth=<removed>
Aug 22, 2020 08:10:46 AM DEBUG ZMS Multiport reported: 0
Aug 22, 2020 08:10:46 AM INFO ZM_MIN_STREAMING_PORT not configured, disabling
Aug 22, 2020 08:10:46 AM DEBUG Setting multi-port to:false
Aug 22, 2020 08:10:46 AM DEBUG Timezone API response is:America/New_York
Aug 22, 2020 08:10:46 AM DEBUG CACHE: storing key data in cache now, with expiry of 86400
Aug 22, 2020 08:10:46 AM DEBUG CACHE: storing key data in cache now, with expiry of 86400
Aug 22, 2020 08:10:46 AM DEBUG EventServer: ok to send message
Aug 22, 2020 08:10:46 AM DEBUG EventSever: sendMessage: received->{"event":"push","data":{"type":"token","platform":"android","token":"c*******g:A**********K","state":"enabled"}}
Aug 22, 2020 08:10:46 AM DEBUG EventSever: Sending pending messages, as auth confirmation received
Aug 22, 2020 08:10:46 AM DEBUG EventSever: Real-time event: {"reason":"","version":"6.0.0","status":"Success","type":"","event":"auth"}
Aug 22, 2020 08:10:46 AM DEBUG CACHE: NOT found for:cached_multi_port reverting to HTTP
Aug 22, 2020 08:10:46 AM DEBUG CACHE: NOT found for:cached_timezone reverting to HTTP
Aug 22, 2020 08:10:46 AM DEBUG EventSever: Connection not yet authenticated, adding message to queue
Aug 22, 2020 08:10:46 AM DEBUG EventSever: sendMessage: received->{"event":"push","data":{"type":"token","platform":"android","token":"c*******g:A**********K","state":"enabled"}}
Aug 22, 2020 08:10:46 AM DEBUG EventSever: openHandShake: state of push is enabled
Aug 22, 2020 08:10:46 AM DEBUG EventServer: ok to send message
Aug 22, 2020 08:10:46 AM DEBUG EventSever: sendMessage: received->{"event":"auth","data":{"user":"crowston",<password removed>,"monlist":"1,2,3,4,5,6,7","intlist":"0,0,0,0,0,0,0"}}
Aug 22, 2020 08:10:46 AM INFO EventSever: openHandshake: Websocket open, sending Auth
Aug 22, 2020 08:10:46 AM DEBUG EventSever: WebSocket open called with:{"webSocketId":"F53C24BF-47D5-4B55-9C1F-582339826496","code":1000}
Aug 22, 2020 08:10:46 AM INFO Checking value of ZM_MIN_STREAMING_PORT for the first time
Aug 22, 2020 08:10:46 AM INFO getMonitors:Loading all monitors
Aug 22, 2020 08:10:46 AM DEBUG EventSever: Push Notification registration ID received: {"registrationId":"c*******g:A**********K","registrationType":"FCM"}
Aug 22, 2020 08:10:46 AM DEBUG Push permission returned: {"isEnabled":true}
Aug 22, 2020 08:10:45 AM DEBUG Transitioning state to: app.log with param {}
Aug 22, 2020 08:10:45 AM INFO EventSever: Setting up push registration
Aug 22, 2020 08:10:45 AM DEBUG Calling pushInit()
Aug 22, 2020 08:10:45 AM DEBUG EventSever: Using native websockets...
Aug 22, 2020 08:10:45 AM INFO EventSever: Initializing Websocket with URL ws://emohawk.home:9000
Aug 22, 2020 08:10:45 AM INFO First invocation of TimeZone, asking server
Aug 22, 2020 08:10:45 AM INFO Got API version: 1.32.3
Aug 22, 2020 08:10:45 AM DEBUG getAPI version succeeded with 1.32.3
Aug 22, 2020 08:10:45 AM DEBUG Setting server version to:1.32.3
Aug 22, 2020 08:10:45 AM DEBUG obfuscate: original:6221 obfuscated:1636 scheme:lzs
Aug 22, 2020 08:10:45 AM DEBUG snapshot  supported in image.php
Aug 22, 2020 08:10:45 AM DEBUG CACHE: storing key data in cache now, with expiry of 86400
Aug 22, 2020 08:10:45 AM DEBUG current version: 1.4.010 & available version 1.4.009
Aug 22, 2020 08:10:45 AM INFO ZM has recaptcha disabled - good
Aug 22, 2020 08:10:45 AM DEBUG CACHE: NOT found for:cached_api_version reverting to HTTP
Aug 22, 2020 08:10:45 AM DEBUG getAPIversion called with http://emohawk.home/zm/api/host/getVersion.json?&auth=<removed>
Aug 22, 2020 08:10:45 AM DEBUG PortalLogin: auth success
Aug 22, 2020 08:10:45 AM DEBUG auth-success broadcast:Successful
Aug 22, 2020 08:10:45 AM INFO Successfully logged into Zoneminder via API
Aug 22, 2020 08:10:45 AM INFO Stream authentication construction: &auth=<removed>
Aug 22, 2020 08:10:45 AM DEBUG obfuscate: original:6221 obfuscated:1636 scheme:lzs
Aug 22, 2020 08:10:45 AM DEBUG obfuscate: original:6221 obfuscated:1636 scheme:lzs
Aug 22, 2020 08:10:45 AM INFO Could not recover token details, trying old auth credentials
Aug 22, 2020 08:10:45 AM DEBUG Setting server version to:1.32.3
Aug 22, 2020 08:10:45 AM DEBUG obfuscate: original:6221 obfuscated:1636 scheme:lzs
Aug 22, 2020 08:10:45 AM DEBUG API based login returned. 
Aug 22, 2020 08:10:45 AM INFO Doing fresh login to ZM
Aug 22, 2020 08:10:45 AM INFO Token login not being used
Aug 22, 2020 08:10:45 AM DEBUG Resetting zmCookie...
Aug 22, 2020 08:10:45 AM INFO Checking if reCaptcha is enabled in ZM...
Aug 22, 2020 08:10:45 AM DEBUG Inside _doLogin()
Aug 22, 2020 08:10:45 AM DEBUG Logout returned... 
Aug 22, 2020 08:10:45 AM DEBUG Logging out using API method
Aug 22, 2020 08:10:45 AM INFO http://emohawk.home/zm=>Logging out of any existing ZM sessions...
Aug 22, 2020 08:10:45 AM INFO No need to do a reachability test, as there are no fallbacks
Aug 22, 2020 08:10:45 AM INFO reached end of chain loop
Aug 22, 2020 08:10:45 AM INFO Fallback of emohawk.home is 
Aug 22, 2020 08:10:45 AM INFO Adding to chain stack: emohawk.home>http://emohawk.home/zm
Aug 22, 2020 08:10:45 AM DEBUG _doLogoutAndLogin: Clearing cookies
Aug 22, 2020 08:10:45 AM DEBUG We will relogin every 1800 seconds, token supported=false
Aug 22, 2020 08:10:45 AM INFO Cancelling zmAutologin timer
Aug 22, 2020 08:10:45 AM DEBUG PIN code entered is correct, or there is no PIN set
Aug 22, 2020 08:10:45 AM DEBUG unlock called with check PIN=true
Aug 22, 2020 08:10:45 AM INFO not checking for touchID
Aug 22, 2020 08:10:45 AM INFO User credentials are provided
Aug 22, 2020 08:10:45 AM DEBUG Inside Portal login Enter handler
Aug 22, 2020 08:10:45 AM INFO Entering Portal Main
Aug 22, 2020 08:10:45 AM DEBUG --> SSL is permissive, will allow any certs. Use at your own risk.
Aug 22, 2020 08:10:45 AM INFO Inside init-complete in app.js: All init over, going to portal login
Aug 22, 2020 08:10:45 AM INFO >>>> Disabling strict SSL checking (turn off  in Dev Options if you can't connect)
Aug 22, 2020 08:10:45 AM DEBUG Setting cordova header X-ZmNinja to zmNinja_1.4.010
Aug 22, 2020 08:10:45 AM INFO NVR init retrieved store loginData, marking init as complete
Aug 22, 2020 08:10:45 AM INFO Setting NVR init bandwidth to: highbw
Aug 22, 2020 08:10:45 AM DEBUG deobfuscate: before:1636 after:6221 scheme:lzs
Aug 22, 2020 08:10:45 AM INFO user profile encrypted, decoding...
Aug 22, 2020 08:10:45 AM INFO Setting up pause and resume handler AFTER language is loaded...
Aug 22, 2020 08:10:45 AM INFO Checking for new version updates...
Aug 22, 2020 08:10:45 AM INFO ZMData init: checking for stored variables & setting up log file
Aug 22, 2020 08:10:45 AM INFO Language file loaded, continuing with rest
Aug 22, 2020 08:10:45 AM DEBUG last state=app.log param=[object Object]
Aug 22, 2020 08:10:45 AM DEBUG isFirstUse returned: false
Aug 22, 2020 08:10:45 AM INFO >>>>Language to be used:en
Aug 22, 2020 08:10:45 AM INFO Device Language is:en
Aug 22, 2020 08:10:45 AM INFO App Version: 1.4.010
Aug 22, 2020 08:10:45 AM INFO No language set, switching to en
Aug 22, 2020 08:10:45 AM INFO Retrieving language before init is called...
Aug 22, 2020 08:10:45 AM INFO Updating statusbar
Aug 22, 2020 08:10:45 AM INFO >>>>No data to import....
Aug 22, 2020 08:10:45 AM INFO Cloudsync operation complete, continuing...
Aug 22, 2020 08:10:45 AM INFO local data synced with cloud...
Aug 22, 2020 08:10:45 AM INFO Found valid local configuration, overwriting cloud settings...
Aug 22, 2020 08:10:45 AM DEBUG deobfuscate: before:1636 after:6221 scheme:lzs
Aug 22, 2020 08:10:45 AM INFO user profile encrypted, decoding...
Aug 22, 2020 08:10:45 AM INFO CloudSync: Syncing with cloud if enabled...
Aug 22, 2020 08:10:45 AM INFO localforage driver:cordovaSQLiteDriver
Aug 22, 2020 08:10:45 AM DEBUG configureStorageDB:test get/set worked, this driver is ok...
Aug 22, 2020 08:10:45 AM DEBUG configureStorageDB:Making sure this storage driver works...
Aug 22, 2020 08:10:45 AM INFO configureStorageDB:localforage driver for storage:cordovaSQLiteDriver
Aug 22, 2020 08:10:45 AM DEBUG configureStorageDB: trying order:["cordovaSQLiteDriver","asyncStorage","localStorageWrapper"]
Aug 22, 2020 08:10:45 AM DEBUG Inside configureStorageDB
Aug 22, 2020 08:10:45 AM INFO You are running on ios
Aug 22, 2020 08:10:45 AM DEBUG UA is mozilla/5.0 (macintosh; intel mac os x 10_15_4) applewebkit/605.1.15 (khtml, like gecko) mobile/15e148
Aug 22, 2020 08:10:45 AM INFO Device is ready
2020-08-22T12:10:45.257Z INFO ******* app .run device ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants