Skip to content

Commit 651ba37

Browse files
committed
remove webstart support
Oracle disabled self-signed applications by default. There's no point in keeping WebStart support around.
1 parent ebf4dbd commit 651ba37

File tree

8 files changed

+21
-109
lines changed

8 files changed

+21
-109
lines changed

build.xml

+1-40
Original file line numberDiff line numberDiff line change
@@ -77,46 +77,7 @@
7777
<property name="libs.MacUI.classpath" value=""/>
7878
<echo message="Building without Mac OS support as requested."/>
7979
</target>
80-
81-
<!-- overwrite 'jar' target not to create jnlp automatically -->
82-
<target name="jar" depends="init,compile,-pre-jar,-do-jar,-post-jar"
83-
description="Build JAR."/>
84-
85-
<!-- overwrite 'jws-run' to depend on 'javaws' target -->
86-
<target name="jws-run" depends="jar,-verify-jnlp-enabled,-verify-codebase,javaws" description="Start javaws execution">
87-
<exec executable="${java.home}/bin/javaws">
88-
<arg file="${jnlp.dest.dir}/${launch.jnlp.file}"/>
89-
</exec>
90-
</target>
91-
92-
<!-- build java webstart files -->
93-
<target name="javaws" depends="jar" description="Build Java WebStart files.">
94-
<!-- create gateways.jar file -->
95-
<copy todir="dist/tmp/esmska/gateways/scripts">
96-
<fileset dir="dist/gateways"/>
97-
</copy>
98-
<jar destfile="dist/lib/gateways.jar" basedir="dist/tmp"/>
99-
<delete dir="dist/tmp"/>
100-
<!-- add "gateways.jar" to the Class-Path in jar manifest -->
101-
<jar destfile="${dist.jar}" update="true">
102-
<manifest>
103-
<attribute name="Class-Path" value="${jar.classpath} gateways.jar"/>
104-
</manifest>
105-
</jar>
106-
<!-- add esmska.ico -->
107-
<move file="dist/icons/esmska.ico" todir="dist"/>
108-
<!-- delete unneeded stuff -->
109-
<delete includeemptydirs="true">
110-
<fileset dir="dist" includes="**/*">
111-
<exclude name="lib/**"/>
112-
<exclude name="*.jar"/>
113-
<exclude name="esmska.ico"/>
114-
</fileset>
115-
</delete>
116-
<!-- call 'jnlp' target -->
117-
<antcall target="jnlp"/>
118-
</target>
119-
80+
12081
<!-- called after jar building -->
12182
<target name="-post-jar">
12283
<!-- delete unneeded stuff -->

master.jnlp

-35
This file was deleted.

nbproject/project.properties

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
annotation.processing.enabled=true
22
annotation.processing.enabled.in.editor=false
3+
annotation.processing.processors.list=
34
annotation.processing.run.all.processors=true
45
application.desc=Program for sending SMS over the Internet
56
application.homepage=http://esmska.googlecode.com
@@ -29,7 +30,9 @@ excludes=
2930
file.reference.esmska-lib=lib
3031
file.reference.javaws.jar=lib/javaws.jar
3132
includes=**
33+
jar.archive.disabled=${jnlp.enabled}
3234
jar.compress=false
35+
jar.index=${jnlp.enabled}
3336
javac.classpath=\
3437
${libs.JGoodies-Looks.classpath}:\
3538
${libs.JavaCSV.classpath}:\
@@ -75,15 +78,24 @@ jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
7578
jnlp.codebase.type=user
7679
jnlp.codebase.url=file:/home/ripper/devel/esmska/trunk/esmska/dist/
7780
jnlp.codebase.user=http://ripper.profitux.cz/esmska/webstart/
81+
jnlp.descriptor=application
7882
jnlp.enabled=false
7983
jnlp.icon=src/esmska/resources/esmska.png
84+
jnlp.mixed.code=default
8085
jnlp.offline-allowed=true
8186
jnlp.signed=true
87+
jnlp.signing=generated
88+
jnlp.signing.alias=esmska
89+
jnlp.signing.keystore=
8290
# Comment jnlp.signjar.* properties to disable custom keystore and use one-time generated cerificates.
8391
# Add jnlp.signjar.storepass property to private/project.properties to set keystore password.
8492
jnlp.signjar.keystore=esmska.keystore
8593
jnlp.signjar.alias=esmska
8694
main.class=esmska.Main
95+
# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed
96+
manifest.custom.codebase=
97+
# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions)
98+
manifest.custom.permissions=
8799
manifest.file=manifest.mf
88100
meta.inf.dir=${src.dir}/META-INF
89101
mkdist.disabled=false

src/esmska/Main.java

-10
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,6 @@ public static void main(String[] args) {
6363
+ "The tested Java versions are: Oracle Java 6 and 7, OpenJDK 6 and 7, Apple Java 6 and 7.");
6464
}
6565

66-
// halt for Webstart on OpenJDK, it currently doesn't work
67-
// see http://code.google.com/p/esmska/issues/detail?id=335
68-
// see http://code.google.com/p/esmska/issues/detail?id=357
69-
// see http://code.google.com/p/esmska/issues/detail?id=358
70-
if (RuntimeUtils.isOpenJDK() && RuntimeUtils.isRunAsWebStart()) {
71-
logger.severe("Running as Java WebStart on OpenJDK, that's currently unsupported! Quitting.");
72-
JOptionPane.showMessageDialog(null, l10n.getString("Main.brokenWebstart"), "Esmska", JOptionPane.ERROR_MESSAGE);
73-
System.exit(99);
74-
}
75-
7666
//parse commandline arguments
7767
CommandLineParser clp = new CommandLineParser();
7868
if (! clp.parseArgs(args)) {

src/esmska/persistence/PersistenceManager.java

+8-16
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ public class PersistenceManager {
6262
private static final String LOCK_FILENAME = "running.lock";
6363
private static final String LOG_FILENAME = "console.log";
6464
private static final String DEPRECATED_GWS_FILENAME = "deprecated.xml";
65-
private static final String GATEWAY_RESOURCE = "/esmska/gateways/scripts";
66-
private static final String DEPRECATED_GWS_RESOURCE = GATEWAY_RESOURCE + "/" + DEPRECATED_GWS_FILENAME;
6765
private static final String GATEWAY_PROPS_FILENAME = "gateways.json";
6866

6967
private static File configDir =
@@ -371,28 +369,22 @@ public void loadGateways() throws IOException, IntrospectionException, SAXExcept
371369
TreeSet<Gateway> localGateways = new TreeSet<Gateway>();
372370
HashSet<DeprecatedGateway> deprecatedGateways = new HashSet<DeprecatedGateway>();
373371
//global gateways
374-
if (!RuntimeUtils.isRunAsWebStart() && globalGatewayDir.exists()) {
372+
if (globalGatewayDir.exists()) {
375373
globalGateways = new ArrayList<Gateway>(ImportManager.importGateways(globalGatewayDir, false));
376-
} else if (RuntimeUtils.isRunAsWebStart()) {
377-
globalGateways = new ArrayList<Gateway>(ImportManager.importGateways(GATEWAY_RESOURCE));
378374
} else {
379375
throw new IOException("Could not find gateways directory '" +
380-
globalGatewayDir.getAbsolutePath() + "' nor jar gateways resource '" +
381-
GATEWAY_RESOURCE + "'");
376+
globalGatewayDir.getAbsolutePath() + "'");
382377
}
383378
//local gateways
384379
if (localGatewayDir.exists()) {
385380
localGateways = ImportManager.importGateways(localGatewayDir, true);
386381
}
387382
//deprecated gateways
388-
if (!RuntimeUtils.isRunAsWebStart() && deprecatedGWsFile.canRead()) {
383+
if (deprecatedGWsFile.canRead()) {
389384
deprecatedGateways = ImportManager.importDeprecatedGateways(deprecatedGWsFile);
390-
} else if (RuntimeUtils.isRunAsWebStart()) {
391-
deprecatedGateways = ImportManager.importDeprecatedGateways(DEPRECATED_GWS_RESOURCE);
392385
} else {
393386
logger.warning("Could not find deprecated gateways file: '" +
394-
deprecatedGWsFile.getAbsolutePath() + "' nor jar resource '" +
395-
DEPRECATED_GWS_RESOURCE + "'");
387+
deprecatedGWsFile.getAbsolutePath() + "'");
396388
}
397389
//filter out deprecated gateways
398390
for (DeprecatedGateway deprecated : deprecatedGateways) {
@@ -497,8 +489,8 @@ public void saveGateway(String scriptName, String scriptContents, byte[] icon) t
497489
//move script file to correct location
498490
File scriptFileGlobal = new File(globalGatewayDir, scriptName + ".gateway");
499491
File scriptFileLocal = new File(localGatewayDir, scriptName + ".gateway");
500-
if (!RuntimeUtils.isRunAsWebStart() && canWrite(globalGatewayDir)
501-
&& (!scriptFileGlobal.exists() || canWrite(scriptFileGlobal))) {
492+
if (canWrite(globalGatewayDir) &&
493+
(!scriptFileGlobal.exists() || canWrite(scriptFileGlobal))) {
502494
//first try global dir
503495
moveFileSafely(temp, scriptFileGlobal);
504496
//set readable for everyone
@@ -519,8 +511,8 @@ public void saveGateway(String scriptName, String scriptContents, byte[] icon) t
519511
if (icon != null) {
520512
File iconFileGlobal = new File(globalGatewayDir, scriptName + ".png");
521513
File iconFileLocal = new File(localGatewayDir, scriptName + ".png");
522-
if (!RuntimeUtils.isRunAsWebStart() && canWrite(globalGatewayDir)
523-
&& (!iconFileGlobal.exists() || canWrite(iconFileGlobal))) {
514+
if (canWrite(globalGatewayDir) &&
515+
(!iconFileGlobal.exists() || canWrite(iconFileGlobal))) {
524516
//first try global dir
525517
moveFileSafely(iconTemp, iconFileGlobal);
526518
logger.finer("Saved gateway icon into file: " + iconFileGlobal.getAbsolutePath());

src/esmska/resources/l10n.properties

-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,6 @@ ConfigFrame.senderNumberLabel.text=&Number:
454454
ConfigFrame.senderNameLabel.text=N&ame:
455455
Signature.confirmRemove=Do you want to remove selected signature?
456456
SignatureComboBox.tooltip=The signature to append to the message (sender number and name).
457-
Main.brokenWebstart=You're currently running Esmska using OpenJDK and Java WebStart.\nUnfortunatelly this combination is currently broken and doesn't work.\nEither install Sun Java and use Java WebStart, or download Esmska to your computer\nand run it the common way.\n\nEsmska will now quit.
458457
#If you want to use single quotes (') in this translation, you must write them doubled ('')!
459458
GatewayProblem.WRONG_SIGNATURE=You have entered a wrong sender signature (a number or a name).<br>\nYour sender number: {0}<br>\nYour sender name: {1}
460459
#If you want to use single quotes (') in this translation, you must write them doubled ('')!

src/esmska/update/Statistics.java

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ public static JSONObject collectUsageInfo() {
5858
info.put("uuid", config.getUUID());
5959
info.put("version", Config.getLatestVersion());
6060
info.put("stable", Config.isStableVersion());
61-
info.put("webstart", RuntimeUtils.isRunAsWebStart());
6261

6362
// system info
6463
info.put("os", WordUtils.capitalizeFully(RuntimeUtils.detectOS().name()));

src/esmska/utils/RuntimeUtils.java

-6
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,6 @@ public static boolean isSupportedJava() {
124124
return isOracleJava() || isOpenJDK() || isAppleJava();
125125
}
126126

127-
/** Whether the program is run as Java WebStart or not */
128-
public static boolean isRunAsWebStart() {
129-
//property esmska.isWebstart is set in JNLP file
130-
return System.getProperty("esmska.isWebstart") != null;
131-
}
132-
133127
/** Get basic information about current system. Useful for debugging
134128
* print-outs.
135129
*/

0 commit comments

Comments
 (0)