<NME> CheckerUtils.java
<BEF> package cgeo.geocaching.utils;

import cgeo.geocaching.CgeoApplication;
import cgeo.geocaching.R;
import cgeo.geocaching.models.Geocache;

import android.util.Patterns;


import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.util.regex.Matcher;

import org.apache.commons.text.StringEscapeUtils;

public final class CheckerUtils {
    private static final String[] CHECKERS = {
            "certitudes.org/certitude?",
            "gc-apps.com/checker/",
            "gccounter.com/gcchecker.php?",
            "geocheck.org/geo_inputchkcoord.php?",
            "geochecker.com/index.php?",
            "geochecker.gps-cache.de/check.aspx?",
            "geotjek.dk/geo_inputchkcoord.php?",
            "geocache-planer.de/CAL/checker.php?",
    };

    private CheckerUtils() {
    private static final GeoChecker GC_CHECKER = new GeoChecker("geocaching.com");

    private CheckerUtils() {
        // utility class
    }
        final String description = cache.getDescription();
        final Matcher matcher = Patterns.WEB_URL.matcher(description);
        while (matcher.find()) {
            final String url = matcher.group();
            for (final String checker : CHECKERS) {
                if (StringUtils.containsIgnoreCase(url, checker)) {
                    return StringEscapeUtils.unescapeHtml4(url);
                }
            }
                if (StringUtils.containsIgnoreCase(url, checker.getUrlPattern())) {
                    if (checker.getCoordinateFormat() != null) {
                        if (coordinateToCheck != null) {
                            url = url + checker.getUrlCoordinateParam() + coordinateToCheck.format(checker.getCoordinateFormat());
        }
        return null;
    }
}
        public String getUrlPattern() {
            return urlPattern;
        }

        public String getUrlCoordinateParam() {
            return urlCoordinateParam;
        }

        public GeopointFormatter.Format getCoordinateFormat() {
            return coordinateFormat;
        }
    }
}

<MSG> pass current cache coordinates to geochecker (#12134)


<DFF> @@ -2,7 +2,10 @@ package cgeo.geocaching.utils;
 
 import cgeo.geocaching.CgeoApplication;
 import cgeo.geocaching.R;
+import cgeo.geocaching.location.Geopoint;
+import cgeo.geocaching.location.GeopointFormatter;
 import cgeo.geocaching.models.Geocache;
+import cgeo.geocaching.models.Waypoint;
 
 import android.util.Patterns;
 
@@ -15,15 +18,14 @@ import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.text.StringEscapeUtils;
 
 public final class CheckerUtils {
-    private static final String[] CHECKERS = {
-            "certitudes.org/certitude?",
-            "gc-apps.com/checker/",
-            "gccounter.com/gcchecker.php?",
-            "geocheck.org/geo_inputchkcoord.php?",
-            "geochecker.com/index.php?",
-            "geochecker.gps-cache.de/check.aspx?",
-            "geotjek.dk/geo_inputchkcoord.php?",
-            "geocache-planer.de/CAL/checker.php?",
+    private static final GeoChecker[] CHECKERS = {
+        new GeoChecker("certitudes.org/certitude?"),
+        new GeoChecker("gc-apps.com/checker/"),
+        new GeoChecker("geocheck.org/geo_inputchkcoord.php?", "&coord=", GeopointFormatter.Format.GEOCHECKORG),
+        new GeoChecker("geochecker.com/index.php?", "&lastcoords=", GeopointFormatter.Format.GEOCHECKERCOM),
+        new GeoChecker("geochecker.gps-cache.de/check.aspx?"),
+        new GeoChecker("geotjek.dk/geo_inputchkcoord.php?", "&coord=", GeopointFormatter.Format.GEOCHECKORG),
+        new GeoChecker("geocache-planer.de/CAL/checker.php?")
     };
 
     private CheckerUtils() {
@@ -35,9 +37,20 @@ public final class CheckerUtils {
         final String description = cache.getDescription();
         final Matcher matcher = Patterns.WEB_URL.matcher(description);
         while (matcher.find()) {
-            final String url = matcher.group();
-            for (final String checker : CHECKERS) {
-                if (StringUtils.containsIgnoreCase(url, checker)) {
+            String url = matcher.group();
+            for (final GeoChecker checker : CHECKERS) {
+                if (StringUtils.containsIgnoreCase(url, checker.getUrlPattern())) {
+                    if (checker.getCoordinateFormat() != null) {
+                        final Geopoint coordinateToCheck;
+                        if (!cache.hasUserModifiedCoords() && cache.hasFinalDefined()) {
+                            coordinateToCheck = cache.getFirstMatchingWaypoint(Waypoint::isFinalWithCoords).getCoords();
+                        } else {
+                            coordinateToCheck = cache.getCoords();
+                        }
+                        if (coordinateToCheck != null) {
+                            url = url + checker.getUrlCoordinateParam() + coordinateToCheck.format(checker.getCoordinateFormat());
+                        }
+                    }
                     return StringEscapeUtils.unescapeHtml4(url);
                 }
             }
@@ -48,4 +61,32 @@ public final class CheckerUtils {
         }
         return null;
     }
+
+    public static class GeoChecker {
+        private final String urlPattern;
+        private String urlCoordinateParam = "";
+        private GeopointFormatter.Format coordinateFormat = null;
+
+        public GeoChecker(final String urlPattern) {
+            this.urlPattern = urlPattern;
+        }
+
+        public GeoChecker(final String urlPattern, final String coordinateParam, final GeopointFormatter.Format coordinateFormat) {
+            this.urlPattern = urlPattern;
+            this.urlCoordinateParam = coordinateParam;
+            this.coordinateFormat = coordinateFormat;
+        }
+
+        public String getUrlPattern() {
+            return urlPattern;
+        }
+
+        public String getUrlCoordinateParam() {
+            return urlCoordinateParam;
+        }
+
+        public GeopointFormatter.Format getCoordinateFormat() {
+            return coordinateFormat;
+        }
+    }
 }

pass current cache coordinates to geochecker (#12134)