Unable to open openstreetmap.org link on osm login fragment #3950

Closed
opened 2022-11-23 06:03:45 +00:00 by Jean-BaptisteC · 7 comments
Jean-BaptisteC commented 2022-11-23 06:03:45 +00:00 (Migrated from github.com)

How reproduce:

  • Start OM --> settings --> Profile OSM (Need app without OSM connection)
  • Click on openstreetmap.org
  • OM restart

To reproduce openstreetmap.org has been enabled on Android app settings (open by default)

I think OM try to open link because he has detected like openable link but he has not GPS coordinates to load position on map
Maybe be more restrictive on openable link, to allow users to open openstreemap.org on browser without start OM

78f09b392d/android/AndroidManifest.xml (L554)

Android 13 - Pixel 6
v2022.11.02-2-Google

How reproduce: - Start OM --> settings --> Profile OSM (Need app without OSM connection) - Click on [openstreetmap.org](openstreetmap.org) - OM restart To reproduce openstreetmap.org has been enabled on Android app settings (open by default) I think OM try to open link because he has detected like openable link but he has not GPS coordinates to load position on map Maybe be more restrictive on openable link, to allow users to open openstreemap.org on browser without start OM https://github.com/organicmaps/organicmaps/blob/78f09b392d5a12c9033934d8044ee88d52bd5854/android/AndroidManifest.xml#L554 Android 13 - Pixel 6 v2022.11.02-2-Google
biodranik commented 2022-11-23 06:11:04 +00:00 (Migrated from github.com)

You're right, OM should intercept only links with coordinates, like https://www.openstreetmap.org/#map=15/45.8610/18.4110, and should not intercept general links, including wiki.

But it also should not crash.

@rtsisyk can you please fix it?

You're right, OM should intercept only links with coordinates, like `https://www.openstreetmap.org/#map=15/45.8610/18.4110`, and should not intercept general links, including wiki. But it also should not crash. @rtsisyk can you please fix it?
Owner

You're right, OM should intercept only links with coordinates, like https://www.openstreetmap.org/#map=15/45.8610/18.4110, and should not intercept general links, including wiki.

But it also should not crash.

@rtsisyk can you please fix it?

Unfortunately, there is no way to intercept only links only with "#map=". Only scheme, host, port, path can be used to filter URLs.

940bbad149/android/AndroidManifest.xml (L553-L558)

Shall we remove "/" hook?

P.S. intercepting of unverified links doesn't work on Android 12+.

> You're right, OM should intercept only links with coordinates, like `https://www.openstreetmap.org/#map=15/45.8610/18.4110`, and should not intercept general links, including wiki. > > But it also should not crash. > > @rtsisyk can you please fix it? Unfortunately, there is no way to intercept only links only with "#map=". Only scheme, host, port, path can be used to filter URLs. https://github.com/organicmaps/organicmaps/blob/940bbad1497b3e13ccd372d9c7667965e082758a/android/AndroidManifest.xml#L553-L558 Shall we remove "/" hook? P.S. intercepting of unverified links doesn't work on Android 12+.
biodranik commented 2023-01-07 18:00:11 +00:00 (Migrated from github.com)

Let's leave it as is for Android 5-11, but fix the crash.

Let's leave it as is for Android 5-11, but fix the crash.
Owner

Let's leave it as is for Android 5-11, but fix the crash.

Any details about the crash? I can't repro any crashes with https://www.openstreetmap.org/#map=15/45.8610/18.4110above.

> Let's leave it as is for Android 5-11, but fix the crash. Any details about the crash? I can't repro any crashes with `https://www.openstreetmap.org/#map=15/45.8610/18.4110`above.
Jean-BaptisteC commented 2023-01-08 17:52:14 +00:00 (Migrated from github.com)

I have doing some test, we don't have crash, i guess OM restart activity to open link
Here is log when i click on OSM link in login fragment

01-08 18:48:41.527  1461  1523 I ActivityManager: Start proc 31387:com.android.chrome:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:9/u0ai9 for  {com.android.chrome/org.chromium.content.app.SandboxedProcessService0:9}
01-08 18:48:41.527 31387 31387 E libc    : SetHeapTaggingLevel: re-enabling tagging after it was disabled is not supported
01-08 18:48:41.533 31387 31387 E ocessService0:9: Not starting debugger since process cannot load the jdwp agent.
01-08 18:48:41.592  1461  1889 I ActivityManager: Killing 31387:com.android.chrome:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:9/u0a176i-8991 (adj 0): isolated not needed
01-08 18:48:41.711 30156 30156 E cr_CompositorSurfaceMgr: surfaceDestroyed format : 4
I have doing some test, we don't have crash, i guess OM restart activity to open link Here is log when i click on OSM link in login fragment ``` 01-08 18:48:41.527 1461 1523 I ActivityManager: Start proc 31387:com.android.chrome:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:9/u0ai9 for {com.android.chrome/org.chromium.content.app.SandboxedProcessService0:9} 01-08 18:48:41.527 31387 31387 E libc : SetHeapTaggingLevel: re-enabling tagging after it was disabled is not supported 01-08 18:48:41.533 31387 31387 E ocessService0:9: Not starting debugger since process cannot load the jdwp agent. 01-08 18:48:41.592 1461 1889 I ActivityManager: Killing 31387:com.android.chrome:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:9/u0a176i-8991 (adj 0): isolated not needed 01-08 18:48:41.711 30156 30156 E cr_CompositorSurfaceMgr: surfaceDestroyed format : 4 ```
Owner

I am still thinking about removing / to avoid potential troubles...

I am still thinking about removing `/` to avoid potential troubles...
Jean-BaptisteC commented 2023-01-08 18:10:06 +00:00 (Migrated from github.com)

I have find a solution to open link in browser, if we replace openstreetmap.org by osm.org, link is open in browser.
Just replace constants links with openstreetmap.org by osm.org

I have find a solution to open link in browser, if we replace openstreetmap.org by osm.org, link is open in browser. Just replace constants links with openstreetmap.org by osm.org
This repo is archived. You cannot comment on issues.
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps-tmp#3950
No description provided.