导航菜单

页面标题

页面副标题

VIP-LODDER v3.3.1 - GroupActivity.java 源代码

正在查看: VIP-LODDER v3.3.1 应用的 GroupActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.fultaj.activity;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.KeyEvent;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.fultaj.R;
import com.fultaj.adapter.MessageChatAdapter;
import com.fultaj.adapter.MessageChatModel;
import com.fultaj.ifc.Api;
import com.fultaj.ifc.User;
import com.fultaj.messaging.Client;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
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.ValueEventListener;
import io.michaelrocks.paranoid.Deobfuscator;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class GroupActivity extends AppCompatActivity {
    MessageChatAdapter adapter;
    Api apiService;
    FirebaseUser fuser = null;
    List<MessageChatModel> messageChatModelList = new ArrayList();
    EditText messageET;
    RecyclerView recyclerView;
    DatabaseReference referenceMessage;
    ValueEventListener seenListenerMessage;
    ImageView sendBtn;

    public static void goGroup(Context context) {
        Intent i = new Intent(context, (Class<?>) GroupActivity.class);
        i.setFlags(805339136);
        context.startActivity(i);
    }

    public void takeUsername() {
        EditText edit = new EditText(this);
        edit.setHint(Deobfuscator.app.Debug.getString(-751498933882L));
        edit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView arg0, int arg1, KeyEvent arg2) {
                if (arg2.getFlags() == 512) {
                    PreferenceManager.getDefaultSharedPreferences(GroupActivity.this).edit().putString(Deobfuscator.app.Debug.getString(-708549260922L), arg0.getText().toString());
                    return true;
                }
                return true;
            }
        });
        new MaterialAlertDialogBuilder(this, R.style.AppTheme).setCancelable(false).setTitle(Deobfuscator.app.Debug.getString(-772973770362L)).setView(edit).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                GroupActivity.this.m139lambda$takeUsername$0$comfultajactivityGroupActivity(dialogInterface, i);
            }
        }).show();
    }

    void m139lambda$takeUsername$0$comfultajactivityGroupActivity(DialogInterface d, int w) {
        ((TextView) findViewById(R.id.tv_username)).setText(PreferenceManager.getDefaultSharedPreferences(this).getString(Deobfuscator.app.Debug.getString(-1228240303738L), Deobfuscator.app.Debug.getString(-1266895009402L)));
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Thread.setDefaultUncaughtExceptionHandler(new CrashHandler(this));
        setContentView(R.layout.activity_group);
        setNavBar(R.color.card_background);
        this.fuser = FirebaseAuth.getInstance().getCurrentUser();
        this.apiService = (Api) Client.getClient(Deobfuscator.app.Debug.getString(-828808345210L)).create(Api.class);
        final TextView username = (TextView) findViewById(R.id.tv_username);
        this.messageET = (EditText) findViewById(R.id.messageET);
        this.sendBtn = (ImageView) findViewById(R.id.sendBtn);
        findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                GroupActivity.this.m138lambda$onCreate$1$comfultajactivityGroupActivity(view);
            }
        });
        FirebaseDatabase.getInstance().getReference(Deobfuscator.app.Debug.getString(-949067429498L)).child(this.fuser.getUid()).addValueEventListener(new ValueEventListener() {
            public void onDataChange(DataSnapshot dataSnapshot) {
                User user = (User) dataSnapshot.getValue(User.class);
                username.setText(user.getUsername());
            }

            public void onCancelled(DatabaseError databaseError) {
            }
        });
        this.recyclerView = (RecyclerView) findViewById(2131296715);
        LinearLayoutManager manager = new LinearLayoutManager(this, 1, false);
        this.recyclerView.setLayoutManager(manager);
        readAllMessage();
        this.recyclerView.smoothScrollToPosition(this.messageChatModelList.size());
        MessageChatAdapter messageChatAdapter = new MessageChatAdapter(this.messageChatModelList, this);
        this.adapter = messageChatAdapter;
        this.recyclerView.setAdapter(messageChatAdapter);
        this.sendBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String msg = GroupActivity.this.messageET.getText().toString();
                String time = String.valueOf(System.currentTimeMillis());
                if (!msg.isEmpty()) {
                    GroupActivity.this.sendMessage(username.getText().toString(), msg, time);
                }
            }
        });
    }

    void m138lambda$onCreate$1$comfultajactivityGroupActivity(View v) {
        MainActivity.goMain(this);
        finishActivity(0);
    }

    @Override
    public void onBackPressed() {
        MainActivity.goMain(this);
        finishActivity(0);
    }

    public void setNavBar(int color) {
        getWindow().addFlags(Integer.MIN_VALUE);
        getWindow().clearFlags(67108864);
        getWindow().getDecorView().setSystemUiVisibility(4);
        getWindow().getDecorView().setSystemUiVisibility(8192);
        getWindow().setStatusBarColor(ContextCompat.getColor(this, color));
    }

    private void readAllMessage() {
        DatabaseReference reference = FirebaseDatabase.getInstance().getReference(Deobfuscator.app.Debug.getString(-974837233274L));
        this.referenceMessage = reference;
        this.seenListenerMessage = reference.addValueEventListener(new ValueEventListener() {
            public void onDataChange(DataSnapshot dataSnapshot) {
                GroupActivity.this.messageChatModelList.clear();
                for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
                    MessageChatModel chat = (MessageChatModel) snapshot.getValue(MessageChatModel.class);
                    GroupActivity.this.messageChatModelList.add(chat);
                    GroupActivity.this.recyclerView.smoothScrollToPosition(GroupActivity.this.messageChatModelList.size());
                    GroupActivity.this.adapter.notifyDataSetChanged();
                }
            }

            public void onCancelled(DatabaseError databaseError) {
            }
        });
    }

    public void sendMessage(String user, String msg, String time) {
        DatabaseReference reference = FirebaseDatabase.getInstance().getReference();
        HashMap<String, Object> hashMap = new HashMap<>();
        hashMap.put(Deobfuscator.app.Debug.getString(-1026376840826L), this.fuser.getUid());
        hashMap.put(Deobfuscator.app.Debug.getString(-1043556710010L), user);
        hashMap.put(Deobfuscator.app.Debug.getString(-1065031546490L), msg);
        hashMap.put(Deobfuscator.app.Debug.getString(-1082211415674L), time);
        hashMap.put(Deobfuscator.app.Debug.getString(-1103686252154L), time);
        reference.child(Deobfuscator.app.Debug.getString(-1125161088634L)).push().setValue(hashMap);
        DatabaseReference reference2 = FirebaseDatabase.getInstance().getReference(Deobfuscator.app.Debug.getString(-1176700696186L));
        this.referenceMessage = reference2;
        this.seenListenerMessage = reference2.addValueEventListener(new ValueEventListener() {
            public void onDataChange(DataSnapshot dataSnapshot) {
                GroupActivity.this.messageChatModelList.clear();
                for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
                    MessageChatModel chat = (MessageChatModel) snapshot.getValue(MessageChatModel.class);
                    GroupActivity.this.messageChatModelList.add(chat);
                    GroupActivity.this.adapter.notifyDataSetChanged();
                    GroupActivity.this.messageET.setText(Deobfuscator.app.Debug.getString(-747203966586L));
                }
            }

            public void onCancelled(DatabaseError databaseError) {
            }
        });
    }

    @Override
    protected void onPause() {
        this.referenceMessage.removeEventListener(this.seenListenerMessage);
        super.onPause();
    }
}