• R/O
  • SSH
  • HTTPS

exewrap: Commit


Commit MetaInfo

Revision36 (tree)
Time2017-09-19 11:18:43
Authorhirukawa_ryo

Log Message

* exewrap 1.1.7
exewrapからロードされるクラスにjava.security.ProtectionDomainを設定するようにしました。これによりProtectionDomainを利用したJARファイルのパス参照が可能になります。
ターゲットバージョン指定が正しく機能しないバグを修正しました。Java 8u40以上をターゲットにする場合は -t 1.8.0.40 と指定します。

Change Summary

Incremental Difference

--- exewrap/trunk/exewrap/src/Makefile (revision 35)
+++ exewrap/trunk/exewrap/src/Makefile (revision 36)
@@ -73,20 +73,21 @@
7373 $(LINK) $(LDFLAGS) /SUBSYSTEM:CONSOLE$(TARGET_VER) /MANIFEST /MANIFESTFILE:$(OBJ)\exewrap\exewrap.exe.manifest /OUT:$(BIN)\exewrap.exe $(OBJ)\exewrap.res $(OBJ)\exewrap.obj \
7474 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\eventlog.obj $(LIBS) $(MSVCRT_PATCH)
7575 $(MT) -manifest $(OBJ)\exewrap\exewrap.exe.manifest -outputresource:$(BIN)\exewrap.exe;1
76- $(OBJ)\bindres.exe $(BIN)\exewrap.exe VERSION_INFO resources\versioninfo.bin
77- $(OBJ)\bindres.exe -r $(BIN)\exewrap.exe IMAGE_CONSOLE_32 $(OBJ)\..\x86\image_console.exe
78- $(OBJ)\bindres.exe -r $(BIN)\exewrap.exe IMAGE_CONSOLE_64 $(OBJ)\..\x64\image_console.exe
79- $(OBJ)\bindres.exe -r $(BIN)\exewrap.exe IMAGE_GUI_32 $(OBJ)\..\x86\image_gui.exe
80- $(OBJ)\bindres.exe -r $(BIN)\exewrap.exe IMAGE_GUI_64 $(OBJ)\..\x64\image_gui.exe
81- $(OBJ)\bindres.exe -r $(BIN)\exewrap.exe IMAGE_SERVICE_32 $(OBJ)\..\x86\image_service.exe
82- $(OBJ)\bindres.exe -r $(BIN)\exewrap.exe IMAGE_SERVICE_64 $(OBJ)\..\x64\image_service.exe
83- $(OBJ)\bindres.exe $(BIN)\exewrap.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
84- $(OBJ)\bindres.exe $(BIN)\exewrap.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
85- $(OBJ)\bindres.exe $(BIN)\exewrap.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
86- $(OBJ)\bindres.exe $(BIN)\exewrap.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
87- $(OBJ)\bindres.exe $(BIN)\exewrap.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
88- $(OBJ)\bindres.exe $(BIN)\exewrap.exe UTIL_JAR $(OBJ)\util.jar
89- $(OBJ)\bindres.exe $(BIN)\exewrap.exe JAR $(OBJ)\tool.jar
76+ $(OBJ)\bindres.exe $(BIN)\exewrap.exe VERSION_INFO resources\versioninfo.bin
77+ $(OBJ)\bindres.exe -r $(BIN)\exewrap.exe IMAGE_CONSOLE_32 $(OBJ)\..\x86\image_console.exe
78+ $(OBJ)\bindres.exe -r $(BIN)\exewrap.exe IMAGE_CONSOLE_64 $(OBJ)\..\x64\image_console.exe
79+ $(OBJ)\bindres.exe -r $(BIN)\exewrap.exe IMAGE_GUI_32 $(OBJ)\..\x86\image_gui.exe
80+ $(OBJ)\bindres.exe -r $(BIN)\exewrap.exe IMAGE_GUI_64 $(OBJ)\..\x64\image_gui.exe
81+ $(OBJ)\bindres.exe -r $(BIN)\exewrap.exe IMAGE_SERVICE_32 $(OBJ)\..\x86\image_service.exe
82+ $(OBJ)\bindres.exe -r $(BIN)\exewrap.exe IMAGE_SERVICE_64 $(OBJ)\..\x64\image_service.exe
83+ $(OBJ)\bindres.exe $(BIN)\exewrap.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
84+ $(OBJ)\bindres.exe $(BIN)\exewrap.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
85+ $(OBJ)\bindres.exe $(BIN)\exewrap.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
86+ $(OBJ)\bindres.exe $(BIN)\exewrap.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
87+ $(OBJ)\bindres.exe $(BIN)\exewrap.exe URL_STREAM_HANDLER_FACTORY $(OBJ)\exewrap\core\URLStreamHandlerFactory.class
88+ $(OBJ)\bindres.exe $(BIN)\exewrap.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
89+ $(OBJ)\bindres.exe $(BIN)\exewrap.exe UTIL_JAR $(OBJ)\util.jar
90+ $(OBJ)\bindres.exe $(BIN)\exewrap.exe JAR $(OBJ)\tool.jar
9091
9192 $(BIN)\exewrap-trace.exe : $(BIN) $(OBJ) $(OBJ)\exewrap.res $(OBJ)\exewrap.obj \
9293 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\eventlog.obj \
@@ -95,20 +96,21 @@
9596 $(LINK) $(LDFLAGS) /SUBSYSTEM:CONSOLE$(TARGET_VER) /MANIFEST /MANIFESTFILE:$(OBJ)\exewrap\exewrap-trace.exe.manifest /OUT:$(BIN)\exewrap-trace.exe $(OBJ)\exewrap.res $(OBJ)\exewrap.obj \
9697 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\eventlog.obj $(LIBS) $(MSVCRT_PATCH)
9798 $(MT) -manifest $(OBJ)\exewrap\exewrap-trace.exe.manifest -outputresource:$(BIN)\exewrap-trace.exe;1
98- $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe VERSION_INFO resources\versioninfo.bin
99- $(OBJ)\bindres.exe -r $(BIN)\exewrap-trace.exe IMAGE_TRACE_CONSOLE_32 $(OBJ)\..\x86\image_console_trace.exe
100- $(OBJ)\bindres.exe -r $(BIN)\exewrap-trace.exe IMAGE_TRACE_CONSOLE_64 $(OBJ)\..\x64\image_console_trace.exe
101- $(OBJ)\bindres.exe -r $(BIN)\exewrap-trace.exe IMAGE_TRACE_GUI_32 $(OBJ)\..\x86\image_gui_trace.exe
102- $(OBJ)\bindres.exe -r $(BIN)\exewrap-trace.exe IMAGE_TRACE_GUI_64 $(OBJ)\..\x64\image_gui_trace.exe
103- $(OBJ)\bindres.exe -r $(BIN)\exewrap-trace.exe IMAGE_TRACE_SERVICE_32 $(OBJ)\..\x86\image_service_trace.exe
104- $(OBJ)\bindres.exe -r $(BIN)\exewrap-trace.exe IMAGE_TRACE_SERVICE_64 $(OBJ)\..\x64\image_service_trace.exe
105- $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
106- $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
107- $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
108- $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
109- $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
110- $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe UTIL_JAR $(OBJ)\util.jar
111- $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe JAR $(OBJ)\tool.jar
99+ $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe VERSION_INFO resources\versioninfo.bin
100+ $(OBJ)\bindres.exe -r $(BIN)\exewrap-trace.exe IMAGE_TRACE_CONSOLE_32 $(OBJ)\..\x86\image_console_trace.exe
101+ $(OBJ)\bindres.exe -r $(BIN)\exewrap-trace.exe IMAGE_TRACE_CONSOLE_64 $(OBJ)\..\x64\image_console_trace.exe
102+ $(OBJ)\bindres.exe -r $(BIN)\exewrap-trace.exe IMAGE_TRACE_GUI_32 $(OBJ)\..\x86\image_gui_trace.exe
103+ $(OBJ)\bindres.exe -r $(BIN)\exewrap-trace.exe IMAGE_TRACE_GUI_64 $(OBJ)\..\x64\image_gui_trace.exe
104+ $(OBJ)\bindres.exe -r $(BIN)\exewrap-trace.exe IMAGE_TRACE_SERVICE_32 $(OBJ)\..\x86\image_service_trace.exe
105+ $(OBJ)\bindres.exe -r $(BIN)\exewrap-trace.exe IMAGE_TRACE_SERVICE_64 $(OBJ)\..\x64\image_service_trace.exe
106+ $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
107+ $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
108+ $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
109+ $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
110+ $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe URL_STREAM_HANDLER_FACTORY $(OBJ)\exewrap\core\URLStreamHandlerFactory.class
111+ $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
112+ $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe UTIL_JAR $(OBJ)\util.jar
113+ $(OBJ)\bindres.exe $(BIN)\exewrap-trace.exe JAR $(OBJ)\tool.jar
112114
113115 $(OBJ)\exewrap.obj : $(OBJ) exewrap.c
114116 $(CC) $(CFLAGS) $(INC) /Fo$(OBJ)\exewrap.obj exewrap.c
@@ -118,31 +120,33 @@
118120
119121 $(OBJ)\image_console.exe : $(OBJ) $(OBJ)\image_console.res $(OBJ)\image_console.obj \
120122 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\notify.obj $(OBJ)\eventlog.obj \
121- $(OBJ)\bindres.exe $(OBJ)\exewrap\core\ByteBufferInputStream.class $(OBJ)\exewrap\core\PackInputStream.class $(OBJ)\exewrap\core\ExewrapClassLoader.class $(OBJ)\exewrap\core\URLConnection.class $(OBJ)\exewrap\core\URLStreamHandler.class $(OBJ)\util.jar
123+ $(OBJ)\bindres.exe $(OBJ)\exewrap\core\ByteBufferInputStream.class $(OBJ)\exewrap\core\PackInputStream.class $(OBJ)\exewrap\core\ExewrapClassLoader.class $(OBJ)\exewrap\core\URLConnection.class $(OBJ)\exewrap\core\URLStreamHandler.class $(OBJ)\exewrap\core\URLStreamHandlerFactory.class $(OBJ)\util.jar
122124 $(LINK) $(LDFLAGS) /SUBSYSTEM:CONSOLE$(TARGET_VER) /MANIFEST /OUT:$(OBJ)\image_console.exe $(OBJ)\image_console.obj \
123125 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\notify.obj $(OBJ)\eventlog.obj $(LIBS) $(MSVCRT_PATCH)
124126 $(MT) -manifest $(OBJ)\image_console.exe.manifest -outputresource:$(OBJ)\image_console.exe;1
125- $(OBJ)\bindres.exe $(OBJ)\image_console.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
126- $(OBJ)\bindres.exe $(OBJ)\image_console.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
127- $(OBJ)\bindres.exe $(OBJ)\image_console.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
128- $(OBJ)\bindres.exe $(OBJ)\image_console.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
129- $(OBJ)\bindres.exe $(OBJ)\image_console.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
130- $(OBJ)\bindres.exe $(OBJ)\image_console.exe UTIL_JAR $(OBJ)\util.jar
127+ $(OBJ)\bindres.exe $(OBJ)\image_console.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
128+ $(OBJ)\bindres.exe $(OBJ)\image_console.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
129+ $(OBJ)\bindres.exe $(OBJ)\image_console.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
130+ $(OBJ)\bindres.exe $(OBJ)\image_console.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
131+ $(OBJ)\bindres.exe $(OBJ)\image_console.exe URL_STREAM_HANDLER_FACTORY $(OBJ)\exewrap\core\URLStreamHandlerFactory.class
132+ $(OBJ)\bindres.exe $(OBJ)\image_console.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
133+ $(OBJ)\bindres.exe $(OBJ)\image_console.exe UTIL_JAR $(OBJ)\util.jar
131134
132135 $(OBJ)\image_console_trace.exe : $(OBJ) $(OBJ)\image_console.res $(OBJ)\image_console_trace.obj $(OBJ)\trace.obj \
133136 $(OBJ)\buffer.obj $(OBJ)\hde$(BITS).obj $(OBJ)\hook.obj $(OBJ)\trampoline.obj \
134137 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\notify.obj $(OBJ)\eventlog.obj \
135- $(OBJ)\bindres.exe $(OBJ)\exewrap\core\ByteBufferInputStream.class $(OBJ)\exewrap\core\PackInputStream.class $(OBJ)\exewrap\core\ExewrapClassLoader.class $(OBJ)\exewrap\core\URLConnection.class $(OBJ)\exewrap\core\URLStreamHandler.class $(OBJ)\util.jar
138+ $(OBJ)\bindres.exe $(OBJ)\exewrap\core\ByteBufferInputStream.class $(OBJ)\exewrap\core\PackInputStream.class $(OBJ)\exewrap\core\ExewrapClassLoader.class $(OBJ)\exewrap\core\URLConnection.class $(OBJ)\exewrap\core\URLStreamHandler.class $(OBJ)\exewrap\core\URLStreamHandlerFactory.class $(OBJ)\util.jar
136139 $(LINK) $(LDFLAGS) /SUBSYSTEM:CONSOLE$(TARGET_VER) /MANIFEST /OUT:$(OBJ)\image_console_trace.exe $(OBJ)\image_console_trace.obj $(OBJ)\trace.obj \
137140 $(OBJ)\buffer.obj $(OBJ)\hde$(BITS).obj $(OBJ)\hook.obj $(OBJ)\trampoline.obj \
138141 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\notify.obj $(OBJ)\eventlog.obj $(LIBS) $(MSVCRT_PATCH)
139142 $(MT) -manifest $(OBJ)\image_console_trace.exe.manifest -outputresource:$(OBJ)\image_console_trace.exe;1
140- $(OBJ)\bindres.exe $(OBJ)\image_console_trace.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
141- $(OBJ)\bindres.exe $(OBJ)\image_console_trace.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
142- $(OBJ)\bindres.exe $(OBJ)\image_console_trace.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
143- $(OBJ)\bindres.exe $(OBJ)\image_console_trace.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
144- $(OBJ)\bindres.exe $(OBJ)\image_console_trace.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
145- $(OBJ)\bindres.exe $(OBJ)\image_console_trace.exe UTIL_JAR $(OBJ)\util.jar
143+ $(OBJ)\bindres.exe $(OBJ)\image_console_trace.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
144+ $(OBJ)\bindres.exe $(OBJ)\image_console_trace.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
145+ $(OBJ)\bindres.exe $(OBJ)\image_console_trace.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
146+ $(OBJ)\bindres.exe $(OBJ)\image_console_trace.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
147+ $(OBJ)\bindres.exe $(OBJ)\image_console_trace.exe URL_STREAM_HANDLER_FACTORY $(OBJ)\exewrap\core\URLStreamHandlerFactory.class
148+ $(OBJ)\bindres.exe $(OBJ)\image_console_trace.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
149+ $(OBJ)\bindres.exe $(OBJ)\image_console_trace.exe UTIL_JAR $(OBJ)\util.jar
146150
147151 $(OBJ)\image_console.res : $(OBJ) resources\image_console.rc resources\eventlog.bin
148152 $(RC) /fo$(OBJ)\image_console.res resources\image_console.rc
@@ -155,31 +159,33 @@
155159
156160 $(OBJ)\image_gui.exe : $(OBJ) $(OBJ)\image_gui.res $(OBJ)\image_gui.obj \
157161 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\notify.obj $(OBJ)\eventlog.obj \
158- $(OBJ)\bindres.exe $(OBJ)\exewrap\core\ByteBufferInputStream.class $(OBJ)\exewrap\core\PackInputStream.class $(OBJ)\exewrap\core\ExewrapClassLoader.class $(OBJ)\exewrap\core\URLConnection.class $(OBJ)\exewrap\core\URLStreamHandler.class $(OBJ)\util.jar
162+ $(OBJ)\bindres.exe $(OBJ)\exewrap\core\ByteBufferInputStream.class $(OBJ)\exewrap\core\PackInputStream.class $(OBJ)\exewrap\core\ExewrapClassLoader.class $(OBJ)\exewrap\core\URLConnection.class $(OBJ)\exewrap\core\URLStreamHandler.class $(OBJ)\exewrap\core\URLStreamHandlerFactory.class $(OBJ)\util.jar
159163 $(LINK) $(LDFLAGS) /SUBSYSTEM:WINDOWS$(TARGET_VER) /MANIFEST /OUT:$(OBJ)\image_gui.exe $(OBJ)\image_gui.res $(OBJ)\image_gui.obj \
160164 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\notify.obj $(OBJ)\eventlog.obj $(LIBS) $(MSVCRT_PATCH)
161165 $(MT) -manifest $(OBJ)\image_gui.exe.manifest -outputresource:$(OBJ)\image_gui.exe;1
162- $(OBJ)\bindres.exe $(OBJ)\image_gui.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
163- $(OBJ)\bindres.exe $(OBJ)\image_gui.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
164- $(OBJ)\bindres.exe $(OBJ)\image_gui.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
165- $(OBJ)\bindres.exe $(OBJ)\image_gui.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
166- $(OBJ)\bindres.exe $(OBJ)\image_gui.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
167- $(OBJ)\bindres.exe $(OBJ)\image_gui.exe UTIL_JAR $(OBJ)\util.jar
166+ $(OBJ)\bindres.exe $(OBJ)\image_gui.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
167+ $(OBJ)\bindres.exe $(OBJ)\image_gui.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
168+ $(OBJ)\bindres.exe $(OBJ)\image_gui.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
169+ $(OBJ)\bindres.exe $(OBJ)\image_gui.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
170+ $(OBJ)\bindres.exe $(OBJ)\image_gui.exe URL_STREAM_HANDLER_FACTORY $(OBJ)\exewrap\core\URLStreamHandlerFactory.class
171+ $(OBJ)\bindres.exe $(OBJ)\image_gui.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
172+ $(OBJ)\bindres.exe $(OBJ)\image_gui.exe UTIL_JAR $(OBJ)\util.jar
168173
169174 $(OBJ)\image_gui_trace.exe : $(OBJ) $(OBJ)\image_gui.res $(OBJ)\image_gui_trace.obj $(OBJ)\trace.obj \
170175 $(OBJ)\buffer.obj $(OBJ)\hde$(BITS).obj $(OBJ)\hook.obj $(OBJ)\trampoline.obj \
171176 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\notify.obj $(OBJ)\eventlog.obj \
172- $(OBJ)\bindres.exe $(OBJ)\exewrap\core\ByteBufferInputStream.class $(OBJ)\exewrap\core\PackInputStream.class $(OBJ)\exewrap\core\ExewrapClassLoader.class $(OBJ)\exewrap\core\URLConnection.class $(OBJ)\exewrap\core\URLStreamHandler.class $(OBJ)\util.jar
177+ $(OBJ)\bindres.exe $(OBJ)\exewrap\core\ByteBufferInputStream.class $(OBJ)\exewrap\core\PackInputStream.class $(OBJ)\exewrap\core\ExewrapClassLoader.class $(OBJ)\exewrap\core\URLConnection.class $(OBJ)\exewrap\core\URLStreamHandler.class $(OBJ)\exewrap\core\URLStreamHandlerFactory.class $(OBJ)\util.jar
173178 $(LINK) $(LDFLAGS) /SUBSYSTEM:WINDOWS$(TARGET_VER) /MANIFEST /OUT:$(OBJ)\image_gui_trace.exe $(OBJ)\image_gui.res $(OBJ)\image_gui_trace.obj $(OBJ)\trace.obj \
174179 $(OBJ)\buffer.obj $(OBJ)\hde$(BITS).obj $(OBJ)\hook.obj $(OBJ)\trampoline.obj \
175180 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\notify.obj $(OBJ)\eventlog.obj $(LIBS) $(MSVCRT_PATCH)
176181 $(MT) -manifest $(OBJ)\image_gui_trace.exe.manifest -outputresource:$(OBJ)\image_gui_trace.exe;1
177- $(OBJ)\bindres.exe $(OBJ)\image_gui_trace.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
178- $(OBJ)\bindres.exe $(OBJ)\image_gui_trace.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
179- $(OBJ)\bindres.exe $(OBJ)\image_gui_trace.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
180- $(OBJ)\bindres.exe $(OBJ)\image_gui_trace.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
181- $(OBJ)\bindres.exe $(OBJ)\image_gui_trace.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
182- $(OBJ)\bindres.exe $(OBJ)\image_gui_trace.exe UTIL_JAR $(OBJ)\util.jar
182+ $(OBJ)\bindres.exe $(OBJ)\image_gui_trace.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
183+ $(OBJ)\bindres.exe $(OBJ)\image_gui_trace.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
184+ $(OBJ)\bindres.exe $(OBJ)\image_gui_trace.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
185+ $(OBJ)\bindres.exe $(OBJ)\image_gui_trace.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
186+ $(OBJ)\bindres.exe $(OBJ)\image_gui_trace.exe URL_STREAM_HANDLER_FACTORY $(OBJ)\exewrap\core\URLStreamHandlerFactory.class
187+ $(OBJ)\bindres.exe $(OBJ)\image_gui_trace.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
188+ $(OBJ)\bindres.exe $(OBJ)\image_gui_trace.exe UTIL_JAR $(OBJ)\util.jar
183189
184190 $(OBJ)\image_gui.res : $(OBJ) resources\image_gui.rc resources\eventlog.bin
185191 $(RC) /fo$(OBJ)\image_gui.res resources\image_gui.rc
@@ -192,31 +198,33 @@
192198
193199 $(OBJ)\image_service.exe : $(OBJ) $(OBJ)\image_service.res $(OBJ)\image_service.obj \
194200 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\eventlog.obj \
195- $(OBJ)\bindres.exe $(OBJ)\exewrap\core\ByteBufferInputStream.class $(OBJ)\exewrap\core\PackInputStream.class $(OBJ)\exewrap\core\ExewrapClassLoader.class $(OBJ)\exewrap\core\URLConnection.class $(OBJ)\exewrap\core\URLStreamHandler.class $(OBJ)\util.jar
201+ $(OBJ)\bindres.exe $(OBJ)\exewrap\core\ByteBufferInputStream.class $(OBJ)\exewrap\core\PackInputStream.class $(OBJ)\exewrap\core\ExewrapClassLoader.class $(OBJ)\exewrap\core\URLConnection.class $(OBJ)\exewrap\core\URLStreamHandler.class $(OBJ)\exewrap\core\URLStreamHandlerFactory.class $(OBJ)\util.jar
196202 $(LINK) $(LDFLAGS) /SUBSYSTEM:CONSOLE$(TARGET_VER) /MANIFEST /OUT:$(OBJ)\image_service.exe $(OBJ)\image_service.res $(OBJ)\image_service.obj \
197203 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\eventlog.obj $(LIBS) $(MSVCRT_PATCH)
198204 $(MT) -manifest $(OBJ)\image_service.exe.manifest -outputresource:$(OBJ)\image_service.exe;1
199- $(OBJ)\bindres.exe $(OBJ)\image_service.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
200- $(OBJ)\bindres.exe $(OBJ)\image_service.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
201- $(OBJ)\bindres.exe $(OBJ)\image_service.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
202- $(OBJ)\bindres.exe $(OBJ)\image_service.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
203- $(OBJ)\bindres.exe $(OBJ)\image_service.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
204- $(OBJ)\bindres.exe $(OBJ)\image_service.exe UTIL_JAR $(OBJ)\util.jar
205+ $(OBJ)\bindres.exe $(OBJ)\image_service.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
206+ $(OBJ)\bindres.exe $(OBJ)\image_service.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
207+ $(OBJ)\bindres.exe $(OBJ)\image_service.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
208+ $(OBJ)\bindres.exe $(OBJ)\image_service.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
209+ $(OBJ)\bindres.exe $(OBJ)\image_service.exe URL_STREAM_HANDLER_FACTORY $(OBJ)\exewrap\core\URLStreamHandlerFactory.class
210+ $(OBJ)\bindres.exe $(OBJ)\image_service.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
211+ $(OBJ)\bindres.exe $(OBJ)\image_service.exe UTIL_JAR $(OBJ)\util.jar
205212
206213 $(OBJ)\image_service_trace.exe : $(OBJ) $(OBJ)\image_service.res $(OBJ)\image_service_trace.obj $(OBJ)\trace.obj \
207214 $(OBJ)\buffer.obj $(OBJ)\hde$(BITS).obj $(OBJ)\hook.obj $(OBJ)\trampoline.obj \
208215 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\eventlog.obj \
209- $(OBJ)\bindres.exe $(OBJ)\exewrap\core\ByteBufferInputStream.class $(OBJ)\exewrap\core\PackInputStream.class $(OBJ)\exewrap\core\ExewrapClassLoader.class $(OBJ)\exewrap\core\URLConnection.class $(OBJ)\exewrap\core\URLStreamHandler.class $(OBJ)\util.jar
216+ $(OBJ)\bindres.exe $(OBJ)\exewrap\core\ByteBufferInputStream.class $(OBJ)\exewrap\core\PackInputStream.class $(OBJ)\exewrap\core\ExewrapClassLoader.class $(OBJ)\exewrap\core\URLConnection.class $(OBJ)\exewrap\core\URLStreamHandler.class $(OBJ)\exewrap\core\URLStreamHandlerFactory.class $(OBJ)\util.jar
210217 $(LINK) $(LDFLAGS) /SUBSYSTEM:CONSOLE$(TARGET_VER) /MANIFEST /OUT:$(OBJ)\image_service_trace.exe $(OBJ)\image_service.res $(OBJ)\image_service_trace.obj $(OBJ)\trace.obj \
211218 $(OBJ)\buffer.obj $(OBJ)\hde$(BITS).obj $(OBJ)\hook.obj $(OBJ)\trampoline.obj \
212219 $(OBJ)\jvm.obj $(OBJ)\loader.obj $(OBJ)\message.obj $(OBJ)\eventlog.obj $(LIBS) $(MSVCRT_PATCH)
213220 $(MT) -manifest $(OBJ)\image_service_trace.exe.manifest -outputresource:$(OBJ)\image_service_trace.exe;1
214- $(OBJ)\bindres.exe $(OBJ)\image_service_trace.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
215- $(OBJ)\bindres.exe $(OBJ)\image_service_trace.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
216- $(OBJ)\bindres.exe $(OBJ)\image_service_trace.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
217- $(OBJ)\bindres.exe $(OBJ)\image_service_trace.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
218- $(OBJ)\bindres.exe $(OBJ)\image_service_trace.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
219- $(OBJ)\bindres.exe $(OBJ)\image_service_trace.exe UTIL_JAR $(OBJ)\util.jar
221+ $(OBJ)\bindres.exe $(OBJ)\image_service_trace.exe BYTE_BUFFER_INPUT_STREAM $(OBJ)\exewrap\core\ByteBufferInputStream.class
222+ $(OBJ)\bindres.exe $(OBJ)\image_service_trace.exe PACK_INPUT_STREAM $(OBJ)\exewrap\core\PackInputStream.class
223+ $(OBJ)\bindres.exe $(OBJ)\image_service_trace.exe URL_CONNECTION $(OBJ)\exewrap\core\URLConnection.class
224+ $(OBJ)\bindres.exe $(OBJ)\image_service_trace.exe URL_STREAM_HANDLER $(OBJ)\exewrap\core\URLStreamHandler.class
225+ $(OBJ)\bindres.exe $(OBJ)\image_service_trace.exe URL_STREAM_HANDLER_FACTORY $(OBJ)\exewrap\core\URLStreamHandlerFactory.class
226+ $(OBJ)\bindres.exe $(OBJ)\image_service_trace.exe EXEWRAP_CLASS_LOADER $(OBJ)\exewrap\core\ExewrapClassLoader.class
227+ $(OBJ)\bindres.exe $(OBJ)\image_service_trace.exe UTIL_JAR $(OBJ)\util.jar
220228
221229 $(OBJ)\image_service.res : $(OBJ) resources\image_service.rc resources\eventlog.bin
222230 $(RC) /fo$(OBJ)\image_service.res resources\image_service.rc
@@ -290,6 +298,9 @@
290298 $(OBJ)\exewrap\core\URLStreamHandler.class : $(OBJ) java\exewrap\core\URLStreamHandler.java
291299 $(JAVAC) -Xlint:none -source 1.5 -target 1.5 -sourcepath java -d $(OBJ) java\exewrap\core\URLStreamHandler.java
292300
301+$(OBJ)\exewrap\core\URLStreamHandlerFactory.class : $(OBJ) java\exewrap\core\URLStreamHandlerFactory.java
302+ $(JAVAC) -Xlint:none -source 1.5 -target 1.5 -sourcepath java -d $(OBJ) java\exewrap\core\URLStreamHandlerFactory.java
303+
293304 ### exewrap.util
294305
295306 $(OBJ)\util.jar : $(OBJ) $(OBJ)\exewrap\util\EventLogHandler.class $(OBJ)\exewrap\util\EventLogStream.class $(OBJ)\exewrap\util\FileLogStream.class $(OBJ)\exewrap\util\UncaughtExceptionHandler.class $(OBJ)\exewrap\util\ConsoleOutputStream.class $(OBJ)\exewrap\util\Environment.class
--- exewrap/trunk/exewrap/src/exewrap.c (revision 35)
+++ exewrap/trunk/exewrap/src/exewrap.c (revision 36)
@@ -85,7 +85,7 @@
8585
8686 is_trace_version = strstr(exe_file, "trace") != NULL;
8787
88- printf("exewrap 1.1.6 for %s (%d-bit) %s\r\n"
88+ printf("exewrap 1.1.7 for %s (%d-bit) %s\r\n"
8989 "Native executable java application wrapper.\r\n"
9090 "Copyright (C) 2005-2017 HIRUKAWA Ryo. All rights reserved.\r\n"
9191 "\r\n"
@@ -211,11 +211,11 @@
211211 }
212212 else
213213 {
214- target_version = 0x01050000; //default target version 1.5
214+ target_version = get_target_java_runtime_version("1.5"); //default target version 1.5
215215 }
216216 target_version_string = get_target_java_runtime_version_string(target_version, buf);
217- printf("Target: %s (%d.%d.%d.%d)\n", target_version_string + 4, target_version >> 24 & 0xFF, target_version >> 16 & 0xFF, target_version >> 8 & 0xFF, target_version & 0xFF);
218- set_resource(exe_file, "TARGET_VERSION", RT_RCDATA, target_version_string, 4);
217+ printf("Target: %s (%d.%d.%d.%d)\n", target_version_string + 4, target_version >> 25 & 0x7F, target_version >> 18 & 0x7F, target_version >> 11 & 0x7F, target_version & 0x7FF);
218+ set_resource(exe_file, "TARGET_VERSION", RT_RCDATA, target_version_string, (DWORD)(4 + strlen(target_version_string + 4) + 1));
219219
220220 if(opt['2'])
221221 {
@@ -711,6 +711,12 @@
711711 }
712712
713713
714+/*
715+ * major(7bit) 31-25
716+ * minor(7bit) 24-18
717+ * build(7bit) 17-11
718+ * revision(11bit) 10-0
719+ */
714720 static DWORD get_target_java_runtime_version(char* version)
715721 {
716722 char* p = version;
@@ -734,21 +740,40 @@
734740 }
735741 }
736742 }
737- return major << 24 & 0xFF000000 | minor << 16 & 0x00FF0000 | build << 8 & 0x0000FF00 | revision & 0x000000FF;
743+ return major << 25 & 0xFE000000 | minor << 18 & 0x00FC0000 | build << 11 & 0x0000F800 | revision & 0x000007FF;
738744 }
739745 return 0x00000000;
740746 }
741747
742-
748+/*
749+ * major(7bit) 31-25
750+ * minor(7bit) 24-18
751+ * build(7bit) 17-11
752+ * revision(11bit) 10-0
753+ */
743754 static char* get_target_java_runtime_version_string(DWORD version, char* buf)
744755 {
745- DWORD major = version >> 24 & 0xFF;
746- DWORD minor = version >> 16 & 0xFF;
747- DWORD build = version >> 8 & 0xFF;
748- DWORD revision = version & 0xFF;
756+ DWORD major = version >> 25 & 0x7F;
757+ DWORD minor = version >> 18 & 0x7F;
758+ DWORD build = version >> 11 & 0x7F;
759+ DWORD revision = version & 0x7FF;
749760
750761 *(DWORD*)buf = version;
751-
762+
763+ //1.7〜
764+ if (major == 1 && minor >= 7 && build == 0)
765+ {
766+ if(revision == 0)
767+ {
768+ sprintf(buf + 4, "Java %d", minor);
769+ }
770+ else
771+ {
772+ sprintf(buf + 4, "Java %du%d", minor, revision);
773+ }
774+ return buf;
775+ }
776+
752777 //1.5, 1.6
753778 if (major == 1 && (minor == 5 || minor == 6))
754779 {
--- exewrap/trunk/exewrap/src/image_console.c (revision 35)
+++ exewrap/trunk/exewrap/src/image_console.c (revision 36)
@@ -82,7 +82,7 @@
8282 {
8383 char* targetVersionString = (char*)res.buf + 4;
8484 result.msg_id = MSG_ID_ERR_TARGET_VERSION;
85- sprintf(result.msg, _(MSG_ID_ERR_TARGET_VERSION), targetVersionString + 4);
85+ sprintf(result.msg, _(MSG_ID_ERR_TARGET_VERSION), targetVersionString);
8686 OutputMessage(result.msg);
8787 goto EXIT;
8888 }
--- exewrap/trunk/exewrap/src/image_gui.c (revision 35)
+++ exewrap/trunk/exewrap/src/image_gui.c (revision 36)
@@ -134,7 +134,7 @@
134134 {
135135 char* targetVersionString = (char*)res.buf + 4;
136136 result.msg_id = MSG_ID_ERR_TARGET_VERSION;
137- sprintf(result.msg, _(MSG_ID_ERR_TARGET_VERSION), targetVersionString + 4);
137+ sprintf(result.msg, _(MSG_ID_ERR_TARGET_VERSION), targetVersionString);
138138 OutputMessage(result.msg);
139139 goto EXIT;
140140 }
--- exewrap/trunk/exewrap/src/image_service.c (revision 35)
+++ exewrap/trunk/exewrap/src/image_service.c (revision 36)
@@ -109,7 +109,7 @@
109109 {
110110 char* targetVersionString = (char*)res.buf + 4;
111111 result.msg_id = MSG_ID_ERR_TARGET_VERSION;
112- sprintf(result.msg, _(MSG_ID_ERR_TARGET_VERSION), targetVersionString + 4);
112+ sprintf(result.msg, _(MSG_ID_ERR_TARGET_VERSION), targetVersionString);
113113 OutputMessage(result.msg);
114114 goto EXIT;
115115 }
--- exewrap/trunk/exewrap/src/java/exewrap/core/ExewrapClassLoader.java (revision 35)
+++ exewrap/trunk/exewrap/src/java/exewrap/core/ExewrapClassLoader.java (revision 36)
@@ -5,6 +5,11 @@
55 import java.lang.reflect.Field;
66 import java.net.MalformedURLException;
77 import java.net.URL;
8+import java.security.CodeSource;
9+import java.security.PermissionCollection;
10+import java.security.Policy;
11+import java.security.ProtectionDomain;
12+import java.security.cert.Certificate;
813 import java.util.HashMap;
914 import java.util.LinkedList;
1015 import java.util.Map;
@@ -28,6 +33,7 @@
2833 private String implVersion;
2934 private String implVendor;
3035 private URL context;
36+ private ProtectionDomain protectionDomain;
3137
3238 public ExewrapClassLoader(ClassLoader parent, JarInputStream[] inputs) throws MalformedURLException {
3339 super(parent);
@@ -55,7 +61,13 @@
5561 name = "";
5662 }
5763
58- this.context = new URL("jar:file:/" + path.replace('\\', '/') + '/' + name + "!/");
64+ URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory(this));
65+ this.context = new URL("exewrap:file:/" + path.replace('\\', '/') + '/' + name + "!/");
66+
67+ URL url = new URL("file:/" + path.replace('\\', '/') + '/' + name);
68+ CodeSource codesource = new CodeSource(url, (Certificate[])null);
69+ PermissionCollection permissions = Policy.getPolicy().getPermissions(new CodeSource(null, (Certificate[])null));
70+ this.protectionDomain = new ProtectionDomain(codesource, permissions, this, null);
5971 }
6072
6173 public void register() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
@@ -124,7 +136,7 @@
124136 null);
125137 }
126138 }
127- return defineClass(name, bytes, 0, bytes.length);
139+ return defineClass(name, bytes, 0, bytes.length, protectionDomain);
128140 }
129141
130142 protected URL findResource(String name) {
--- exewrap/trunk/exewrap/src/java/exewrap/core/URLConnection.java (revision 35)
+++ exewrap/trunk/exewrap/src/java/exewrap/core/URLConnection.java (revision 36)
@@ -1,6 +1,7 @@
11 package exewrap.core;
22
33 import java.io.ByteArrayInputStream;
4+import java.io.FileNotFoundException;
45 import java.io.IOException;
56 import java.io.InputStream;
67 import java.net.URL;
@@ -16,6 +17,9 @@
1617 }
1718
1819 public void connect() throws IOException {
20+ if(this.buf == null) {
21+ throw new FileNotFoundException("JAR entry " + url);
22+ }
1923 if(this.in != null) {
2024 try { this.in.close(); } catch(Exception ex) {}
2125 }
--- exewrap/trunk/exewrap/src/java/exewrap/core/URLStreamHandler.java (revision 35)
+++ exewrap/trunk/exewrap/src/java/exewrap/core/URLStreamHandler.java (revision 36)
@@ -6,12 +6,30 @@
66 public class URLStreamHandler extends java.net.URLStreamHandler {
77
88 private byte[] buf;
9+ private ClassLoader loader;
910
1011 public URLStreamHandler(byte[] buf) {
1112 this.buf = buf;
1213 }
1314
15+ public URLStreamHandler(ClassLoader loader) {
16+ this.loader = loader;
17+ }
18+
1419 protected java.net.URLConnection openConnection(URL url) throws IOException {
15- return new URLConnection(url, this.buf);
20+ if(this.buf != null) {
21+ return new URLConnection(url, this.buf);
22+ } else if(this.loader != null) {
23+ String s = url.toExternalForm();
24+ int i = s.toLowerCase().indexOf(".exe!/");
25+ if(i >= 0) {
26+ String name = s.substring(i + 6);
27+ URL resource = loader.getResource(name);
28+ if(resource != null) {
29+ return resource.openConnection();
30+ }
31+ }
32+ }
33+ return new URLConnection(url, null);
1634 }
1735 }
--- exewrap/trunk/exewrap/src/java/exewrap/core/URLStreamHandlerFactory.java (nonexistent)
+++ exewrap/trunk/exewrap/src/java/exewrap/core/URLStreamHandlerFactory.java (revision 36)
@@ -0,0 +1,20 @@
1+package exewrap.core;
2+
3+import java.net.URLStreamHandler;
4+
5+public class URLStreamHandlerFactory implements java.net.URLStreamHandlerFactory {
6+
7+ private URLStreamHandler handler;
8+
9+ public URLStreamHandlerFactory(ClassLoader loader) {
10+ this.handler = new exewrap.core.URLStreamHandler(loader);
11+ }
12+
13+ @Override
14+ public URLStreamHandler createURLStreamHandler(String protocol) {
15+ if ("exewrap".equals(protocol)) {
16+ return handler;
17+ }
18+ return null;
19+ }
20+}
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
--- exewrap/trunk/exewrap/src/jvm.c (revision 35)
+++ exewrap/trunk/exewrap/src/jvm.c (revision 36)
@@ -173,6 +173,12 @@
173173 (*jvm)->DetachCurrentThread(jvm);
174174 }
175175
176+/*
177+ * major(7bit) 31-25
178+ * minor(7bit) 24-18
179+ * build(7bit) 17-11
180+ * revision(11bit) 10-0
181+ */
176182 DWORD GetJavaRuntimeVersion()
177183 {
178184 jclass systemClass;
@@ -181,7 +187,7 @@
181187 DWORD major = 0;
182188 DWORD minor = 0;
183189 DWORD build = 0;
184- char* tail;
190+ DWORD revision = 0;
185191
186192 if(javaRuntimeVersion == 0xFFFFFFFF)
187193 {
@@ -192,44 +198,81 @@
192198 if(getPropertyMethod != NULL)
193199 {
194200 version = GetShiftJIS(env, (jstring)((*env)->CallStaticObjectMethod(env, systemClass, getPropertyMethod, GetJString(env, "java.runtime.version"))));
201+ //数字が出てくるまでスキップ
195202 while(*version != '\0' && !('0' <= *version && *version <= '9'))
196203 {
197- while(*version != '\0' && !(*version == ' ' || *version == '\t' || *version == '_' || *version == '-'))
198- {
199- version++;
200- }
201- if(*version == ' ' || *version == '\t' || *version == '_' || *version == '-')
202- {
203- version++;
204- }
204+ version++;
205205 }
206206 if(*version == '\0')
207207 {
208- javaRuntimeVersion = 0;
209- return javaRuntimeVersion;
208+ goto END_PARSE;
210209 }
211- tail = version;
212- while(*tail != '\0' && (*tail == '.' || ('0' <= *tail && *tail <= '9')))
210+ major = atoi(version);
211+
212+ //数字以外が出てくるまでスキップ
213+ while(*version != '\0' && ('0' <= *version && *version <= '9'))
213214 {
214- tail++;
215+ version++;
215216 }
216- major = atoi(version);
217- version = strchr(version, '.');
218- if(version != NULL && version < tail)
217+ if(*version == '\0')
219218 {
220- minor = atoi(++version);
219+ goto END_PARSE;
221220 }
222- version = strchr(version, '.');
223- if(version != NULL && version < tail)
221+ //数字が出てくるまでスキップ
222+ while(*version != '\0' && !('0' <= *version && *version <= '9'))
224223 {
225- build = atoi(++version);
224+ version++;
226225 }
227- javaRuntimeVersion = ((major << 24) & 0xFF000000) | ((minor << 16) & 0x00FF0000) | ((build << 8) & 0x0000FF00);
226+ if(*version == '\0')
227+ {
228+ goto END_PARSE;
229+ }
230+ minor = atoi(version);
231+
232+ //数字以外が出てくるまでスキップ
233+ while(*version != '\0' && ('0' <= *version && *version <= '9'))
234+ {
235+ version++;
236+ }
237+ if(*version == '\0')
238+ {
239+ goto END_PARSE;
240+ }
241+ //数字が出てくるまでスキップ
242+ while(*version != '\0' && !('0' <= *version && *version <= '9'))
243+ {
244+ version++;
245+ }
246+ if(*version == '\0')
247+ {
248+ goto END_PARSE;
249+ }
250+ build = atoi(version);
251+
252+ //数字以外が出てくるまでスキップ
253+ while(*version != '\0' && ('0' <= *version && *version <= '9'))
254+ {
255+ version++;
256+ }
257+ if(*version == '\0')
258+ {
259+ goto END_PARSE;
260+ }
261+ //数字が出てくるまでスキップ
262+ while(*version != '\0' && !('0' <= *version && *version <= '9'))
263+ {
264+ version++;
265+ }
266+ if(*version == '\0')
267+ {
268+ goto END_PARSE;
269+ }
270+ revision = atoi(version);
228271 }
229272 }
230- return javaRuntimeVersion;
273+END_PARSE:
274+ javaRuntimeVersion = ((major << 25) & 0xFE000000) | ((minor << 18) & 0x00FC0000) | ((build << 11) & 0x0000F800) | (revision & 0x000007FF);
231275 }
232- javaRuntimeVersion = 0;
233276 return javaRuntimeVersion;
234277 }
235278
--- exewrap/trunk/exewrap/src/loader.c (revision 35)
+++ exewrap/trunk/exewrap/src/loader.c (revision 36)
@@ -51,6 +51,7 @@
5151 jobjectArray jars;
5252 jclass URLConnection;
5353 jclass URLStreamHandler;
54+ jclass URLStreamHandlerFactory;
5455 jmethodID ExewrapClassLoader_init;
5556 jmethodID exewrapClassLoader_register;
5657 jmethodID exewrapClassLoader_loadUtilities;
@@ -316,6 +317,20 @@
316317 sprintf(result->msg, _(MSG_ID_ERR_DEFINE_CLASS), "exewrap.core.URLStreamHandler");
317318 goto EXIT;
318319 }
320+ // URLStreamHandlerFactory
321+ if (GetResource("URL_STREAM_HANDLER_FACTORY", &res) == NULL)
322+ {
323+ result->msg_id = MSG_ID_ERR_RESOURCE_NOT_FOUND;
324+ sprintf(result->msg, _(MSG_ID_ERR_RESOURCE_NOT_FOUND), "RT_RCDATA: URL_STREAM_HANDLER_FACTORY");
325+ goto EXIT;
326+ }
327+ URLStreamHandlerFactory = (*env)->DefineClass(env, "exewrap/core/URLStreamHandlerFactory", systemClassLoader, res.buf, res.len);
328+ if (URLStreamHandlerFactory == NULL)
329+ {
330+ result->msg_id = MSG_ID_ERR_DEFINE_CLASS;
331+ sprintf(result->msg, _(MSG_ID_ERR_DEFINE_CLASS), "exewrap.core.URLStreamHandlerFactory");
332+ goto EXIT;
333+ }
319334 // ExewrapClassLoader
320335 if (GetResource("EXEWRAP_CLASS_LOADER", &res) == NULL)
321336 {
--- exewrap/trunk/exewrap/src/message.c (revision 35)
+++ exewrap/trunk/exewrap/src/message.c (revision 36)
@@ -80,7 +80,7 @@
8080 "Resource not found: %s";
8181
8282 msg[MSG_ID_COUNT * MSG_LANG_ID_EN + MSG_ID_ERR_TARGET_VERSION] =
83- "Java %s or higher is required to run this program.";
83+ "%s or higher is required to run this program.";
8484
8585 msg[MSG_ID_COUNT * MSG_LANG_ID_EN + MSG_ID_ERR_DEFINE_CLASS] =
8686 "Class not found: %s";
@@ -180,7 +180,7 @@
180180 "リソースが見つかりません: %s";
181181
182182 msg[MSG_ID_COUNT * MSG_LANG_ID_JA + MSG_ID_ERR_TARGET_VERSION] =
183- "このプログラムの実行には Java %s 以上が必要です。";
183+ "このプログラムの実行には%s以上が必要です。";
184184
185185 msg[MSG_ID_COUNT * MSG_LANG_ID_JA + MSG_ID_ERR_DEFINE_CLASS] =
186186 "クラスが見つかりません: %s";
Show on old repository browser