GalaxyVPN v1.2.3版本的 MD5 值为:642e5f69966a3849933084f3c0fba1d5

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


package com.neko.ipgeolocationhosttoip;

import android.os.Bundle;
import android.util.SparseBooleanArray;
import android.util.TypedValue;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.core.app.NotificationCompat;
import androidx.exifinterface.media.ExifInterface;
import com.google.android.gms.actions.SearchIntents;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.neko.ipgeolocationhosttoip.RequestNetwork;
import com.v2ray.ang.R;
import com.v2ray.ang.ui.BaseActivity;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
public class HostToIp extends BaseActivity {
    private RequestNetwork.RequestListener _milimchan_request_listener;
    private EditText edittext1;
    private LinearLayout linear1;
    private LinearLayout linear10;
    private Button linear7;
    private LinearLayout linear9;
    private RequestNetwork milimchan;
    private TextView textview1;
    private TextView textview10;
    private TextView textview11;
    private TextView textview12;
    private TextView textview13;
    private TextView textview2;
    private TextView textview9;
    private HashMap<String, Object> milimchan2 = new HashMap<>();
    private String quote = "";
    private HashMap<String, Object> hostIP = new HashMap<>();

    private void initialize(Bundle bundle) {
        this.linear1 = (LinearLayout) findViewById(R.id.linear1);
        this.linear7 = (Button) findViewById(R.id.linear7);
        this.linear9 = (LinearLayout) findViewById(R.id.linear9);
        this.linear10 = (LinearLayout) findViewById(R.id.linear10);
        this.edittext1 = (EditText) findViewById(R.id.edittext1);
        this.textview2 = (TextView) findViewById(R.id.textview2);
        this.textview1 = (TextView) findViewById(R.id.textview1);
        this.textview9 = (TextView) findViewById(R.id.textview9);
        this.textview10 = (TextView) findViewById(R.id.textview10);
        this.textview11 = (TextView) findViewById(R.id.textview11);
        this.textview12 = (TextView) findViewById(R.id.textview12);
        this.textview13 = (TextView) findViewById(R.id.textview13);
        this.milimchan = new RequestNetwork(this);
        this.linear7.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (HostToIp.this.edittext1.getText().toString().equals("")) {
                    Util.showMessage(HostToIp.this.getApplicationContext(), "Empty");
                    return;
                }
                HostToIp.this.milimchan.startRequestNetwork("GET", "http://ip-api.com/json/".concat(HostToIp.this.edittext1.getText().toString()), ExifInterface.GPS_MEASUREMENT_IN_PROGRESS, HostToIp.this._milimchan_request_listener);
                Util.showMessage(HostToIp.this.getApplicationContext(), "Vui lòng chờ...");
            }
        });
        this._milimchan_request_listener = new RequestNetwork.RequestListener() {
            @Override
            public void onErrorResponse(String str, String str2) {
                Util.showMessage(HostToIp.this.getApplicationContext(), "Error");
            }

            @Override
            public void onResponse(String str, String str2, HashMap<String, Object> hashMap) {
                HostToIp.this.hostIP = (HashMap) new Gson().fromJson(str2, new TypeToken<HashMap<String, Object>>() {
                }.getType());
                if (!HostToIp.this.hostIP.get(NotificationCompat.CATEGORY_STATUS).toString().equals("success")) {
                    Util.showMessage(HostToIp.this.getApplicationContext(), "Failed");
                    return;
                }
                HostToIp.this.textview1.setText("IP:  ".concat(HostToIp.this.hostIP.get(SearchIntents.EXTRA_QUERY).toString()));
                HostToIp.this.textview9.setText("Quốc gia:  ".concat(HostToIp.this.hostIP.get("country").toString()));
                HostToIp.this.textview10.setText("Nhà cung cấp 1:  ".concat(HostToIp.this.hostIP.get("org").toString()));
                HostToIp.this.textview11.setText("Nhà cung cấp 2:  ".concat(HostToIp.this.hostIP.get("isp").toString()));
                HostToIp.this.textview12.setText("Nhà cung cấp 3:  ".concat(HostToIp.this.hostIP.get("as").toString()));
                HostToIp.this.textview13.setText("Tỉnh/Thành phố:  ".concat(HostToIp.this.hostIP.get("city").toString()));
            }
        };
    }

    private void initializeLogic() {
    }

    @Deprecated
    public ArrayList<Double> getCheckedItemPositionsToArray(ListView listView) {
        ArrayList<Double> arrayList = new ArrayList<>();
        SparseBooleanArray checkedItemPositions = listView.getCheckedItemPositions();
        for (int i = 0; i < checkedItemPositions.size(); i++) {
            if (checkedItemPositions.valueAt(i)) {
                arrayList.add(Double.valueOf(checkedItemPositions.keyAt(i)));
            }
        }
        return arrayList;
    }

    @Deprecated
    public float getDip(int i) {
        return TypedValue.applyDimension(1, i, getResources().getDisplayMetrics());
    }

    @Deprecated
    public int getDisplayHeightPixels() {
        return getResources().getDisplayMetrics().heightPixels;
    }

    @Deprecated
    public int getDisplayWidthPixels() {
        return getResources().getDisplayMetrics().widthPixels;
    }

    @Deprecated
    public int getLocationX(View view) {
        int[] iArr = new int[2];
        view.getLocationInWindow(iArr);
        return iArr[0];
    }

    @Deprecated
    public int getLocationY(View view) {
        int[] iArr = new int[2];
        view.getLocationInWindow(iArr);
        return iArr[1];
    }

    @Deprecated
    public int getRandom(int i, int i2) {
        return new Random().nextInt((i2 - i) + 1) + i;
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.uwu_host_to_ip);
        initialize(bundle);
        initializeLogic();
    }

    @Deprecated
    public void showMessage(String str) {
        Toast.makeText(getApplicationContext(), str, 0).show();
    }
}