华润电力 v1.2.3版本的 MD5 值为:cad684e77a7ed4d9f34cd67128f7a0db

以下内容为反编译后的 Proxy.java 源代码,内容仅作参考


package com.pm360.superepip.network;

import java.net.Authenticator;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;
import java.net.URL;

public class Proxy {
    public static boolean open = false;
    private static final String proxyHost = "127.0.0.1";
    private static final String proxyPass = "";
    private static final int proxyPort = 8087;
    private static final String proxyUser = "";

    public static java.net.Proxy getProxy(URL url) {
        System.getProperties().put("proxySet", "true");
        java.net.Proxy proxy = new java.net.Proxy(Proxy.Type.valueOf(url.getProtocol().toUpperCase()), new InetSocketAddress(proxyHost, proxyPort));
        Authenticator.setDefault(new MyAuthenticator("", ""));
        return proxy;
    }

    static class MyAuthenticator extends Authenticator {
        private String password;
        private String user;

        public MyAuthenticator(String str, String str2) {
            this.user = "";
            this.password = "";
            this.user = str;
            this.password = str2;
        }

        @Override
        protected PasswordAuthentication getPasswordAuthentication() {
            return new PasswordAuthentication(this.user, this.password.toCharArray());
        }
    }
}