ibnux / Android-SMS-Gateway-MQTT

Android SMS Gateway using MQTT
16 stars 4 forks source link

Send SMS with Androis-SMS-Gateway (webhook), doesn't work with MQTT version #1

Open raynoxfr opened 8 months ago

raynoxfr commented 8 months ago

Hello,

I try to use your apps with MQTT version. I have tried both APK (webhook and MQTT version) on the same mobile phone.

For webhook, it works for me. For MQTT, I received the message from MQTT broker, and I have sent it with :

{
    "to": "XXXXXXXX",
    "message": "test",
    "sim": 1
}

I received an answer : SUBMIT SMS SUCCESS: XXXXXXXX SIM1 But I don't receive any SMS to the destination.

Because it works with webhook app, so I don't think so it's an issue from my mobile phone. IMG_7068 2

For your information :

Thank you for your help

raynoxfr commented 8 months ago

When I try from Android Studio emulator :

2024-03-12 00:00:40.702 13630-13678 .smsgatewaymqtt         com.ibnux.smsgatewaymqtt             W  Accessing hidden method Landroid/os/ServiceManager;->getService(Ljava/lang/String;)Landroid/os/IBinder; (unsupported, reflection, allowed)
2024-03-12 00:00:40.713 13630-13678 PendingIntent           com.ibnux.smsgatewaymqtt             W  android.app.StackTrace: New mutable implicit PendingIntent: pkg=com.ibnux.smsgatewaymqtt, action=SMS_SENT, featureId=null. This will be blocked once the app targets U+ for security reasons.
                                                                                                        at android.app.PendingIntent.checkPendingIntent(PendingIntent.java:443)
                                                                                                        at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:731)
                                                                                                        at android.app.PendingIntent.getBroadcast(PendingIntent.java:718)
                                                                                                        at com.ibnux.smsgatewaymqtt.Utils.SimUtil.sendSMS(SimUtil.java:82)
                                                                                                        at com.ibnux.smsgatewaymqtt.layanan.BackgroundService.sendSMSorUSSD(BackgroundService.java:441)
                                                                                                        at com.ibnux.smsgatewaymqtt.layanan.BackgroundService.access$000(BackgroundService.java:62)
                                                                                                        at com.ibnux.smsgatewaymqtt.layanan.BackgroundService$3$1.run(BackgroundService.java:278)
                                                                                                        at java.lang.Thread.run(Thread.java:1012)
2024-03-12 00:00:40.719 13630-13678 PendingIntent           com.ibnux.smsgatewaymqtt             W  android.app.StackTrace: New mutable implicit PendingIntent: pkg=com.ibnux.smsgatewaymqtt, action=SMS_DELIVERED, featureId=null. This will be blocked once the app targets U+ for security reasons.
                                                                                                        at android.app.PendingIntent.checkPendingIntent(PendingIntent.java:443)
                                                                                                        at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:731)
                                                                                                        at android.app.PendingIntent.getBroadcast(PendingIntent.java:718)
                                                                                                        at com.ibnux.smsgatewaymqtt.Utils.SimUtil.sendSMS(SimUtil.java:90)
                                                                                                        at com.ibnux.smsgatewaymqtt.layanan.BackgroundService.sendSMSorUSSD(BackgroundService.java:441)
                                                                                                        at com.ibnux.smsgatewaymqtt.layanan.BackgroundService.access$000(BackgroundService.java:62)
                                                                                                        at com.ibnux.smsgatewaymqtt.layanan.BackgroundService$3$1.run(BackgroundService.java:278)
                                                                                                        at java.lang.Thread.run(Thread.java:1012)
2024-03-12 00:00:40.729 13630-13678 .smsgatewaymqtt         com.ibnux.smsgatewaymqtt             W  Accessing hidden method Lcom/android/internal/telephony/ISms$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ISms; (unsupported, reflection, allowed)
2024-03-12 00:00:40.735 13630-13678 System.err              com.ibnux.smsgatewaymqtt             W  java.lang.NoSuchMethodException: com.android.internal.telephony.ISms$Stub$Proxy.sendText [class java.lang.String, class java.lang.String, class java.lang.String, class java.lang.String, class android.app.PendingIntent, class android.app.PendingIntent]
2024-03-12 00:00:40.735 13630-13678 System.err              com.ibnux.smsgatewaymqtt             W      at java.lang.Class.getMethod(Class.java:2937)
2024-03-12 00:00:40.741 13630-13678 System.err              com.ibnux.smsgatewaymqtt             W      at java.lang.Class.getMethod(Class.java:2449)
2024-03-12 00:00:40.741 13630-13678 System.err              com.ibnux.smsgatewaymqtt             W      at com.ibnux.smsgatewaymqtt.Utils.SimUtil.sendSMS(SimUtil.java:102)
2024-03-12 00:00:40.742 13630-13678 System.err              com.ibnux.smsgatewaymqtt             W      at com.ibnux.smsgatewaymqtt.layanan.BackgroundService.sendSMSorUSSD(BackgroundService.java:441)
2024-03-12 00:00:40.742 13630-13678 System.err              com.ibnux.smsgatewaymqtt             W      at com.ibnux.smsgatewaymqtt.layanan.BackgroundService.access$000(BackgroundService.java:62)
2024-03-12 00:00:40.742 13630-13678 System.err              com.ibnux.smsgatewaymqtt             W      at com.ibnux.smsgatewaymqtt.layanan.BackgroundService$3$1.run(BackgroundService.java:278)
2024-03-12 00:00:40.743 13630-13678 System.err              com.ibnux.smsgatewaymqtt             W      at java.lang.Thread.run(Thread.java:1012)
ibnux commented 7 months ago

Try without bring sim variable.
Only phone and text

Multiple sim not available on all OS