iMsgServer2000.java 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455
  1. /*** Eclipse Class Decompiler plugin, copyright (c) 2016 Chen Chao (cnfree2000@hotmail.com) ***/
  2. package DBstep;
  3. import java.io.ByteArrayInputStream;
  4. import java.io.ByteArrayOutputStream;
  5. import java.io.File;
  6. import java.io.FileInputStream;
  7. import java.io.FileOutputStream;
  8. import java.io.RandomAccessFile;
  9. import java.io.UnsupportedEncodingException;
  10. import javax.servlet.ServletInputStream;
  11. import javax.servlet.ServletOutputStream;
  12. import javax.servlet.ServletRequest;
  13. import javax.servlet.http.HttpServletRequest;
  14. import javax.servlet.http.HttpServletResponse;
  15. public class iMsgServer2000 {
  16. private String _$287 = "DBSTEP V3.0";
  17. private String _$288 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  18. private File _$289;
  19. private String _$290 = new String();
  20. private String _$291 = new String();
  21. private String _$292 = new String();
  22. private int _$293 = 0;
  23. private String _$294;
  24. public int BuffSize = 100;
  25. public boolean CryptFile = false;
  26. public String Charset = "GB2312";
  27. static final int S11 = 7;
  28. static final int S12 = 12;
  29. static final int S13 = 17;
  30. static final int S14 = 22;
  31. static final int S21 = 5;
  32. static final int S22 = 9;
  33. static final int S23 = 14;
  34. static final int S24 = 20;
  35. static final int S31 = 4;
  36. static final int S32 = 11;
  37. static final int S33 = 16;
  38. static final int S34 = 23;
  39. static final int S41 = 6;
  40. static final int S42 = 10;
  41. static final int S43 = 15;
  42. static final int S44 = 21;
  43. static final byte[] PADDING = new byte[] { -128, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  44. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  45. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  46. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  47. private long[] _$315 = new long[4];
  48. private long[] _$316 = new long[2];
  49. private byte[] _$317 = new byte[64];
  50. private String _$318;
  51. private byte[] _$319 = new byte[16];
  52. private String _$320(String inbuf) {
  53. this._$322();
  54. this._$323(inbuf.getBytes(), inbuf.length());
  55. this._$325();
  56. this._$318 = "";
  57. for (int i = 0; i < 16; ++i) {
  58. this._$318 = this._$318 + _$327(this._$319[i]);
  59. }
  60. return this._$318;
  61. }
  62. private void _$322() {
  63. this._$316[0] = 0L;
  64. this._$316[1] = 0L;
  65. this._$315[0] = 1732584193L;
  66. this._$315[1] = 4023233417L;
  67. this._$315[2] = 2562383102L;
  68. this._$315[3] = 271733878L;
  69. }
  70. private long _$328(long x, long y, long z) {
  71. return x & y | ~x & z;
  72. }
  73. private long _$332(long x, long y, long z) {
  74. return x & z | y & ~z;
  75. }
  76. private long _$333(long x, long y, long z) {
  77. return x ^ y ^ z;
  78. }
  79. private long _$334(long x, long y, long z) {
  80. return y ^ (x | ~z);
  81. }
  82. private long _$335(long a, long b, long c, long d, long x, long s, long ac) {
  83. a += this._$328(b, c, d) + x + ac;
  84. a = (long) ((int) a << (int) s | (int) a >>> (int) (32L - s));
  85. a += b;
  86. return a;
  87. }
  88. private long _$342(long a, long b, long c, long d, long x, long s, long ac) {
  89. a += this._$332(b, c, d) + x + ac;
  90. a = (long) ((int) a << (int) s | (int) a >>> (int) (32L - s));
  91. a += b;
  92. return a;
  93. }
  94. private long _$343(long a, long b, long c, long d, long x, long s, long ac) {
  95. a += this._$333(b, c, d) + x + ac;
  96. a = (long) ((int) a << (int) s | (int) a >>> (int) (32L - s));
  97. a += b;
  98. return a;
  99. }
  100. private long _$344(long a, long b, long c, long d, long x, long s, long ac) {
  101. a += this._$334(b, c, d) + x + ac;
  102. a = (long) ((int) a << (int) s | (int) a >>> (int) (32L - s));
  103. a += b;
  104. return a;
  105. }
  106. private void _$323(byte[] inbuf, int inputLen) {
  107. byte[] block = new byte[64];
  108. int index = (int) (this._$316[0] >>> 3) & 63;
  109. if ((this._$316[0] += (long) (inputLen << 3)) < (long) (inputLen << 3)) {
  110. ++this._$316[1];
  111. }
  112. this._$316[1] += (long) (inputLen >>> 29);
  113. int partLen = 64 - index;
  114. int i;
  115. if (inputLen >= partLen) {
  116. this._$349(this._$317, inbuf, index, 0, partLen);
  117. this._$350(this._$317);
  118. for (i = partLen; i + 63 < inputLen; i += 64) {
  119. this._$349(block, inbuf, 0, i, 64);
  120. this._$350(block);
  121. }
  122. index = 0;
  123. } else {
  124. i = 0;
  125. }
  126. this._$349(this._$317, inbuf, index, i, inputLen - i);
  127. }
  128. private void _$325() {
  129. byte[] bits = new byte[8];
  130. this._$353(bits, this._$316, 8);
  131. int index = (int) (this._$316[0] >>> 3) & 63;
  132. int padLen = index < 56 ? 56 - index : 120 - index;
  133. this._$323(PADDING, padLen);
  134. this._$323(bits, 8);
  135. this._$353(this._$319, this._$315, 16);
  136. }
  137. private void _$349(byte[] output, byte[] input, int outpos, int inpos,
  138. int len) {
  139. for (int i = 0; i < len; ++i) {
  140. output[outpos + i] = input[inpos + i];
  141. }
  142. }
  143. private void _$350(byte[] block) {
  144. long a = this._$315[0];
  145. long b = this._$315[1];
  146. long c = this._$315[2];
  147. long d = this._$315[3];
  148. long[] x = new long[16];
  149. this._$359(x, block, 64);
  150. a = this._$335(a, b, c, d, x[0], 7L, 3614090360L);
  151. d = this._$335(d, a, b, c, x[1], 12L, 3905402710L);
  152. c = this._$335(c, d, a, b, x[2], 17L, 606105819L);
  153. b = this._$335(b, c, d, a, x[3], 22L, 3250441966L);
  154. a = this._$335(a, b, c, d, x[4], 7L, 4118548399L);
  155. d = this._$335(d, a, b, c, x[5], 12L, 1200080426L);
  156. c = this._$335(c, d, a, b, x[6], 17L, 2821735955L);
  157. b = this._$335(b, c, d, a, x[7], 22L, 4249261313L);
  158. a = this._$335(a, b, c, d, x[8], 7L, 1770035416L);
  159. d = this._$335(d, a, b, c, x[9], 12L, 2336552879L);
  160. c = this._$335(c, d, a, b, x[10], 17L, 4294925233L);
  161. b = this._$335(b, c, d, a, x[11], 22L, 2304563134L);
  162. a = this._$335(a, b, c, d, x[12], 7L, 1804603682L);
  163. d = this._$335(d, a, b, c, x[13], 12L, 4254626195L);
  164. c = this._$335(c, d, a, b, x[14], 17L, 2792965006L);
  165. b = this._$335(b, c, d, a, x[15], 22L, 1236535329L);
  166. a = this._$342(a, b, c, d, x[1], 5L, 4129170786L);
  167. d = this._$342(d, a, b, c, x[6], 9L, 3225465664L);
  168. c = this._$342(c, d, a, b, x[11], 14L, 643717713L);
  169. b = this._$342(b, c, d, a, x[0], 20L, 3921069994L);
  170. a = this._$342(a, b, c, d, x[5], 5L, 3593408605L);
  171. d = this._$342(d, a, b, c, x[10], 9L, 38016083L);
  172. c = this._$342(c, d, a, b, x[15], 14L, 3634488961L);
  173. b = this._$342(b, c, d, a, x[4], 20L, 3889429448L);
  174. a = this._$342(a, b, c, d, x[9], 5L, 568446438L);
  175. d = this._$342(d, a, b, c, x[14], 9L, 3275163606L);
  176. c = this._$342(c, d, a, b, x[3], 14L, 4107603335L);
  177. b = this._$342(b, c, d, a, x[8], 20L, 1163531501L);
  178. a = this._$342(a, b, c, d, x[13], 5L, 2850285829L);
  179. d = this._$342(d, a, b, c, x[2], 9L, 4243563512L);
  180. c = this._$342(c, d, a, b, x[7], 14L, 1735328473L);
  181. b = this._$342(b, c, d, a, x[12], 20L, 2368359562L);
  182. a = this._$343(a, b, c, d, x[5], 4L, 4294588738L);
  183. d = this._$343(d, a, b, c, x[8], 11L, 2272392833L);
  184. c = this._$343(c, d, a, b, x[11], 16L, 1839030562L);
  185. b = this._$343(b, c, d, a, x[14], 23L, 4259657740L);
  186. a = this._$343(a, b, c, d, x[1], 4L, 2763975236L);
  187. d = this._$343(d, a, b, c, x[4], 11L, 1272893353L);
  188. c = this._$343(c, d, a, b, x[7], 16L, 4139469664L);
  189. b = this._$343(b, c, d, a, x[10], 23L, 3200236656L);
  190. a = this._$343(a, b, c, d, x[13], 4L, 681279174L);
  191. d = this._$343(d, a, b, c, x[0], 11L, 3936430074L);
  192. c = this._$343(c, d, a, b, x[3], 16L, 3572445317L);
  193. b = this._$343(b, c, d, a, x[6], 23L, 76029189L);
  194. a = this._$343(a, b, c, d, x[9], 4L, 3654602809L);
  195. d = this._$343(d, a, b, c, x[12], 11L, 3873151461L);
  196. c = this._$343(c, d, a, b, x[15], 16L, 530742520L);
  197. b = this._$343(b, c, d, a, x[2], 23L, 3299628645L);
  198. a = this._$344(a, b, c, d, x[0], 6L, 4096336452L);
  199. d = this._$344(d, a, b, c, x[7], 10L, 1126891415L);
  200. c = this._$344(c, d, a, b, x[14], 15L, 2878612391L);
  201. b = this._$344(b, c, d, a, x[5], 21L, 4237533241L);
  202. a = this._$344(a, b, c, d, x[12], 6L, 1700485571L);
  203. d = this._$344(d, a, b, c, x[3], 10L, 2399980690L);
  204. c = this._$344(c, d, a, b, x[10], 15L, 4293915773L);
  205. b = this._$344(b, c, d, a, x[1], 21L, 2240044497L);
  206. a = this._$344(a, b, c, d, x[8], 6L, 1873313359L);
  207. d = this._$344(d, a, b, c, x[15], 10L, 4264355552L);
  208. c = this._$344(c, d, a, b, x[6], 15L, 2734768916L);
  209. b = this._$344(b, c, d, a, x[13], 21L, 1309151649L);
  210. a = this._$344(a, b, c, d, x[4], 6L, 4149444226L);
  211. d = this._$344(d, a, b, c, x[11], 10L, 3174756917L);
  212. c = this._$344(c, d, a, b, x[2], 15L, 718787259L);
  213. b = this._$344(b, c, d, a, x[9], 21L, 3951481745L);
  214. this._$315[0] += a;
  215. this._$315[1] += b;
  216. this._$315[2] += c;
  217. this._$315[3] += d;
  218. }
  219. private void _$353(byte[] output, long[] input, int len) {
  220. int i = 0;
  221. for (int j = 0; j < len; j += 4) {
  222. output[j] = (byte) ((int) (input[i] & 255L));
  223. output[j + 1] = (byte) ((int) (input[i] >>> 8 & 255L));
  224. output[j + 2] = (byte) ((int) (input[i] >>> 16 & 255L));
  225. output[j + 3] = (byte) ((int) (input[i] >>> 24 & 255L));
  226. ++i;
  227. }
  228. }
  229. private void _$359(long[] output, byte[] input, int len) {
  230. int i = 0;
  231. for (int j = 0; j < len; j += 4) {
  232. output[i] = _$361(input[j]) | _$361(input[j + 1]) << 8
  233. | _$361(input[j + 2]) << 16 | _$361(input[j + 3]) << 24;
  234. ++i;
  235. }
  236. }
  237. private static long _$361(byte b) {
  238. return b < 0 ? (long) (b & 255) : (long) b;
  239. }
  240. private static String _$327(byte ib) {
  241. char[] Digit = new char[] { '0', '1', '2', '3', '4', '5', '6', '7',
  242. '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
  243. char[] ob = new char[] { Digit[ib >>> 4 & 15], Digit[ib & 15] };
  244. String s = new String(ob);
  245. return s;
  246. }
  247. private String _$365(byte[] Value) {
  248. this._$322();
  249. this._$323(Value, Value.length);
  250. this._$325();
  251. this._$318 = "";
  252. for (int i = 0; i < 16; ++i) {
  253. this._$318 = this._$318 + _$327(this._$319[i]);
  254. }
  255. return this._$318;
  256. }
  257. public iMsgServer2000() {
  258. this._$290 = "";
  259. this._$291 = "";
  260. this._$292 = "DBSTEP V3.0";
  261. try {
  262. this._$289 = File.createTempFile("~GG", ".tmp");
  263. this._$294 = this._$289.getName();
  264. } catch (Exception arg1) {
  265. this._$291 = this._$291 + arg1.toString();
  266. System.out.println(arg1.toString());
  267. }
  268. this._$289.deleteOnExit();
  269. }
  270. protected void finalize() {
  271. try {
  272. if (this._$294.matches(this._$289.getName())) {
  273. this._$289.delete();
  274. }
  275. } catch (Exception arg1) {
  276. this._$291 = this._$291 + arg1.toString();
  277. System.out.println(arg1.toString());
  278. }
  279. }
  280. protected String FormatHead(String vString) {
  281. if (vString.length() > 16) {
  282. return vString.substring(0, 16);
  283. } else {
  284. for (int i = vString.length() + 1; i < 17; ++i) {
  285. vString = vString.concat(" ");
  286. }
  287. return vString;
  288. }
  289. }
  290. private byte[] _$378(byte[] mStream) {
  291. byte HeadSize = 64;
  292. boolean BodySize = false;
  293. boolean ErrorSize = false;
  294. boolean FileSize = false;
  295. byte Position = 0;
  296. int BlockSize = 1024 * this.BuffSize;
  297. byte[] BlockBuf = new byte[BlockSize];
  298. ByteArrayOutputStream mWite = new ByteArrayOutputStream();
  299. boolean CurSize = false;
  300. boolean CurRead = false;
  301. try {
  302. int BodySize1 = this._$290.getBytes(this.Charset).length;
  303. int ErrorSize1 = this._$291.getBytes(this.Charset).length;
  304. int FileSize1 = (int) this._$289.length();
  305. this._$293 = FileSize1;
  306. if (FileSize1 > 0 && !this.CryptFile) {
  307. FileInputStream e = new FileInputStream(this._$289);
  308. for (int CurSize1 = BlockSize; FileSize1 > 0; FileSize1 -= CurSize1) {
  309. if (FileSize1 - BlockSize < BlockSize) {
  310. CurSize1 = FileSize1;
  311. BlockBuf = new byte[FileSize1];
  312. }
  313. for (int CurRead1 = 0; CurRead1 < CurSize1; CurRead1 += e
  314. .read(BlockBuf, CurRead1, CurSize1 - CurRead1)) {
  315. ;
  316. }
  317. mWite.write(BlockBuf, 0, CurSize1);
  318. }
  319. this._$293 = mWite.size();
  320. e.close();
  321. mWite.close();
  322. }
  323. ByteArrayOutputStream e1 = new ByteArrayOutputStream();
  324. String HeadString = this.FormatHead(this._$292)
  325. + this.FormatHead(String.valueOf(BodySize1))
  326. + this.FormatHead(String.valueOf(ErrorSize1))
  327. + this.FormatHead(String.valueOf(this._$293));
  328. e1.write(HeadString.getBytes(), 0, HeadSize);
  329. int Position1 = Position + HeadSize;
  330. if (BodySize1 > 0) {
  331. e1.write(this._$290.getBytes());
  332. }
  333. Position1 += BodySize1;
  334. if (ErrorSize1 > 0) {
  335. e1.write(this._$291.getBytes(this.Charset));
  336. }
  337. int arg9999 = Position1 + ErrorSize1;
  338. if (this._$293 > 0) {
  339. e1.write(mWite.toByteArray());
  340. }
  341. e1.close();
  342. mStream = e1.toByteArray();
  343. return mStream;
  344. } catch (Exception arg13) {
  345. this._$291 = this._$291 + arg13.toString();
  346. System.out.println(arg13.toString());
  347. return null;
  348. }
  349. }
  350. private boolean _$378(HttpServletResponse response) {
  351. byte HeadSize = 64;
  352. boolean BodySize = false;
  353. boolean ErrorSize = false;
  354. boolean FileSize = false;
  355. byte Position = 0;
  356. int BlockSize = 1024 * this.BuffSize;
  357. byte[] BlockBuf = new byte[BlockSize];
  358. ByteArrayOutputStream mWite = new ByteArrayOutputStream();
  359. boolean CurSize = false;
  360. boolean CurRead = false;
  361. try {
  362. ServletOutputStream e = response.getOutputStream();
  363. int BodySize1 = this._$290.getBytes(this.Charset).length;
  364. int ErrorSize1 = this._$291.getBytes(this.Charset).length;
  365. int FileSize1 = (int) this._$289.length();
  366. this._$293 = FileSize1;
  367. if (FileSize1 > 0 && !this.CryptFile) {
  368. FileInputStream mRead = new FileInputStream(this._$289);
  369. for (int CurSize1 = BlockSize; FileSize1 > 0; FileSize1 -= CurSize1) {
  370. if (FileSize1 - BlockSize < BlockSize) {
  371. CurSize1 = FileSize1;
  372. BlockBuf = new byte[FileSize1];
  373. }
  374. for (int CurRead1 = 0; CurRead1 < CurSize1; CurRead1 += mRead
  375. .read(BlockBuf, CurRead1, CurSize1 - CurRead1)) {
  376. ;
  377. }
  378. mWite.write(BlockBuf, 0, CurSize1);
  379. }
  380. this._$293 = mWite.size();
  381. mRead.close();
  382. mWite.close();
  383. }
  384. String HeadString = this.FormatHead(this._$292)
  385. + this.FormatHead(String.valueOf(BodySize1))
  386. + this.FormatHead(String.valueOf(ErrorSize1))
  387. + this.FormatHead(String.valueOf(this._$293));
  388. e.write(HeadString.getBytes());
  389. int Position1 = Position + HeadSize;
  390. if (BodySize1 > 0) {
  391. e.write(this._$290.getBytes());
  392. }
  393. Position1 += BodySize1;
  394. if (ErrorSize1 > 0) {
  395. e.write(this._$291.getBytes(this.Charset));
  396. }
  397. int arg9999 = Position1 + ErrorSize1;
  398. if (this._$293 > 0) {
  399. e.write(mWite.toByteArray());
  400. }
  401. e.flush();
  402. return true;
  403. } catch (Exception arg14) {
  404. this._$291 = this._$291 + arg14.toString();
  405. System.out.println(arg14.toString());
  406. return false;
  407. }
  408. }
  409. public byte[] MsgVariant() {
  410. Object mStream = null;
  411. return this._$378((byte[]) mStream);
  412. }
  413. private static int _$402(byte[] b) {
  414. int s = 0;
  415. for (int i = 3; i > 0; --i) {
  416. if (b[i] >= 0) {
  417. s += b[i];
  418. } else {
  419. s = s + 256 + b[i];
  420. }
  421. s *= 256;
  422. }
  423. if (b[0] >= 0) {
  424. s += b[0];
  425. } else {
  426. s = s + 256 + b[0];
  427. }
  428. return s;
  429. }
  430. public byte[] ToDocument(byte[] Value) {
  431. byte[] mIntBuf = new byte[] { 0, 0, 0, 0 };
  432. byte[] mFlagBuf = new byte[] { 68, 73, 82, 71 };
  433. Object mOutBuf = null;
  434. boolean HeadFlag = false;
  435. boolean Signature = false;
  436. boolean WordSize = false;
  437. boolean PageSize = false;
  438. boolean FlagSize = false;
  439. try {
  440. int HeadFlag1 = _$402(mFlagBuf);
  441. ByteArrayInputStream e = new ByteArrayInputStream(Value);
  442. e.read(mIntBuf, 0, 4);
  443. int Signature1 = _$402(mIntBuf);
  444. e.read(mIntBuf, 0, 4);
  445. int WordSize1 = _$402(mIntBuf);
  446. e.read(mIntBuf, 0, 4);
  447. int PageSize1 = _$402(mIntBuf);
  448. e.read(mIntBuf, 0, 4);
  449. int FlagSize1 = _$402(mIntBuf);
  450. if (Signature1 != HeadFlag1) {
  451. e.reset();
  452. WordSize1 = e.available();
  453. }
  454. byte[] mOutBuf1 = new byte[WordSize1];
  455. e.read(mOutBuf1, 0, WordSize1);
  456. return mOutBuf1;
  457. } catch (Exception arg10) {
  458. this._$291 = this._$291 + arg10.toString();
  459. System.out.println(arg10.toString());
  460. return (byte[]) mOutBuf;
  461. }
  462. }
  463. private boolean _$413(byte[] mStream) {
  464. byte HeadSize = 64;
  465. boolean BodySize = false;
  466. boolean ErrorSize = false;
  467. boolean FileSize = false;
  468. boolean Position = false;
  469. boolean CurRead = false;
  470. String Md5Value = "";
  471. String Md5Calcu = "";
  472. try {
  473. byte Position1 = 0;
  474. String HeadString = new String(mStream, Position1, HeadSize);
  475. this._$292 = HeadString.substring(0, 15);
  476. int BodySize1 = Integer.parseInt(HeadString.substring(16, 31)
  477. .trim());
  478. int ErrorSize1 = Integer.parseInt(HeadString.substring(32, 47)
  479. .trim());
  480. int FileSize1 = Integer.parseInt(HeadString.substring(48, 63)
  481. .trim());
  482. this._$293 = FileSize1;
  483. int Position2 = Position1 + HeadSize;
  484. if (BodySize1 > 0) {
  485. this._$290 = new String(mStream, Position2, BodySize1);
  486. }
  487. Position2 += BodySize1;
  488. if (ErrorSize1 > 0) {
  489. this._$291 = new String(mStream, Position2, ErrorSize1);
  490. }
  491. Position2 += ErrorSize1;
  492. if (FileSize1 > 0) {
  493. if (!this.CryptFile) {
  494. ByteArrayInputStream e = new ByteArrayInputStream(mStream,
  495. Position2, FileSize1);
  496. FileOutputStream mWite = new FileOutputStream(this._$289);
  497. int BlockSize = 1024 * this.BuffSize;
  498. boolean CurSize = false;
  499. byte[] BlockBuf = new byte[BlockSize];
  500. int CurSize1 = BlockSize;
  501. while (true) {
  502. if (FileSize1 <= 0) {
  503. mWite.close();
  504. e.close();
  505. break;
  506. }
  507. if (FileSize1 < BlockSize) {
  508. CurSize1 = FileSize1;
  509. BlockBuf = new byte[FileSize1];
  510. }
  511. for (int CurRead1 = 0; CurRead1 < CurSize1; CurRead1 += e
  512. .read(BlockBuf, CurRead1, CurSize1 - CurRead1)) {
  513. ;
  514. }
  515. mWite.write(BlockBuf, 0, CurSize1);
  516. FileSize1 -= CurSize1;
  517. }
  518. }
  519. this._$293 = (int) this._$289.length();
  520. }
  521. return true;
  522. } catch (Exception arg15) {
  523. this._$291 = this._$291 + arg15.toString();
  524. System.out.println(arg15.toString());
  525. return false;
  526. }
  527. }
  528. private boolean _$413(HttpServletRequest request) {
  529. byte HeadSize = 64;
  530. boolean BodySize = false;
  531. boolean ErrorSize = false;
  532. boolean FileSize = false;
  533. boolean CurRead = false;
  534. try {
  535. ServletInputStream e = request.getInputStream();
  536. byte[] BlockBuf = new byte[HeadSize];
  537. e.read(BlockBuf, 0, HeadSize);
  538. String HeadString = new String(BlockBuf, 0, HeadSize);
  539. this._$292 = HeadString.substring(0, 15);
  540. int BodySize1 = Integer.parseInt(HeadString.substring(16, 31)
  541. .trim());
  542. int ErrorSize1 = Integer.parseInt(HeadString.substring(32, 47)
  543. .trim());
  544. this._$293 = Integer.parseInt(HeadString.substring(48, 63).trim());
  545. int FileSize1 = this._$293;
  546. int CurRead1;
  547. if (BodySize1 > 0) {
  548. BlockBuf = new byte[BodySize1];
  549. for (CurRead1 = 0; CurRead1 < BodySize1; CurRead1 += e.read(
  550. BlockBuf, CurRead1, BodySize1 - CurRead1)) {
  551. ;
  552. }
  553. this._$290 = new String(BlockBuf, 0, BodySize1);
  554. }
  555. if (ErrorSize1 > 0) {
  556. BlockBuf = new byte[ErrorSize1];
  557. e.read(BlockBuf, 0, ErrorSize1);
  558. this._$291 = new String(BlockBuf, 0, ErrorSize1);
  559. }
  560. if (FileSize1 > 0) {
  561. if (!this.CryptFile) {
  562. int BlockSize = 1024 * this.BuffSize;
  563. boolean CurSize = false;
  564. FileOutputStream mWite = new FileOutputStream(this._$289);
  565. BlockBuf = new byte[BlockSize];
  566. int CurSize1 = BlockSize;
  567. while (true) {
  568. if (FileSize1 <= 0) {
  569. mWite.close();
  570. e.close();
  571. break;
  572. }
  573. if (FileSize1 < BlockSize) {
  574. CurSize1 = FileSize1;
  575. BlockBuf = new byte[FileSize1];
  576. }
  577. for (CurRead1 = 0; CurRead1 < CurSize1; CurRead1 += e
  578. .read(BlockBuf, CurRead1, CurSize1 - CurRead1)) {
  579. ;
  580. }
  581. mWite.write(BlockBuf, 0, CurSize1);
  582. FileSize1 -= CurSize1;
  583. }
  584. }
  585. this._$293 = (int) this._$289.length();
  586. }
  587. return true;
  588. } catch (Exception arg12) {
  589. this._$291 = this._$291 + arg12.toString();
  590. System.out.println(arg12.toString());
  591. return false;
  592. }
  593. }
  594. public void MsgVariant(byte[] mStream) {
  595. this._$413(mStream);
  596. }
  597. public boolean SavePackage(String FileName, ServletRequest request) {
  598. byte[] BlockBuf = new byte[1024 * this.BuffSize];
  599. try {
  600. int e = request.getContentLength();
  601. boolean mIndex = false;
  602. ServletInputStream mRead = request.getInputStream();
  603. FileOutputStream mFile;
  604. int mIndex1;
  605. for (mFile = new FileOutputStream(FileName); e > 0; e -= mIndex1) {
  606. mIndex1 = mRead.read(BlockBuf);
  607. mFile.write(BlockBuf, 0, mIndex1);
  608. }
  609. mFile.close();
  610. return true;
  611. } catch (Exception arg7) {
  612. arg7.printStackTrace();
  613. return false;
  614. }
  615. }
  616. public boolean MsgFileSave(String FileName) {
  617. long FileSize = 0L;
  618. int BlockSize = 1024 * this.BuffSize;
  619. FileSize = this._$289.length();
  620. try {
  621. FileOutputStream e = new FileOutputStream(FileName);
  622. FileInputStream mThis = new FileInputStream(this._$289);
  623. int CurSize;
  624. for (byte[] BlockBuf = new byte[BlockSize]; FileSize > 0L; FileSize -= (long) CurSize) {
  625. CurSize = mThis.read(BlockBuf, 0, BlockSize);
  626. e.write(BlockBuf, 0, CurSize);
  627. }
  628. mThis.close();
  629. e.close();
  630. return true;
  631. } catch (Exception arg8) {
  632. this._$291 = this._$291 + arg8.toString();
  633. System.out.println(arg8.toString());
  634. return false;
  635. }
  636. }
  637. public boolean MsgFileLoad(String FileName) {
  638. try {
  639. if (this._$294.matches(this._$289.getName())) {
  640. this._$289.delete();
  641. }
  642. this._$289 = new File(FileName);
  643. this._$293 = (int) this._$289.length();
  644. return true;
  645. } catch (Exception arg2) {
  646. this._$291 = this._$291 + arg2.toString();
  647. System.out.println(arg2.toString());
  648. return false;
  649. }
  650. }
  651. public int FileSizeByName(String FileName) {
  652. try {
  653. File e = new File(FileName);
  654. return (int) e.length();
  655. } catch (Exception arg2) {
  656. this._$291 = this._$291 + arg2.toString();
  657. System.out.println(arg2.toString());
  658. return 0;
  659. }
  660. }
  661. public String MsgTextBody() {
  662. return this._$290;
  663. }
  664. public byte[] MsgFileBody() {
  665. byte[] mBuffer = new byte[this._$293];
  666. try {
  667. FileInputStream e = new FileInputStream(this._$289);
  668. e.read(mBuffer, 0, this._$293);
  669. e.close();
  670. } catch (Exception arg2) {
  671. this._$291 = this._$291 + arg2.toString();
  672. System.out.println(arg2.toString());
  673. }
  674. return mBuffer;
  675. }
  676. public String MsgError() {
  677. return this._$291;
  678. }
  679. public String MsgVersion() {
  680. return this._$292;
  681. }
  682. public void MsgTextBody(String Value) {
  683. this._$290 = Value;
  684. }
  685. public void MsgFileBody(byte[] Value) {
  686. this.MsgFileClear();
  687. try {
  688. FileOutputStream mFile = new FileOutputStream(this._$289);
  689. mFile.write(Value);
  690. mFile.close();
  691. } catch (Exception arg3) {
  692. this._$291 = this._$291 + arg3.toString();
  693. System.out.println(this._$291);
  694. }
  695. this._$293 = Value.length;
  696. }
  697. public void MsgError(String Value) {
  698. this._$291 = Value;
  699. }
  700. public int MsgFileSize() {
  701. return this._$293;
  702. }
  703. public void MsgFileSize(int value) {
  704. this._$293 = value;
  705. }
  706. public void MsgFileClear() {
  707. this._$293 = 0;
  708. if (this._$294.matches(this._$289.getName())) {
  709. this._$289.delete();
  710. }
  711. try {
  712. this._$289 = File.createTempFile("~GG", ".tmp");
  713. this._$294 = this._$289.getName();
  714. } catch (Exception arg1) {
  715. this._$291 = this._$291 + arg1.toString();
  716. System.out.println(arg1.toString());
  717. }
  718. }
  719. public void MsgTextClear() {
  720. this._$290 = "";
  721. }
  722. public void MsgErrorClear() {
  723. this._$291 = "";
  724. }
  725. public String DecodeBase64(String Value) {
  726. ByteArrayOutputStream o = new ByteArrayOutputStream();
  727. String m = "";
  728. byte[] d = new byte[4];
  729. try {
  730. int count = 0;
  731. byte[] x = Value.getBytes();
  732. while (count < x.length) {
  733. for (int n = 0; n <= 3; ++n) {
  734. if (count >= x.length) {
  735. d[n] = 64;
  736. } else {
  737. int y = this._$288.indexOf(x[count]);
  738. if (y < 0) {
  739. y = 65;
  740. }
  741. d[n] = (byte) y;
  742. }
  743. ++count;
  744. }
  745. o.write((byte) (((d[0] & 63) << 2) + ((d[1] & 48) >> 4)));
  746. if (d[2] != 64) {
  747. o.write((byte) (((d[1] & 15) << 4) + ((d[2] & 60) >> 2)));
  748. if (d[3] != 64) {
  749. o.write((byte) (((d[2] & 3) << 6) + (d[3] & 63)));
  750. }
  751. }
  752. }
  753. } catch (StringIndexOutOfBoundsException arg10) {
  754. this._$291 = this._$291 + arg10.toString();
  755. System.out.println(arg10.toString());
  756. }
  757. try {
  758. m = o.toString(this.Charset);
  759. } catch (UnsupportedEncodingException arg9) {
  760. System.out.println(arg9.toString());
  761. }
  762. return m;
  763. }
  764. public String EncodeBase64(String Value) {
  765. ByteArrayOutputStream o = new ByteArrayOutputStream();
  766. byte[] d = new byte[4];
  767. try {
  768. int count = 0;
  769. byte[] x = Value.getBytes(this.Charset);
  770. while (count < x.length) {
  771. byte c = x[count];
  772. ++count;
  773. d[0] = (byte) ((c & 252) >> 2);
  774. d[1] = (byte) ((c & 3) << 4);
  775. if (count < x.length) {
  776. c = x[count];
  777. ++count;
  778. d[1] += (byte) ((c & 240) >> 4);
  779. d[2] = (byte) ((c & 15) << 2);
  780. if (count < x.length) {
  781. c = x[count];
  782. ++count;
  783. d[2] = (byte) (d[2] + ((c & 192) >> 6));
  784. d[3] = (byte) (c & 63);
  785. } else {
  786. d[3] = 64;
  787. }
  788. } else {
  789. d[2] = 64;
  790. d[3] = 64;
  791. }
  792. for (int n = 0; n <= 3; ++n) {
  793. o.write(this._$288.charAt(d[n]));
  794. }
  795. }
  796. } catch (StringIndexOutOfBoundsException arg8) {
  797. this._$291 = this._$291 + arg8.toString();
  798. System.out.println(arg8.toString());
  799. } catch (UnsupportedEncodingException arg9) {
  800. System.out.println(arg9.toString());
  801. }
  802. return o.toString();
  803. }
  804. public int GetFieldCount() {
  805. byte i = 0;
  806. int j = 0;
  807. for (int arg2 = this._$290.indexOf("\r\n", i + 1); arg2 != -1; arg2 = this._$290
  808. .indexOf("\r\n", arg2 + 1)) {
  809. ++j;
  810. }
  811. return j;
  812. }
  813. public String GetFieldName(int Index) {
  814. int i = 0;
  815. int j = 0;
  816. boolean k = false;
  817. boolean n = false;
  818. String mFieldString = "";
  819. String mFieldName = "";
  820. String mReturn = "";
  821. while (i != -1 && j < Index) {
  822. i = this._$290.indexOf("\r\n", i + 1);
  823. if (i != -1) {
  824. ++j;
  825. }
  826. }
  827. int arg8 = this._$290.indexOf("\r\n", i + 1);
  828. if (i != -1 && arg8 != -1) {
  829. if (i == 0) {
  830. mFieldString = this._$290.substring(i, arg8);
  831. } else {
  832. mFieldString = this._$290.substring(i + 2, arg8);
  833. }
  834. int arg9 = mFieldString.indexOf("=", 0);
  835. if (arg9 != -1) {
  836. mFieldName = mFieldString.substring(0, arg9);
  837. mReturn = mFieldName;
  838. }
  839. }
  840. return mReturn;
  841. }
  842. public String GetFieldValue(int Index) {
  843. int i = 0;
  844. int j = 0;
  845. boolean k = false;
  846. boolean n = false;
  847. String mFieldString = "";
  848. String mFieldValue = "";
  849. String mReturn = "";
  850. while (i != -1 && j < Index) {
  851. i = this._$290.indexOf("\r\n", i + 1);
  852. if (i != -1) {
  853. ++j;
  854. }
  855. }
  856. int arg8 = this._$290.indexOf("\r\n", i + 1);
  857. if (i != -1 && arg8 != -1) {
  858. if (i == 0) {
  859. mFieldString = this._$290.substring(i, arg8);
  860. } else {
  861. mFieldString = this._$290.substring(i + 2, arg8);
  862. }
  863. int arg9 = mFieldString.indexOf("=", 0);
  864. if (arg9 != -1) {
  865. mFieldValue = mFieldString.substring(arg9 + 1,
  866. mFieldString.length());
  867. mReturn = this.DecodeBase64(mFieldValue);
  868. }
  869. }
  870. return mReturn;
  871. }
  872. public String GetFieldText() {
  873. return this._$290.toString();
  874. }
  875. public String GetMsgByName(String FieldName) {
  876. boolean i = false;
  877. boolean j = false;
  878. String mReturn = "";
  879. String mFieldName = FieldName.trim().concat("=");
  880. int i1 = this._$290.indexOf(mFieldName);
  881. if (i1 != -1) {
  882. int j1 = this._$290.indexOf("\r\n", i1 + 1);
  883. i1 += mFieldName.length();
  884. if (j1 != -1) {
  885. String mFieldValue = this._$290.substring(i1, j1);
  886. mReturn = this.DecodeBase64(mFieldValue);
  887. return mReturn;
  888. } else {
  889. return mReturn;
  890. }
  891. } else {
  892. return mReturn;
  893. }
  894. }
  895. public void SetMsgByName(String FieldName, String FieldValue) {
  896. String mFieldText = "";
  897. String mFieldHead = "";
  898. String mFieldNill = "";
  899. boolean i = false;
  900. boolean j = false;
  901. boolean f = false;
  902. String mFieldName = FieldName.trim().concat("=");
  903. String mFieldValue = this.EncodeBase64(FieldValue);
  904. mFieldText = mFieldName + mFieldValue + "\r\n";
  905. int i1 = this._$290.indexOf(mFieldName);
  906. if (i1 != -1) {
  907. int j1 = this._$290.indexOf("\r\n", i1 + 1);
  908. if (j1 != -1) {
  909. mFieldHead = this._$290.substring(0, i1);
  910. mFieldNill = this._$290.substring(j1 + 2);
  911. f = true;
  912. }
  913. }
  914. if (f) {
  915. this._$290 = mFieldHead + mFieldText + mFieldNill;
  916. } else {
  917. this._$290 = this._$290.concat(mFieldText);
  918. }
  919. }
  920. public boolean MakeDirectory(String FilePath) {
  921. File mFile = new File(FilePath);
  922. mFile.mkdirs();
  923. return mFile.isDirectory();
  924. }
  925. public boolean MKDirectory(String FilePath) {
  926. File mFile = new File(FilePath);
  927. mFile.mkdirs();
  928. return mFile.isDirectory();
  929. }
  930. public boolean RMDirectory(String FilePath) {
  931. File mFile = new File(FilePath);
  932. if (mFile.isDirectory()) {
  933. mFile.delete();
  934. }
  935. return true;
  936. }
  937. public boolean DelFile(String FileName) {
  938. File mFile = new File(FileName);
  939. if (mFile.exists()) {
  940. mFile.delete();
  941. }
  942. return true;
  943. }
  944. public boolean DelTree(String FilePath) {
  945. File mFile = new File(FilePath);
  946. if (mFile.isDirectory()) {
  947. mFile.delete();
  948. }
  949. return true;
  950. }
  951. public int LoadFilePoint(String FileName) {
  952. boolean i = false;
  953. boolean j = false;
  954. boolean mSize = false;
  955. String mText = "";
  956. String mReturn = "-1";
  957. String mFieldName = "INDEX=";
  958. try {
  959. File e = new File(FileName + ".fp");
  960. int mSize1 = (int) e.length();
  961. byte[] mBuffer = new byte[mSize1];
  962. FileInputStream mStream = new FileInputStream(e);
  963. mStream.read(mBuffer, 0, mSize1);
  964. mStream.close();
  965. mText = new String(mBuffer);
  966. } catch (Exception arg10) {
  967. this._$291 = this._$291 + arg10.toString();
  968. return Integer.parseInt(mReturn);
  969. }
  970. int i1 = mText.indexOf(mFieldName);
  971. if (i1 != -1) {
  972. int j1 = mText.indexOf("\r\n", i1 + 1);
  973. i1 += mFieldName.length();
  974. if (j1 != -1) {
  975. mReturn = mText.substring(i1, j1 - i1);
  976. return Integer.parseInt(mReturn);
  977. } else {
  978. return Integer.parseInt(mReturn);
  979. }
  980. } else {
  981. return Integer.parseInt(mReturn);
  982. }
  983. }
  984. public boolean SaveFilePoint(String FileName, int FCount) {
  985. boolean i = false;
  986. boolean j = false;
  987. boolean mSize = false;
  988. String mFieldName = "INDEX=";
  989. String mCount = "";
  990. try {
  991. FileOutputStream e = new FileOutputStream(FileName);
  992. mCount = mFieldName + FCount + "\r\n";
  993. byte[] mBuffer = mCount.getBytes();
  994. int mSize1 = mBuffer.length;
  995. e.write(mBuffer, 0, mSize1);
  996. e.close();
  997. return true;
  998. } catch (Exception arg9) {
  999. this._$291 = this._$291 + arg9.toString();
  1000. System.out.println("SaveFilePoint:" + this._$291);
  1001. return false;
  1002. }
  1003. }
  1004. public boolean LoadStreamFromFile(String FileName, int Index) {
  1005. boolean mPosition = false;
  1006. boolean mSize = false;
  1007. boolean mLength = false;
  1008. try {
  1009. File mLocal = new File(FileName);
  1010. int mSize1 = (int) mLocal.length();
  1011. FileInputStream mFile = new FileInputStream(mLocal);
  1012. FileOutputStream e = new FileOutputStream(this._$289);
  1013. int mPosition1 = Index * this.BuffSize * 1024;
  1014. int mLength1;
  1015. if (mPosition1 + this.BuffSize * 1024 < mSize1) {
  1016. mLength1 = this.BuffSize * 1024;
  1017. } else {
  1018. mLength1 = mSize1 - mPosition1;
  1019. }
  1020. mFile.skip((long) mPosition1);
  1021. byte[] mBuffer = new byte[mLength1];
  1022. mFile.read(mBuffer);
  1023. mFile.close();
  1024. e.write(mBuffer);
  1025. e.close();
  1026. return true;
  1027. } catch (Exception arg9) {
  1028. this._$291 = this._$291 + arg9.toString();
  1029. System.out.println("LoadStreamFromFile:" + this._$291);
  1030. return false;
  1031. }
  1032. }
  1033. public boolean SaveStreamToFile(String FileName, int Index) {
  1034. if (Index == 0) {
  1035. this.DelFile(FileName);
  1036. }
  1037. try {
  1038. RandomAccessFile mFile = new RandomAccessFile(FileName, "rw");
  1039. FileInputStream e = new FileInputStream(this._$289);
  1040. byte[] mBuffer = new byte[this._$293];
  1041. e.read(mBuffer);
  1042. e.close();
  1043. mFile.seek(mFile.length());
  1044. mFile.write(mBuffer);
  1045. mFile.close();
  1046. return true;
  1047. } catch (Exception arg5) {
  1048. this._$291 = this._$291 + arg5.toString();
  1049. System.out.println("SaveStreamToFile:" + this._$291);
  1050. return false;
  1051. }
  1052. }
  1053. public boolean SaveFromStream(String FileName, int Index) {
  1054. if (Index == 0) {
  1055. this.DelFile(FileName);
  1056. }
  1057. try {
  1058. RandomAccessFile mFile = new RandomAccessFile(FileName, "rw");
  1059. FileInputStream e = new FileInputStream(this._$289);
  1060. byte[] mBuffer = new byte[this._$293];
  1061. e.read(mBuffer);
  1062. e.close();
  1063. mFile.seek(mFile.length());
  1064. mFile.write(mBuffer);
  1065. mFile.close();
  1066. return true;
  1067. } catch (Exception arg5) {
  1068. this._$291 = this._$291 + arg5.toString();
  1069. System.out.println("SaveFromStream:" + this._$291);
  1070. return false;
  1071. }
  1072. }
  1073. public boolean DecodeBase64ToFile(String Value, String FileName) {
  1074. ByteArrayOutputStream o = new ByteArrayOutputStream();
  1075. boolean mResult = false;
  1076. byte[] d = new byte[4];
  1077. try {
  1078. int count = 0;
  1079. byte[] x = Value.getBytes();
  1080. while (count < x.length) {
  1081. for (int n = 0; n <= 3; ++n) {
  1082. if (count >= x.length) {
  1083. d[n] = 64;
  1084. } else {
  1085. int y = this._$288.indexOf(x[count]);
  1086. if (y < 0) {
  1087. y = 65;
  1088. }
  1089. d[n] = (byte) y;
  1090. }
  1091. ++count;
  1092. }
  1093. o.write((byte) (((d[0] & 63) << 2) + ((d[1] & 48) >> 4)));
  1094. if (d[2] != 64) {
  1095. o.write((byte) (((d[1] & 15) << 4) + ((d[2] & 60) >> 2)));
  1096. if (d[3] != 64) {
  1097. o.write((byte) (((d[2] & 3) << 6) + (d[3] & 63)));
  1098. }
  1099. }
  1100. }
  1101. FileOutputStream e = new FileOutputStream(FileName);
  1102. byte[] mBuffer = o.toByteArray();
  1103. int mSize = mBuffer.length;
  1104. e.write(mBuffer, 0, mSize);
  1105. e.close();
  1106. mResult = true;
  1107. } catch (Exception arg12) {
  1108. this._$291 = this._$291 + arg12.toString();
  1109. mResult = false;
  1110. System.out.println(arg12.toString());
  1111. }
  1112. return mResult;
  1113. }
  1114. public boolean SaveFromFile(String FileName, int FileCount) {
  1115. boolean mIndex = false;
  1116. String mPkName = "";
  1117. mPkName = FileName + ".fp";
  1118. this.DelFile(mPkName);
  1119. try {
  1120. FileOutputStream mFile = new FileOutputStream(FileName);
  1121. for (int arg10 = 0; arg10 <= FileCount; ++arg10) {
  1122. mPkName = FileName + "." + arg10;
  1123. File nTemp = new File(mPkName);
  1124. FileInputStream mTemp = new FileInputStream(nTemp);
  1125. byte[] mBuffer = new byte[(int) nTemp.length()];
  1126. mTemp.read(mBuffer, 0, (int) nTemp.length());
  1127. mFile.write(mBuffer, 0, (int) nTemp.length());
  1128. mTemp.close();
  1129. nTemp.delete();
  1130. }
  1131. mFile.close();
  1132. return true;
  1133. } catch (Exception arg9) {
  1134. this._$291 = this._$291 + arg9.toString();
  1135. System.out.println("SaveFromFile:" + this._$291);
  1136. return false;
  1137. }
  1138. }
  1139. public void Load(HttpServletRequest request) {
  1140. this.Charset = request.getHeader("charset");
  1141. if (this.Charset == null) {
  1142. this.Charset = "GB2312";
  1143. }
  1144. if (!this._$413(request)) {
  1145. System.out.println("StreamToMsg Error");
  1146. }
  1147. }
  1148. public void Send(HttpServletResponse response) {
  1149. if (!this._$378(response)) {
  1150. System.out.println("MsgToStream Error");
  1151. }
  1152. try {
  1153. if (this._$294.matches(this._$289.getName())) {
  1154. this._$289.delete();
  1155. }
  1156. } catch (Exception arg2) {
  1157. this._$291 = this._$291 + arg2.toString();
  1158. System.out.println(arg2.toString());
  1159. }
  1160. }
  1161. public byte[] ReadPackage(HttpServletRequest request) {
  1162. byte[] mStream = null;
  1163. int totalRead = 0;
  1164. boolean readBytes = false;
  1165. boolean totalBytes = false;
  1166. this.Charset = request.getHeader("charset");
  1167. if (this.Charset == null) {
  1168. this.Charset = "GB2312";
  1169. }
  1170. try {
  1171. int totalBytes1 = request.getContentLength();
  1172. int readBytes1;
  1173. for (mStream = new byte[totalBytes1]; totalRead < totalBytes1; totalRead += readBytes1) {
  1174. readBytes1 = request.getInputStream().read(mStream, totalRead,
  1175. totalBytes1 - totalRead);
  1176. }
  1177. this.MsgVariant(mStream);
  1178. } catch (Exception arg6) {
  1179. System.out.println("ReadPackage:" + arg6.toString());
  1180. }
  1181. return mStream;
  1182. }
  1183. public void SendPackage(HttpServletResponse response) {
  1184. try {
  1185. ServletOutputStream e = response.getOutputStream();
  1186. e.write(this.MsgVariant());
  1187. e.flush();
  1188. e.close();
  1189. } catch (Exception arg2) {
  1190. System.out.println("SendPackage:" + arg2.toString());
  1191. }
  1192. }
  1193. public static String Version() {
  1194. return "8,1,0,12";
  1195. }
  1196. public static String Version(String SoftwareName) {
  1197. String mVersion = "0,0,0,0";
  1198. if (SoftwareName.equalsIgnoreCase("HandWrite")
  1199. || SoftwareName.equalsIgnoreCase("")) {
  1200. mVersion = "4,0,0,8";
  1201. }
  1202. if (SoftwareName.equalsIgnoreCase("iWebSignature")) {
  1203. mVersion = "5,8,0,0";
  1204. }
  1205. return mVersion;
  1206. }
  1207. public static String VersionEx() {
  1208. return "高级版本";
  1209. }
  1210. public static String VersionEx(String SoftwareName) {
  1211. String mVersionEx = "错误版本";
  1212. if (SoftwareName.equalsIgnoreCase("HandWrite")
  1213. || SoftwareName.equalsIgnoreCase("")) {
  1214. mVersionEx = "高级版本";
  1215. }
  1216. if (SoftwareName.equalsIgnoreCase("iWebSignature")) {
  1217. mVersionEx = "标准版本";
  1218. }
  1219. return mVersionEx;
  1220. }
  1221. public static String CopyRight(String SoftwareName) {
  1222. String mVersionEx = "错误版本";
  1223. if (SoftwareName.equalsIgnoreCase("HandWrite")
  1224. || SoftwareName.equalsIgnoreCase("")) {
  1225. mVersionEx = "高级版本 江西金格科技股份有限公司,所权所有";
  1226. }
  1227. if (SoftwareName.equalsIgnoreCase("iWebSignature")) {
  1228. mVersionEx = "标准版本 江西金格科技股份有限公司,所权所有";
  1229. }
  1230. return mVersionEx;
  1231. }
  1232. public static String VersionDesc() {
  1233. String mVersionDesc = "www.kinggrid.com KingGrid-iMsgServer2000";
  1234. return mVersionDesc;
  1235. }
  1236. public static String ProdDesc() {
  1237. String mProdDescX = " 金格科技自主创新开发的实时安全传输技术——DBPacketTM通讯协议包,采用前端和后端方式设计,实现客户端与服务器端的数据安全可靠传递、交互。金格科技是专注于“可信应用软件”研究与开发的自主创新型高新技术企业,凭借完全自主创新的核心技术和强大的研发力量,为社会提供安全可靠的可信应用软件产品、技术和服务,日益成长为中国可信应用产业的积极推动者和可信应用软件领域的领军企业。";
  1238. String mProdDesc = "Kinggrid:iWebOffice2000/iWebOffice2003/iWebOffice2003/iWebOffice2009/iWebOffice2012/";
  1239. mProdDesc = mProdDesc
  1240. + "iWebRevision/iWebPDF/iWebPicture/iWebFile2005/iWebBarcode/";
  1241. mProdDesc = mProdDesc + "iSignature/iSolutions";
  1242. return mProdDesc;
  1243. }
  1244. }