analysis: full official-app reverse artifacts (jadx sources, ghidra libcxsdk decomp, authoritative protocol conclusions) + docs
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
package cn.com.magnity.magnitycx;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class QueryDialogFragment extends DialogFragment {
|
||||
private static final String RESID = "resid";
|
||||
private MagOnClickListener magOnClickListener_;
|
||||
private int resId_;
|
||||
|
||||
public interface DelegateQueryResult {
|
||||
void onQueryResult(int i);
|
||||
}
|
||||
|
||||
public static QueryDialogFragment newInstance(int resId) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt(RESID, resId);
|
||||
QueryDialogFragment dlg = new QueryDialogFragment();
|
||||
dlg.setArguments(bundle);
|
||||
return dlg;
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Bundle bundle = getArguments();
|
||||
if (bundle != null) {
|
||||
this.resId_ = bundle.getInt(RESID);
|
||||
}
|
||||
this.magOnClickListener_ = new MagOnClickListener();
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.DialogFragment
|
||||
@NonNull
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
LayoutInflater inflater = getActivity().getLayoutInflater();
|
||||
View view = inflater.inflate(this.resId_, (ViewGroup) null);
|
||||
Button btnCancel = (Button) view.findViewById(R.id.id_btn_cancel);
|
||||
Button btnOk = (Button) view.findViewById(R.id.id_btn_ok);
|
||||
btnCancel.setOnClickListener(this.magOnClickListener_);
|
||||
btnOk.setOnClickListener(this.magOnClickListener_);
|
||||
builder.setView(view);
|
||||
return builder.create();
|
||||
}
|
||||
|
||||
private class MagOnClickListener implements View.OnClickListener {
|
||||
private MagOnClickListener() {
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View v) {
|
||||
int result = 0;
|
||||
switch (v.getId()) {
|
||||
case R.id.id_btn_ok /* 2131624096 */:
|
||||
result = 1;
|
||||
break;
|
||||
case R.id.id_btn_cancel /* 2131624106 */:
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
if (QueryDialogFragment.this.getActivity() instanceof DelegateQueryResult) {
|
||||
((DelegateQueryResult) QueryDialogFragment.this.getActivity()).onQueryResult(result);
|
||||
}
|
||||
QueryDialogFragment.this.dismiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user