⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 t.java

📁 webviwer,一个基于j2me的浏览器
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 

import java.io.*;
import java.util.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.rms.InvalidRecordIDException;
import javax.microedition.rms.RecordStore;

class t
    implements Runnable
{

    private String A;
    private String p;
    private boolean B;
    private int r;
    private int o;
    private l j;
    private String l;
    private String y;
    private String c;
    private String e;
    private q u[];
    private String d;
    private String k;
    private boolean x;
    private volatile boolean z;
    private int t;
    private int q;
    private int w;
    private String i;
    private Vector a;
    private Vector C;
    private Hashtable n;
    private int h;
    private int g;
    private Stack s;
    private Font m;
    private int v;
    private int b;
    private byte f;

    t(l l1, String s1, String s2, String s3, q aq[], String s4, String s5, 
            boolean flag, Vector vector, Vector vector1, Hashtable hashtable)
    {
        z = false;
        t = 0;
        q = 0;
        w = 1;
        i = "Contacting server";
        h = 0;
        g = 0;
        v = 0;
        f = 0;
        j = l1;
        l = s1;
        c = s2;
        e = s3;
        u = aq;
        d = s4;
        k = s5;
        x = flag;
        a = vector;
        C = vector1;
        n = hashtable;
        A = l1.b;
        p = l1.N;
        B = l1.W;
        r = l1.aa;
        o = l1.B;
        m = l1.ag;
        b = m.getHeight();
    }

    void d()
    {
        z = true;
    }

    static String c(String s1)
    {
        int i1 = s1.indexOf(37);
        if(i1 < 0)
            return s1;
        StringBuffer stringbuffer = new StringBuffer();
        for(int j1 = 0; j1 < s1.length(); j1++)
        {
            char c1 = s1.charAt(j1);
            if(c1 == '%' && j1 + 2 < s1.length())
                try
                {
                    stringbuffer.append((char)Integer.parseInt(s1.substring(j1 + 1, j1 + 3), 16));
                    j1 += 2;
                    continue;
                }
                catch(NumberFormatException numberformatexception) { }
            stringbuffer.append(c1);
        }

        return stringbuffer.toString();
    }

    private String a(String s1)
    {
        int i1 = s1.indexOf("JSESSIONID=");
        if(i1 == -1)
            return null;
        int j1 = s1.indexOf(59, i1);
        if(j1 == -1)
            return s1.substring(i1 + 11);
        else
            return s1.substring(i1 + 11, j1);
    }

    private boolean d(String s1)
    {
        s1 = s1.toLowerCase();
        if(s1.startsWith("ocr:"))
            s1 = s1.substring(4);
        if(s1.startsWith("fullsize:"))
            s1 = s1.substring(9);
        return s1.startsWith("https:");
    }

    public void run()
    {
        HttpConnection httpconnection;
        Object obj;
        OutputStreamWriter outputstreamwriter;
        httpconnection = null;
        obj = null;
        outputstreamwriter = null;
        int i1;
        String s1;
        i1 = l.indexOf(35);
        if(i1 >= 0)
        {
            y = l.substring(i1 + 1);
            l = l.substring(0, i1);
        }
        s1 = l;
        Object obj2 = null;
        boolean flag = false;
        byte byte1 = -1;
        i1 = 0;
_L12:
        boolean flag1;
        if(i1 > 6)
            throw new IOException();
        if(i1 == 0)
            a(1, 0, ((Throwable) (null)));
        flag1 = d(l);
        String s2 = flag1 ? j.x : j.z;
        try
        {
            httpconnection = (HttpConnection)Connector.open(s2);
        }
        catch(ConnectionNotFoundException connectionnotfoundexception)
        {
            if(flag1)
                throw new ConnectionNotFoundException("This resource requires a secure connection, which is not supported by your device");
            else
                throw connectionnotfoundexception;
        }
        httpconnection.setRequestMethod("POST");
        if(j.Q == 1)
            httpconnection.setRequestProperty("Connection", "close");
        String s3 = j.T;
        if(s3 != null)
            httpconnection.setRequestProperty("Cookie", "JSESSIONID=" + s3);
        httpconnection.setRequestProperty("Content-Type", "text/xml");
        httpconnection.setRequestProperty("Accept", "application/xml");
        Thread.yield();
        if(!z) goto _L2; else goto _L1
_L1:
        try
        {
            if(obj != null)
                ((InputStream) (obj)).close();
            if(outputstreamwriter != null)
                outputstreamwriter.close();
            if(httpconnection != null)
                httpconnection.close();
        }
        catch(IOException ioexception) { }
        j.repaint(0, 0, r, o);
        return;
_L2:
        outputstreamwriter = new OutputStreamWriter(httpconnection.openOutputStream());
        outputstreamwriter.write("<req vid=\"212\" ver=\"3.5");
        if(j.q != null)
            outputstreamwriter.write("\" c=\"" + j.q);
        if(flag1 && j.ad != null)
            outputstreamwriter.write("\" s=\"" + j.ad);
        if(A != null)
            outputstreamwriter.write("\" u=\"" + a(A, true));
        if(p != null)
            outputstreamwriter.write("\" l=\"" + a(p, true));
        outputstreamwriter.write("\"><uri");
        if(k != null)
            outputstreamwriter.write(" ref=\"" + a(k, true) + '"');
        if(x)
            outputstreamwriter.write(" noCache=\"1\"");
        outputstreamwriter.write('>' + a(l, false) + "</uri>" + "<display width=\"" + r + "\" height=\"" + o + "\" images=\"" + B + "\" cookies=\"" + (short)j.a + "\" isColor=\"" + j.F + "\" numColors=\"" + j.C);
        l = null;
        if(j.e > 0)
            outputstreamwriter.write("\" l=\"" + j.e);
        if(j.v && j.C > 16)
            outputstreamwriter.write("\" i=\"j");
        outputstreamwriter.write("\"/>");
        if(u != null)
        {
            outputstreamwriter.write("<f");
            if(c != null)
            {
                outputstreamwriter.write(" method=\"" + a(c, true) + '"');
                c = null;
            }
            if(e != null)
            {
                outputstreamwriter.write(" enctype=\"" + a(e, true) + '"');
                e = null;
            }
            if(d != null)
                outputstreamwriter.write(" charset=\"" + a(d, true) + '"');
            outputstreamwriter.write(62);
            for(int j2 = 0; j2 < u.length; j2++)
            {
                outputstreamwriter.write("<nv n=\"");
                outputstreamwriter.write(a(u[j2].a, true));
                outputstreamwriter.write("\" v=\"");
                outputstreamwriter.write(a(u[j2].b, true));
                outputstreamwriter.write("\"/>");
            }

            u = null;
            outputstreamwriter.write("</f>");
        }
        outputstreamwriter.write("</req>");
        outputstreamwriter.close();
        Thread.yield();
        if(!z) goto _L4; else goto _L3
_L3:
        try
        {
            if(obj != null)
                ((InputStream) (obj)).close();
            if(outputstreamwriter != null)
                outputstreamwriter.close();
            if(httpconnection != null)
                httpconnection.close();
        }
        catch(IOException ioexception1) { }
        j.repaint(0, 0, r, o);
        return;
_L4:
        DataInputStream datainputstream;
        int j1;
        if(i1 == 0)
        {
            a(1, 100, ((Throwable) (null)));
            i = "Waiting for reply";
            a(2, 0, ((Throwable) (null)));
        }
        obj = httpconnection.openInputStream();
        String s4 = httpconnection.getHeaderField("Set-Cookie");
        if(s4 != null)
            j.T = a(s4);
        j1 = (int)httpconnection.getLength();
        if(!"application/xml".equals(httpconnection.getType()))
            throw new IOException("Unexpected server response: " + httpconnection.getResponseCode() + ' ' + httpconnection.getResponseMessage() + "; " + httpconnection.getType());
        if(j.Q == 5 || j.Q == 6)
        {
            ByteArrayInputStream bytearrayinputstream = new ByteArrayInputStream(a(((InputStream) (obj)), j1, 2));
            ((InputStream) (obj)).close();
            httpconnection.close();
            obj = bytearrayinputstream;
        }
        if(j.Q == 3 || j.Q == 4)
            datainputstream = new DataInputStream(new r(((InputStream) (obj)), j.Q));
        else
            datainputstream = new DataInputStream(((InputStream) (obj)));
_L9:
        Thread.yield();
        if(!z) goto _L6; else goto _L5
_L5:
        try
        {
            if(obj != null)
                ((InputStream) (obj)).close();
            if(outputstreamwriter != null)
                outputstreamwriter.close();
            if(httpconnection != null)
                httpconnection.close();
        }
        catch(IOException ioexception2) { }
        j.repaint(0, 0, r, o);
        return;
_L6:
        byte byte0;
        byte0 = datainputstream.readByte();
        if(byte0 < 0)
            break MISSING_BLOCK_LABEL_1691;
        if(byte0 != 0) goto _L8; else goto _L7
_L7:
        s1 = datainputstream.readUTF();
        if(y != null)
            s1 = s1 + '#' + y;
        j.o = s1;
          goto _L9
_L8:
        if(byte0 != 1) goto _L11; else goto _L10
_L10:
        String s5;
        RecordStore recordstore;
        s5 = datainputstream.readUTF();
        recordstore = null;
        recordstore = RecordStore.openRecordStore("slientID", true);
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        DataOutputStream dataoutputstream = new DataOutputStream(bytearrayoutputstream);
        dataoutputstream.writeUTF(s5);
        dataoutputstream.flush();
        byte abyte0[] = bytearrayoutputstream.toByteArray();
        try
        {
            recordstore.setRecord(1, abyte0, 0, abyte0.length);
        }
        catch(InvalidRecordIDException invalidrecordidexception)
        {
            recordstore.addRecord(abyte0, 0, abyte0.length);
        }
        j.q = s5;
        if(s5.length() > 0 && s5.charAt(0) == '$')
        {
            this;
            l.V = true;
            j.removeCommand(WebViewer.y);
        }
        if(recordstore != null)
            try
            {
                recordstore.closeRecordStore();
            }
            catch(Exception exception2) { }
          goto _L9
        Exception exception;
        exception;
        if(recordstore != null)
            try
            {
                recordstore.closeRecordStore();
            }
            catch(Exception exception3) { }
          goto _L9
        Exception exception1;
        exception1;
        if(recordstore != null)
            try
            {
                recordstore.closeRecordStore();
            }
            catch(Exception exception4) { }
        throw exception1;
_L11:
        if(byte0 == 2)
            j.ad = datainputstream.readUTF();
        else
        if(byte0 == 3)
            l = datainputstream.readUTF();
          goto _L9
        if(l == null)
            break MISSING_BLOCK_LABEL_1731;
        if(i1 == 1)
            a(2, 50, ((Throwable) (null)));
        ((InputStream) (obj)).close();
        httpconnection.close();
        i1++;
          goto _L12
        int i2;
        a(2, 100, ((Throwable) (null)));
        if(byte0 != -1)
            break MISSING_BLOCK_LABEL_2214;
        int k1 = datainputstream.readInt();
        t = datainputstream.readUnsignedShort();
        if(k1 > 0)
        {
            s1 = null;
            i = "Loading text - " + (k1 / 1024 + 1) + 'K';
            if(l.D.stringWidth(i) >= r - 2)
                i = "Text - " + (k1 / 1024 + 1) + 'K';
            a(new r(((InputStream) (obj)), j.Q), k1);
        } else
        {
            i = "Loading text";
            a(16, 100, ((Throwable) (null)));
            j.E = s1 != null && s1.startsWith("fullsize:");
        }
        if(t > 0 && j1 >= 0)
        {
            i = "Loading images - " + ((j1 - k1) / 1024 + 1) + 'K';
            if(l.D.stringWidth(i) >= r - 2)
                i = "Images - " + ((j1 - k1) / 1024 + 1) + 'K';
        } else
        {
            i = "Loading images";
        }
        i2 = 0;
          goto _L13
_L17:
        a(64, (i2++ * 100) / t, ((Throwable) (null)));
        Thread.yield();
        if(!z) goto _L15; else goto _L14
_L14:
        try
        {
            if(obj != null)
                ((InputStream) (obj)).close();
            if(outputstreamwriter != null)
                outputstreamwriter.close();
            if(httpconnection != null)
                httpconnection.close();
        }
        catch(IOException ioexception3) { }
        j.repaint(0, 0, r, o);
        return;
_L15:
        int l1 = datainputstream.readInt();
        if(s1 != null)
            a(((InputStream) (obj)), s1, l1, true);
        else
            a(((InputStream) (obj)), datainputstream.readUTF(), l1, t == 1);
_L13:
        if(i2 < t) goto _L17; else goto _L16
_L16:
        if(w != 64 || q != 100)
            a(64, 100, ((Throwable) (null)));
        break MISSING_BLOCK_LABEL_2224;
        throw new IOException("Invalid header");
        try
        {
            if(obj != null)
                ((InputStream) (obj)).close();
            if(outputstreamwriter != null)
                outputstreamwriter.close();
            if(httpconnection != null)
                httpconnection.close();
        }
        catch(IOException ioexception4) { }
        j.repaint(0, 0, r, o);
        break MISSING_BLOCK_LABEL_2548;
        OutOfMemoryError outofmemoryerror1;
        outofmemoryerror1;
        A = null;
        p = null;
        l = null;
        d = null;
        k = null;
        System.gc();
        a(w, q, outofmemoryerror1);
        try
        {
            if(obj != null)
                ((InputStream) (obj)).close();
            if(outputstreamwriter != null)
                outputstreamwriter.close();
            if(httpconnection != null)
                httpconnection.close();
        }
        catch(IOException ioexception5) { }
        j.repaint(0, 0, r, o);
        break MISSING_BLOCK_LABEL_2548;
        Object obj1;
        obj1;
        Thread.yield();
        if((obj1 instanceof IOException) && ((Throwable) (obj1)).getMessage() != null && ((Throwable) (obj1)).getMessage().startsWith("Status"))
            obj1 = new IOException();
        a(w, q, ((Throwable) (obj1)));
        try
        {
            if(obj != null)
                ((InputStream) (obj)).close();
            if(outputstreamwriter != null)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -