Files
VncThumbnailViewer/src/net/n3/nanoxml/ContentReader.java
T
CydandClaude Opus 4.8 41a52acef8 Deconstruct VncThumbnailViewer 1.4.2 and add self-contained build
The shipped VncThumbnailViewerWin1.4.2.exe is a native launcher stub with a
Java JAR appended. This commit adds:

- src/: full Java source recovered from the bundled .class files (CFR),
  plus src/summary.txt with decompiler caveats
- ANALYSIS.md: architecture, data flow, hosts-file format, and security notes
- build-app-image.ps1: reproducible jpackage build that repackages the
  original classes and bundles a slim jlinked runtime (java.base + java.desktop)
  into a self-contained native app-image (no Java required on the target)

The 74 MB app-image is shipped as a release asset rather than tracked.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 10:42:42 -05:00

112 lines
3.5 KiB
Java

/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* net.n3.nanoxml.ContentReader
* net.n3.nanoxml.IXMLEntityResolver
* net.n3.nanoxml.IXMLReader
* net.n3.nanoxml.XMLParseException
* net.n3.nanoxml.XMLUtil
*/
package net.n3.nanoxml;
import java.io.IOException;
import java.io.Reader;
import net.n3.nanoxml.IXMLEntityResolver;
import net.n3.nanoxml.IXMLReader;
import net.n3.nanoxml.XMLParseException;
import net.n3.nanoxml.XMLUtil;
class ContentReader
extends Reader {
private IXMLReader reader;
private String buffer;
private int bufferIndex;
private IXMLEntityResolver resolver;
ContentReader(IXMLReader iXMLReader, IXMLEntityResolver iXMLEntityResolver, String string) {
this.reader = iXMLReader;
this.resolver = iXMLEntityResolver;
this.buffer = string;
this.bufferIndex = 0;
}
protected void finalize() throws Throwable {
this.reader = null;
this.resolver = null;
this.buffer = null;
super.finalize();
}
public int read(char[] cArray, int n, int n2) throws IOException {
try {
int n3 = 0;
int n4 = this.buffer.length();
if (n + n2 > cArray.length) {
n2 = cArray.length - n;
}
while (n3 < n2) {
char c;
String string = "";
if (this.bufferIndex < n4) {
c = this.buffer.charAt(this.bufferIndex);
++this.bufferIndex;
cArray[n3] = c;
++n3;
continue;
}
string = XMLUtil.read((IXMLReader)this.reader, (char)'&');
c = string.charAt(0);
if (c == '<') {
this.reader.unread(c);
break;
}
if (c == '&' && string.length() > 1) {
if (string.charAt(1) == '#') {
c = XMLUtil.processCharLiteral((String)string);
} else {
XMLUtil.processEntity((String)string, (IXMLReader)this.reader, (IXMLEntityResolver)this.resolver);
continue;
}
}
cArray[n3] = c;
++n3;
}
if (n3 == 0) {
n3 = -1;
}
return n3;
}
catch (XMLParseException xMLParseException) {
throw new IOException(xMLParseException.getMessage());
}
}
public void close() throws IOException {
try {
int n = this.buffer.length();
while (true) {
char c;
String string = "";
if (this.bufferIndex < n) {
c = this.buffer.charAt(this.bufferIndex);
++this.bufferIndex;
continue;
}
string = XMLUtil.read((IXMLReader)this.reader, (char)'&');
c = string.charAt(0);
if (c == '<') {
this.reader.unread(c);
break;
}
if (c != '&' || string.length() <= 1 || string.charAt(1) == '#') continue;
XMLUtil.processEntity((String)string, (IXMLReader)this.reader, (IXMLEntityResolver)this.resolver);
}
}
catch (XMLParseException xMLParseException) {
throw new IOException(xMLParseException.getMessage());
}
}
}