MBBD Trace v1.0版本的 MD5 值为:f0273367d111799d70c685af03877187

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


package com.bipul.trace;

import android.app.AlertDialog;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseBooleanArray;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.exifinterface.media.ExifInterface;
import com.bipul.trace.RequestNetwork;
import com.bumptech.glide.Glide;
import com.google.android.gms.common.internal.ImagesContract;
import com.google.firebase.FirebaseApp;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONObject;
public class BdmasjidActivity extends AppCompatActivity {
    private RequestNetwork.RequestListener _ra_request_listener;
    private AlertDialog.Builder d;
    private ImageView imageview1;
    private ImageView imageview2;
    private ImageView imageview3;
    private LinearLayout linear2;
    private ListView listview1;
    private LinearLayout morebtn;
    private RequestNetwork ra;
    private LinearLayout searchbtn;
    private LinearLayout statusbtn;
    private TextView textview21;
    private HashMap<String, Object> blogfa = new HashMap<>();
    private String blogger_id = "";
    private String blogger_gen = "";
    private String rawdata = "";
    private double ki = 0.0d;
    private String di = "";
    private String daydates = "";
    private HashMap<String, Object> converted = new HashMap<>();
    private String finedimage = "";
    private String post = "";
    private String ptitle = "";
    private String userimage = "";
    private String postcat = "";
    private String username = "";
    private String error = "";
    private HashMap<String, Object> map = new HashMap<>();
    private ArrayList<HashMap<String, Object>> shut = new ArrayList<>();
    private ArrayList<String> allraw = new ArrayList<>();
    private ArrayList<HashMap<String, Object>> readypost = new ArrayList<>();
    private Intent i = new Intent();

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.bdmasjid);
        initialize(bundle);
        FirebaseApp.initializeApp(this);
        initializeLogic();
    }

    private void initialize(Bundle bundle) {
        this.linear2 = (LinearLayout) findViewById(R.id.linear2);
        this.listview1 = (ListView) findViewById(R.id.listview1);
        this.statusbtn = (LinearLayout) findViewById(R.id.statusbtn);
        this.textview21 = (TextView) findViewById(R.id.textview21);
        this.searchbtn = (LinearLayout) findViewById(R.id.searchbtn);
        this.morebtn = (LinearLayout) findViewById(R.id.morebtn);
        this.imageview3 = (ImageView) findViewById(R.id.imageview3);
        this.imageview1 = (ImageView) findViewById(R.id.imageview1);
        this.imageview2 = (ImageView) findViewById(R.id.imageview2);
        this.ra = new RequestNetwork(this);
        this.d = new AlertDialog.Builder(this);
        this.listview1.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
                try {
                    BdmasjidActivity.this.map = (HashMap) BdmasjidActivity.this.readypost.get(i);
                    BdmasjidActivity.this.i.setClass(BdmasjidActivity.this.getApplicationContext(), ViewActivity.class);
                    BdmasjidActivity.this.i.putExtra("data", new Gson().toJson(BdmasjidActivity.this.map));
                    BdmasjidActivity.this.startActivity(BdmasjidActivity.this.i);
                } catch (Exception e) {
                    BdmasjidActivity.this.error = e.toString();
                    SketchwareUtil.showMessage(BdmasjidActivity.this.getApplicationContext(), BdmasjidActivity.this.error);
                }
            }
        });
        this._ra_request_listener = new RequestNetwork.RequestListener() {
            @Override
            public void onResponse(String str, String str2, HashMap<String, Object> hashMap) {
                BdmasjidActivity.this._phrase_string(str2, str);
            }

            @Override
            public void onErrorResponse(String str, String str2) {
                SketchwareUtil.showMessage(BdmasjidActivity.this.getApplicationContext(), str2);
            }
        };
    }

    private void initializeLogic() {
        this.blogfa = new HashMap<>();
        this.blogfa.put("maxResults", "50");
        this.blogger_id = "5419969510116786736";
        this.blogger_gen = "https://www.googleapis.com/blogger/v3/blogs/".concat(this.blogger_id.concat("/posts"));
        this.blogfa.put("key", "AIzaSyDJHF-s3esJVEt-G05RIf4fTM2t_wtODjk");
        this.ra.setParams(this.blogfa, 0);
        this.ra.startRequestNetwork("GET", this.blogger_gen, "", this._ra_request_listener);
    }

    public void _phrase_string(String str, String str2) {
        try {
            this.shut.clear();
            this.allraw.clear();
            this.readypost.clear();
            this.rawdata = new JSONObject(str).getString("items");
            JSONArray jSONArray = new JSONArray(this.rawdata);
            this.shut = (ArrayList) new Gson().fromJson(this.rawdata, new TypeToken<ArrayList<HashMap<String, Object>>>() {
            }.getType());
            this.ki = 0.0d;
            for (int i = 0; i < this.shut.size(); i++) {
                JSONObject jSONObject = jSONArray.getJSONObject((int) this.ki);
                JSONObject jSONObject2 = jSONObject.getJSONObject("author");
                this.username = jSONObject2.getString("displayName");
                this.userimage = jSONObject2.getJSONObject("image").getString(ImagesContract.URL);
                this.daydates = jSONObject.getString("published");
                this.post = jSONObject.getString("content");
                this.ptitle = jSONObject.getString("title");
                try {
                    this.postcat = jSONObject.getString("labels");
                } catch (Exception e) {
                    this.postcat = "no labels";
                }
                this.di = this.daydates.replace(ExifInterface.GPS_DIRECTION_TRUE, "");
                try {
                    this.di = new SimpleDateFormat("dd MMMM yyyy hh:mm a").format(new SimpleDateFormat("yyyy-MM-ddHH:mm:ss").parse(this.di));
                } catch (ParseException e2) {
                    e2.printStackTrace();
                }
                this.converted = new HashMap<>();
                this.finedimage = this.post.replace("\\", "").replace("\n", " ").replace("\\u", " ");
                ArrayList arrayList = new ArrayList();
                Matcher matcher = Pattern.compile("\\b(((ht|f)tp(s?)\\:\\/\\/|~\\/|\\/)|i1.wp.)(\\w+:\\w+@)?(([-\\w]+\\.)+(com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2}))(:[\\d]{1,5})?(((\\/([-\\w~!$+|.,=]|%[a-f\\d]{2})+)+|\\/)+|\\?|#)?((\\?([-\\w~!$+|.,*:]|%[a-f\\d{2}])+=?([-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)(&(?:[-\\w~!$+|.,*:]|%[a-f\\d{2}])+=?([-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)*)*(#([-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)?\\b").matcher(this.finedimage);
                while (matcher.find()) {
                    arrayList.add(matcher.group());
                }
                if (arrayList.size() > 1) {
                    this.converted.put("img", arrayList.get(0));
                }
                this.converted.put("title", this.ptitle);
                this.converted.put("content", this.post);
                this.converted.put("date", this.di);
                this.converted.put("authorimage", this.userimage.replace("//", ""));
                this.converted.put("labels", this.postcat);
                this.converted.put("author", this.username);
                this.readypost.add(this.converted);
                this.listview1.setAdapter((ListAdapter) new Listview1Adapter(this.readypost));
                ((BaseAdapter) this.listview1.getAdapter()).notifyDataSetChanged();
                this.ki += 1.0d;
            }
        } catch (Exception e3) {
            this.error = e3.toString();
            this.d.setMessage(this.error.concat("At position ".concat(String.valueOf((long) this.ki))));
            this.d.create().show();
        }
    }

    public void _Customizar(View view, String str, double d, double d2) {
        GradientDrawable gradientDrawable = new GradientDrawable();
        gradientDrawable.setColor(Color.parseColor(str));
        gradientDrawable.setCornerRadius((int) d);
        view.setBackground(gradientDrawable);
        view.setElevation((int) d2);
    }

    public class Listview1Adapter extends BaseAdapter {
        ArrayList<HashMap<String, Object>> _data;

        public Listview1Adapter(ArrayList<HashMap<String, Object>> arrayList) {
            this._data = arrayList;
        }

        @Override
        public int getCount() {
            return this._data.size();
        }

        @Override
        public HashMap<String, Object> getItem(int i) {
            return this._data.get(i);
        }

        @Override
        public long getItemId(int i) {
            return i;
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            LayoutInflater layoutInflater = BdmasjidActivity.this.getLayoutInflater();
            if (view == null) {
                view = layoutInflater.inflate(R.layout.masjid, (ViewGroup) null);
            }
            LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.linear1);
            ImageView imageView = (ImageView) view.findViewById(R.id.imageview1);
            TextView textView = (TextView) view.findViewById(R.id.title);
            LinearLayout linearLayout2 = (LinearLayout) view.findViewById(R.id.linear2);
            TextView textView2 = (TextView) view.findViewById(R.id.date);
            TextView textView3 = (TextView) view.findViewById(R.id.author);
            try {
                textView.setText(this._data.get(i).get("title").toString());
                textView2.setText(this._data.get(i).get("date").toString());
                textView3.setText(this._data.get(i).get("author").toString());
                Glide.with(BdmasjidActivity.this.getApplicationContext()).load(Uri.parse(this._data.get(i).get("img").toString())).into(imageView);
                BdmasjidActivity.this._Customizar(linearLayout, "#ffffffff", 35.0d, 10.0d);
            } catch (Exception e) {
                Log.e("Error: ", e.toString());
            }
            return view;
        }
    }

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

    @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;
    }

    @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 getDisplayWidthPixels() {
        return getResources().getDisplayMetrics().widthPixels;
    }

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