ZStore v1.7版本的 MD5 值为:ca9bb200afd8d690876bd39318f8215c

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


package com.zackiestudios.zstore;

import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.SparseBooleanArray;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
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.bumptech.glide.Glide;
import com.google.firebase.FirebaseApp;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.GenericTypeIndicator;
import com.google.firebase.database.ValueEventListener;
import com.zackiestudios.zstore.RequestNetwork;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Random;

public class FiledownloadActivity extends AppCompatActivity {
    private ChildEventListener _Boost_child_listener;
    private RequestNetwork.RequestListener _network_request_listener;
    private EditText edittext1;
    private ImageView imageview1;
    private ImageView imageview2;
    private LinearLayout linear1;
    private LinearLayout linear5;
    private LinearLayout linear6;
    private LinearLayout linear7;
    private ListView listview1;
    private RequestNetwork network;
    private FirebaseDatabase _firebase = FirebaseDatabase.getInstance();
    private double Search_n1 = 0.0d;
    private double Search_n = 0.0d;
    private String charSeq = "";
    private ArrayList<HashMap<String, Object>> listmap = new ArrayList<>();
    private ArrayList<String> str = new ArrayList<>();
    private DatabaseReference Boost = this._firebase.getReference("F");
    private Intent intent = new Intent();

    private void initializeLogic() {
    }

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

    private void initialize(Bundle bundle) {
        this.linear6 = (LinearLayout) findViewById(R.id.linear6);
        this.linear5 = (LinearLayout) findViewById(R.id.linear5);
        this.linear7 = (LinearLayout) findViewById(R.id.linear7);
        this.linear1 = (LinearLayout) findViewById(R.id.linear1);
        this.imageview1 = (ImageView) findViewById(R.id.imageview1);
        this.edittext1 = (EditText) findViewById(R.id.edittext1);
        this.imageview2 = (ImageView) findViewById(R.id.imageview2);
        this.listview1 = (ListView) findViewById(R.id.listview1);
        this.network = new RequestNetwork(this);
        this.imageview1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                FiledownloadActivity.this.finish();
            }
        });
        this.edittext1.addTextChangedListener(new TextWatcher() {
            @Override
            public void afterTextChanged(Editable editable) {
            }

            @Override
            public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            }

            @Override
            public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
                String charSequence2 = charSequence.toString();
                if (SketchwareUtil.isConnected(FiledownloadActivity.this.getApplicationContext())) {
                    FiledownloadActivity.this.charSeq = charSequence2;
                    FiledownloadActivity.this.Boost.addListenerForSingleValueEvent(new ValueEventListener() {
                        @Override
                        public void onCancelled(DatabaseError databaseError) {
                        }

                        @Override
                        public void onDataChange(DataSnapshot dataSnapshot) {
                            FiledownloadActivity.this.listmap = new ArrayList();
                            try {
                                GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
                                };
                                Iterator<DataSnapshot> it = dataSnapshot.getChildren().iterator();
                                while (it.hasNext()) {
                                    FiledownloadActivity.this.listmap.add((HashMap) it.next().getValue(genericTypeIndicator));
                                }
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                            if (FiledownloadActivity.this.charSeq.length() > 0) {
                                FiledownloadActivity.this.Search_n1 = FiledownloadActivity.this.listmap.size() - 1;
                                FiledownloadActivity.this.Search_n = FiledownloadActivity.this.listmap.size();
                                for (int i4 = 0; i4 < ((int) FiledownloadActivity.this.Search_n); i4++) {
                                    if (!((HashMap) FiledownloadActivity.this.listmap.get((int) FiledownloadActivity.this.Search_n1)).get("title").toString().toLowerCase().contains(FiledownloadActivity.this.charSeq.toLowerCase())) {
                                        FiledownloadActivity.this.listmap.remove((int) FiledownloadActivity.this.Search_n1);
                                    }
                                    FiledownloadActivity.this.Search_n1 -= 1.0d;
                                }
                            }
                            FiledownloadActivity.this.listview1.setAdapter((ListAdapter) new Listview1Adapter(FiledownloadActivity.this.listmap));
                            ((BaseAdapter) FiledownloadActivity.this.listview1.getAdapter()).notifyDataSetChanged();
                        }
                    });
                } else {
                    SketchwareUtil.showMessage(FiledownloadActivity.this.getApplicationContext(), "Erro de Internet!");
                }
            }
        });
        ChildEventListener childEventListener = new ChildEventListener() {
            @Override
            public void onChildMoved(DataSnapshot dataSnapshot, String str) {
            }

            @Override
            public void onChildAdded(DataSnapshot dataSnapshot, String str) {
                GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
                };
                dataSnapshot.getKey();
                FiledownloadActivity.this.listmap.add(0, (HashMap) dataSnapshot.getValue(genericTypeIndicator));
                ListView listView = FiledownloadActivity.this.listview1;
                FiledownloadActivity filedownloadActivity = FiledownloadActivity.this;
                listView.setAdapter((ListAdapter) new Listview1Adapter(filedownloadActivity.listmap));
                ((BaseAdapter) FiledownloadActivity.this.listview1.getAdapter()).notifyDataSetChanged();
            }

            @Override
            public void onChildChanged(DataSnapshot dataSnapshot, String str) {
                GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
                };
                dataSnapshot.getKey();
                ListView listView = FiledownloadActivity.this.listview1;
                FiledownloadActivity filedownloadActivity = FiledownloadActivity.this;
                listView.setAdapter((ListAdapter) new Listview1Adapter(filedownloadActivity.listmap));
                ((BaseAdapter) FiledownloadActivity.this.listview1.getAdapter()).notifyDataSetChanged();
            }

            @Override
            public void onChildRemoved(DataSnapshot dataSnapshot) {
                GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
                };
                dataSnapshot.getKey();
            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
                databaseError.getCode();
                databaseError.getMessage();
            }
        };
        this._Boost_child_listener = childEventListener;
        this.Boost.addChildEventListener(childEventListener);
        this._network_request_listener = new RequestNetwork.RequestListener() {
            @Override
            public void onErrorResponse(String str, String str2) {
            }

            @Override
            public void onResponse(String str, String str2, HashMap<String, Object> hashMap) {
            }
        };
    }

    public void _round_corner_and_ripple(View view, double d, double d2, String str, boolean z) {
        if (z) {
            GradientDrawable gradientDrawable = new GradientDrawable();
            gradientDrawable.setColor(Color.parseColor(str));
            gradientDrawable.setCornerRadius((int) d);
            view.setElevation((int) d2);
            Drawable rippleDrawable = new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{Color.parseColor("#9e9e9e")}), gradientDrawable, null);
            view.setClickable(true);
            view.setBackground(rippleDrawable);
            return;
        }
        GradientDrawable gradientDrawable2 = new GradientDrawable();
        gradientDrawable2.setColor(Color.parseColor(str));
        gradientDrawable2.setCornerRadius((int) d);
        view.setBackground(gradientDrawable2);
        view.setElevation((int) d2);
    }

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

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

        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 View getView(final int i, View view, ViewGroup viewGroup) {
            LayoutInflater layoutInflater = FiledownloadActivity.this.getLayoutInflater();
            if (view == null) {
                view = layoutInflater.inflate(R.layout.filedow, (ViewGroup) null);
            }
            LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.main);
            ImageView imageView = (ImageView) view.findViewById(R.id.icon);
            final TextView textView = (TextView) view.findViewById(R.id.title);
            ImageView imageView2 = (ImageView) view.findViewById(R.id.ytvew);
            Button button = (Button) view.findViewById(R.id.button1);
            TextView textView2 = (TextView) view.findViewById(R.id.date);
            FiledownloadActivity.this._round_corner_and_ripple(linearLayout, 20.0d, 0.0d, "#FFFFFF", true);
            button.setBackground(new GradientDrawable() {
                public GradientDrawable getIns(int i2, int i3) {
                    setCornerRadius(i2);
                    setColor(i3);
                    return this;
                }
            }.getIns(15, -14575885));
            button.setTextColor(-1);
            if (this._data.get(i).containsKey("title")) {
                textView.setText(this._data.get(i).get("title").toString());
            }
            if (this._data.get(i).containsKey("date")) {
                textView2.setText(this._data.get(i).get("date").toString());
            }
            if (this._data.get(i).containsKey("iconurl")) {
                Glide.with(FiledownloadActivity.this.getApplicationContext()).load(Uri.parse(this._data.get(i).get("iconurl").toString())).into(imageView);
            }
            button.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view2) {
                    if (SketchwareUtil.isConnected(FiledownloadActivity.this.getApplicationContext())) {
                        FiledownloadActivity.this.intent.setClass(FiledownloadActivity.this.getApplicationContext(), FiledecoActivity.class);
                        FiledownloadActivity.this.intent.putExtra(ExifInterface.GPS_DIRECTION_TRUE, textView.getText().toString());
                        FiledownloadActivity.this.intent.putExtra("F", Listview1Adapter.this._data.get(i).get("fileurl").toString());
                        FiledownloadActivity.this.intent.putExtra("C", Listview1Adapter.this._data.get(i).get("count").toString());
                        FiledownloadActivity.this.intent.putExtra("L", Listview1Adapter.this._data.get(i).get("lock").toString());
                        FiledownloadActivity.this.intent.putExtra("U", Listview1Adapter.this._data.get(i).get("iconurl").toString());
                        FiledownloadActivity.this.intent.putExtra("Y", Listview1Adapter.this._data.get(i).get("Yt").toString());
                        FiledownloadActivity.this.intent.putExtra("N", Listview1Adapter.this._data.get(i).get("name").toString());
                        FiledownloadActivity.this.intent.putExtra(ExifInterface.LATITUDE_SOUTH, Listview1Adapter.this._data.get(i).get("size").toString());
                        FiledownloadActivity.this.startActivity(FiledownloadActivity.this.intent);
                        return;
                    }
                    SketchwareUtil.showMessage(FiledownloadActivity.this.getApplicationContext(), "Erro de Internet!");
                }
            });
            imageView2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view2) {
                    if (!SketchwareUtil.isConnected(FiledownloadActivity.this.getApplicationContext())) {
                        SketchwareUtil.showMessage(FiledownloadActivity.this.getApplicationContext(), "Erro de Internet!");
                        return;
                    }
                    if (!Listview1Adapter.this._data.get(i).get("ID").toString().equals("")) {
                        FiledownloadActivity.this.intent.setAction("android.intent.action.VIEW");
                        FiledownloadActivity.this.intent.setData(Uri.parse("https://youtu.be/".concat(Listview1Adapter.this._data.get(i).get("ID").toString())));
                        FiledownloadActivity.this.startActivity(FiledownloadActivity.this.intent);
                        FiledownloadActivity.this.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
                        return;
                    }
                    SketchwareUtil.showMessage(FiledownloadActivity.this.getApplicationContext(), "Sem Links!");
                }
            });
            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;
    }
}