Import GingerCal 1.0 source

This commit is contained in:
xocko committed 2026-10-15 16:35:05 +02:00
commit 01f49852ab
116 files changed
+5079

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
package org.gingercal;
import java.io.IOException;
/** A server/protocol problem with a message that can be shown to the user as-is. */
public class DavException extends IOException {
public final int code;
/** code for redirect problems (forced HTTPS, loops); retrying another URL won't help. */
public static final int REDIRECT = -2;
public DavException(int code, String msg) {
super(msg);
this.code = code;
}
/** Thrown when the TLS certificate isn't trusted (or doesn't match the pin). */
public static class UntrustedCert extends IOException {
public final String fingerprint, subject, issuer, expires;
public final boolean pinMismatch;
public UntrustedCert(String fingerprint, String subject, String issuer, String expires,
boolean pinMismatch) {
super(pinMismatch ? "Server certificate changed (does not match the pinned fingerprint)"
: "Server certificate is not trusted by this phone");
this.fingerprint = fingerprint;
this.subject = subject;
this.issuer = issuer;
this.expires = expires;
this.pinMismatch = pinMismatch;
}
}
}