mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 22:09:47 -04:00
Experiment with PGP signed messages
This commit is contained in:
parent
fd8a9b4de6
commit
4e01a42e69
@ -27,9 +27,6 @@
|
|||||||
# reduce default logging
|
# reduce default logging
|
||||||
-Djava.util.logging.config.file="%EXEDIR%\logging.properties"
|
-Djava.util.logging.config.file="%EXEDIR%\logging.properties"
|
||||||
|
|
||||||
# force Application User Model ID for Windows Store
|
|
||||||
-Dnet.filebot.AppUserModelID=@{microsoft.application.name}
|
|
||||||
|
|
||||||
# support JAVA_OPTS environment variable
|
# support JAVA_OPTS environment variable
|
||||||
%JAVA_OPTS%
|
%JAVA_OPTS%
|
||||||
|
|
||||||
|
@ -27,9 +27,6 @@
|
|||||||
# reduce default logging
|
# reduce default logging
|
||||||
-Djava.util.logging.config.file="%EXEDIR%\logging.properties"
|
-Djava.util.logging.config.file="%EXEDIR%\logging.properties"
|
||||||
|
|
||||||
# force Application User Model ID for Windows Store
|
|
||||||
-Dnet.filebot.AppUserModelID=@{microsoft.application.name}
|
|
||||||
|
|
||||||
# support JAVA_OPTS environment variable
|
# support JAVA_OPTS environment variable
|
||||||
%JAVA_OPTS%
|
%JAVA_OPTS%
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@ package net.filebot;
|
|||||||
import static java.nio.charset.StandardCharsets.*;
|
import static java.nio.charset.StandardCharsets.*;
|
||||||
import static java.util.stream.Collectors.*;
|
import static java.util.stream.Collectors.*;
|
||||||
import static net.filebot.CachedResource.*;
|
import static net.filebot.CachedResource.*;
|
||||||
|
import static net.filebot.Settings.*;
|
||||||
|
import static net.filebot.platform.windows.WinAppUtilities.*;
|
||||||
import static net.filebot.util.FileUtilities.*;
|
import static net.filebot.util.FileUtilities.*;
|
||||||
import static net.filebot.util.RegularExpressions.*;
|
import static net.filebot.util.RegularExpressions.*;
|
||||||
|
|
||||||
@ -27,12 +29,34 @@ import org.bouncycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator;
|
|||||||
import org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentVerifierBuilderProvider;
|
import org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentVerifierBuilderProvider;
|
||||||
|
|
||||||
import net.filebot.util.ByteBufferOutputStream;
|
import net.filebot.util.ByteBufferOutputStream;
|
||||||
|
import net.filebot.util.SystemProperty;
|
||||||
import net.filebot.web.WebRequest;
|
import net.filebot.web.WebRequest;
|
||||||
|
|
||||||
public class License implements Serializable {
|
public class License implements Serializable {
|
||||||
|
|
||||||
public static final File LICENSE_FILE = ApplicationFolder.AppData.resolve("license.txt");
|
public static final SystemProperty<File> LICENSE_FILE = SystemProperty.of("net.filebot.license", File::new, ApplicationFolder.AppData.resolve("license.txt"));
|
||||||
public static final Resource<License> INSTANCE = Resource.lazy(() -> new License(readFile(LICENSE_FILE)));
|
|
||||||
|
public static final Resource<License> INSTANCE = Resource.lazy(() -> {
|
||||||
|
return new License(readFile(LICENSE_FILE.get()));
|
||||||
|
});
|
||||||
|
|
||||||
|
public static final void check() throws Exception {
|
||||||
|
if (isAppStore()) {
|
||||||
|
if (isWindowsApp() && "PointPlanck.FileBot".equals(getAppUserModelID())) {
|
||||||
|
return;
|
||||||
|
} else if (isMacSandbox() && !File.listRoots()[0].canRead()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw new Exception("BAD LICENSE: " + getAppStoreName() + " sandbox not found");
|
||||||
|
}
|
||||||
|
|
||||||
|
// check license file
|
||||||
|
License license = INSTANCE.get();
|
||||||
|
|
||||||
|
if (!license.isValid()) {
|
||||||
|
throw new Exception("BAD LICENSE: " + license);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private byte[] bytes;
|
private byte[] bytes;
|
||||||
|
|
||||||
|
@ -114,10 +114,6 @@ public final class Settings {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getApplicationUserModelID() {
|
|
||||||
return System.getProperty("net.filebot.AppUserModelID", getApplicationName());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static FileChooser getPreferredFileChooser() {
|
public static FileChooser getPreferredFileChooser() {
|
||||||
return FileChooser.valueOf(System.getProperty("net.filebot.UserFiles.fileChooser", "Swing"));
|
return FileChooser.valueOf(System.getProperty("net.filebot.UserFiles.fileChooser", "Swing"));
|
||||||
}
|
}
|
||||||
@ -139,7 +135,7 @@ public final class Settings {
|
|||||||
if (isMacApp())
|
if (isMacApp())
|
||||||
return "Mac App Store";
|
return "Mac App Store";
|
||||||
if (isWindowsApp())
|
if (isWindowsApp())
|
||||||
return "Windows Store";
|
return "Microsoft Store";
|
||||||
if (isUbuntuApp())
|
if (isUbuntuApp())
|
||||||
return "Ubuntu Software Center";
|
return "Ubuntu Software Center";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user