Giter Site home page Giter Site logo

romellfudi / voipussd Goto Github PK

View Code? Open in Web Editor NEW
171.0 18.0 99.0 9.37 MB

:octocat: 📞 IMEI (USSD) Library in Android Devices by @romellfudi

Home Page: https://romellfudi.github.io/VoIpUSSD/

License: GNU General Public License v3.0

HTML 1.07% Java 53.24% Kotlin 45.63% SCSS 0.05%
android-library ussd accessibility calling dialup dual-sim kotlin-library android overlay-widget bintray

voipussd's Introduction

VOIP USSD ANDROID

Platform API License Workflow Gitter Bintray Bintray Kotlin Android Arsenal Jitpack

Loved the tool? Please consider donating 💸 to help it improve!

sponsor voip android library

Usage    |    Extra Features    |    Cordova Plugin    |    Contributors

by Romell Dominguez

Target Development High Quality:

Jitpack

Interactive with ussd windows, remember the USSD interfaces depends on the System Operative and the manufacturer of Android devices.

Community Chat

Gitter

Downloads Dashboard

Data Studio

USSD LIBRARY

Implementations

Add the following dependency in your app's build.gradle configuration file:

Repository implementation Status
jcenter() 'com.romellfudi.ussdlibrary:ussd-library:1.1.i' DEPRECATED
jcenter() 'com.romellfudi.ussdlibrary:kotlin-ussd-library:1.1.k' DEPRECATED
maven { url https://jitpack.io } 'com.github.romellfudi.VoIpUSSD:ussd-library:1.4.a' READY
maven { url https://jitpack.io } 'com.github.romellfudi.VoIpUSSD:kotlin-ussd-library:1.4.a' READY
  • Writing a config xml file from here to res/xml folder (if necessary), this config file allow to link between Application and System Oerative:
<?xml version="1.0" encoding="utf-8"?>
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
    .../>

Application Permissions

To use the application, add the following permissions to your AndroidManifest.xml:

<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

Service Configuration

Include the service in your AndroidManifest.xml for Java:

<service
    android:name="com.romellfudi.ussdlibrary.USSDService"
    android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
    <intent-filter>
        <action android:name="android.accessibilityservice.AccessibilityService" />
    </intent-filter>
    <meta-data
        android:name="android.accessibilityservice"
        android:resource="@xml/ussd_service" />
</service>

Or for Kotlin:

<service
    android:name="com.romellfudi.ussdlibrary.USSDServiceKT"
    android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
    <intent-filter>
        <action android:name="android.accessibilityservice.AccessibilityService" />
    </intent-filter>
    <meta-data
        android:name="android.accessibilityservice"
        android:resource="@xml/ussd_service" />
</service>

NOTE: You may want to override android:notificationTimeout="0"to a corresponding value of 200 or avobe by copying the contents of @xml/ussd_service to the xml dir. Otherwise it is possible that the library will miss accessibility events during operation, resulting is unintended behaivours (e.g not reading up to date prompts #115 )

Usage Instructions

  1. Create a HashMap to identify USSD response messages for login and error scenarios:
KEY MESSAGE String Messages
KEY_LOGIN "espere", "waiting", "loading", "esperando", ...
KEY_ERROR "problema", "problem", "error", "null", ...

For Java:

Map<String, HashSet<String>> map = new HashMap<>();
map.put("KEY_LOGIN", new HashSet<>(Arrays.asList("espere", "waiting", "loading", "esperando")));
map.put("KEY_ERROR", new HashSet<>(Arrays.asList("problema", "problem", "error", "null")));

For Kotlin:

val map = HashMap<String, HashSet<String>>()
map["KEY_LOGIN"] = hashSetOf("espere", "waiting", "loading", "esperando")
map["KEY_ERROR"] = hashSetOf("problema", "problem", "error", "null")
  1. Instantiate a USSDController object and invoke a USSD code:

For Java:

USSDApi ussdApi = USSDController.getInstance(context);
ussdApi.callUSSDInvoke(phoneNumber, map, new USSDController.CallbackInvoke() {
    @Override
    public void responseInvoke(String message) {
        // Handle the USSD response
        String dataToSend = "data"; // Data to send to USSD
        ussdApi.send(dataToSend, new USSDController.CallbackMessage() {
            @Override
            public void responseMessage(String message) {
                // Handle the message from USSD
            }
        });
    }

    @Override
    public void over(String message) {
        // Handle the final message from USSD or error
    }
});

For Kotlin:

val ussdApi = USSDController.getInstance(context)
ussdApi.callUSSDOverlayInvoke(phoneNumber, map, object : USSDController.CallbackInvoke {
    override fun responseInvoke(message: String) {
        // Handle the USSD response
        val dataToSend = "data" // Data to send to USSD
        ussdApi.send(dataToSend) { responseMessage ->
            // Handle the message from USSD
        }
    }

    override fun over(message: String) {
        // Handle the final message from USSD or error
    }
})
  1. For custom message handling, structure your code as follows:

For Java:

// Example of selecting options from USSD menu
ussdApi.callUSSDInvoke(phoneNumber, map, new USSDController.CallbackInvoke() {
    ...
    // Select the first option
    ussdApi.send("1", new USSDController.CallbackMessage() {
        ...
        // Select the next option
        ussdApi.send("1", new USSDController.CallbackMessage() {
            ...
        });
    });
    ...
});

For Kotlin:

// Example of selecting options from USSD menu
ussdApi.callUSSDOverlayInvoke(phoneNumber, map, object : USSDController.CallbackInvoke {
    ...
    // Select the first option
    ussdApi.send("1") {
        ...
        // Select the next option
        ussdApi.send("1") {
            ...
        }
    }
    ...
})
  1. For dual SIM support, specify the SIM slot:

For Java:

ussdApi.callUSSDInvoke(phoneNumber, simSlot, map, new USSDController.CallbackInvoke() {
    ...
});

For Kotlin:

ussdApi.callUSSDOverlayInvoke(phoneNumber, simSlot, map, object : USSDController.CallbackInvoke {
    ...
});

Static Methods

For Android M and above, check permissions before invoking USSD:

// Check if accessibility permissions are enabled
ussdApi.verifyAccessibilityAccess(Activity);
// Check if overlay permissions are enabled
ussdApi.verifyOverlay(Activity);

Overlay Service Widget (Optional)

For Android O and above, use the OverlayShowingService to handle overlay permissions. Add the following permission to your AndroidManifest.xml:

<uses-permission android:name="android.permission.ACTION_MANAGE_OVERLAY_PERMISSION" />

SplashLoadingService

Add the service to your AndroidManifest.xml:

<service android:name="com.romellfudi.ussdlibrary.SplashLoadingService"
         android:exported="false" />

Start and stop the service around the USSD invocation:

For Java:

Intent svc = new Intent(activity, SplashLoadingService.class);
// Show the overlay
activity.startService(svc);
// Invoke USSD and handle responses
...
// Dismiss the overlay
activity.stopService(svc);

For Kotlin:

val svc = Intent(activity, SplashLoadingService::class.java)
// Show the overlay
activity.startService(svc)
// Invoke USSD and handle responses
...
// Dismiss the overlay
activity.stopService(svc)

Jitpack

EXTRA: Use Voip line

In this section leave the lines to call to Telcom (ussd number) for connected it:

ussdPhoneNumber = ussdPhoneNumber.replace("#", uri);
Uri uriPhone = Uri.parse("tel:" + ussdPhoneNumber);
context.startActivity(new Intent(Intent.ACTION_CALL, uriPhone));
ussdPhoneNumber = ussdPhoneNumber.replace("#", uri)
val uriPhone = Uri.parse("tel:$ussdPhoneNumber")
context.startActivity(Intent(Intent.ACTION_CALL, uri))

Once initialized the call will begin to receive and send the famous USSD windows

Cordova Plugin

Contributors ✨

All Contributors

Thanks goes to these wonderful people (emoji key):


Romell D.Z. 福迪

💻

Abdullahi Yusuf

💻

Mohamed Hamdy Hasan

💻

Mohamed Daahir

💻

Ramy Mokako

🔌

Md Mafizur Rahman

💻

License

GNU GPLv3 Image

VoIpUSSD is a Free Library Software: You can use, study share and improve it at your will. Specifically you can redistribute and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

voipussd's People

Contributors

abdelatifdz34 avatar abdullahicyc avatar contactboosttag avatar ducaale avatar imohamedhamdyi avatar khaled-0 avatar romellfudi avatar shadiqaust avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

voipussd's Issues

cancel() method doesn't seem to work

we are trying to close the ussd dialog using close() after receiving the first response but it doesn't seem to work. this is our invoke method:

ussdApi.callUSSDInvoke(phoneNumber, simSlot, responseMap, new USSDController.CallbackInvoke() {
            @Override
            public void responseInvoke(String message) {
				ussdResult += message + "\n";
				
                Log.d(TAG, "ussd request called: " + ussdResult);

		ussdApi.cancel();
            }

            @Override
            public void over(String message) {
		ussdApi.cancel();

                Log.d(TAG, "ussd request error: " + ussdResult);
            }
        });

what might be the cause?

Programatically close any dialog before running USSD

Hi , Thank you for this great package and sorry if i chose the wrong category for this issue.
I have issue with some USSD that already timed out(invalid mmi code or request timeout) but like 5seconds later the result of the USSD will appear on the screen, the result of the last USSD that is displayed on the screen(waiting for input) is however disturbing the new USSD to be dialed. Is there any way to programatically cancel any showing dialog before executing another USSD ???

Thanks

My app doesn't launches with flutter and platform channel

I am using flutter for develope my application so in order to use your kotlin plugin I am make a package and I am using paltform channel to communique with flutter. I have make done all step in documentation but when I am trying to launch my application that using my plugin that implement platform channel I got this error :
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
Android resource linking failed
ERROR:/home/xxxxxx/.gradle/caches/transforms-3/3756990bc045279d3b35f6e16f4a3570/transformed/jetified-kotlin-ussd-library-1.4.a/res/menu/menu_activity.xml:11: AAPT: error: attribute showAsAction (aka com.example.dev:showAsAction) not found.

Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

Screenshot at 2023-07-05 00-50-27

Load ussd data without show loading

Hi i was looking for a way to make silent ussd calls i found the google new telephonymanager.sendussdrequest which works fine but it doesn’t support apis lower than 27 is there anyway to make ussd requests without loading in lower apis and read the response even something like creating the whole app in a system overlay

A Lack of Coding

Required Prerequisites for filing a bug

Required information

  1. Steps to reproduce the problem
  2. A link to the notebook or markdown file where the error is occurring
  3. If the error is happening in GitHub Actions, a link to the specific error along with how you are able to reproduce this error. You must provide this in addition to the link to the notebook or markdown file.
  4. A screenshot / dump of relevant logs or error messages you are receiving from your local development environment. Instructions of running a local development server is provided in the development guide.

AAPT error after adding the implementation in app build.gradle file

So I add the following block to my build.gradle file:

repositories {
jcenter()
}

and then under dependencies, I add:

implementation 'com.romellfudi.ussdlibrary:ussd-library:1.1.i'

but after syncing, I get this error:

AGPBI: {"kind":"error","text":"error: attribute \u0027com.agict.voipussd:showAsAction\u0027 not found.","sources":[{"file":"/private/var/root/.gradle/caches/transforms-1/files-1.1/ussd-library-1.1.h.aar/28120cf25a73f1fef28d19fceab7322d/res/menu/menu_activity.xml","position":{"startLine":3}}],"original":"","tool":"AAPT"}

I have tried to proceed and added in the xml file, the permission requests, and the service in the manifest file. I hit Clean and Rebuild but to no avail.

[VoIpUSSD] Automated Upgrade

Opening this issue will trigger GitHub Actions to fetch the lastest version of VoIpUSSD. More information will be provided in forthcoming comments below.

Some problem configing

Hello,

Cool API, thank you!

Could you please edit the Readme file to include the correct way to add your library to my project.
I can't seem to understand what is the latestVersion to be added to:
implementation 'com.romellfudi.ussdlibrary:ussd-library:{latestVersion}'

Secondly, the examples are written sometimes in Java and the other times in Kotlin.
Please share the complete ways to use the library in every language seperatley.

Again, thanks for this awesome API you created, I've been looking for it for a long time.

Roy

Sim selection not working after update to android 10

Hello good day, the library Simslot selection used to work perfectly in my app while the android version was 9.0. But after I updated the phone to Android 10, the phone always uses Sim slot 1 irrespective of what Sim number I choose for the ussdApi. Kindly help me resolve this issue.

Problem with ussd

I download your app but I want to get information about service of LTE of my cellphone so I put *#11# and that doesnt work but it works when I put that ussd un my cell without app

a single value is passed several times using ussdapi three layer down

for example if i call
3 times it get the first and second value the third one is still the same passed in the second paramter
ussdApi.send("1",new USSDController.CallbackMessage(){
@OverRide
public void responseMessage(String message) {

                            ussdApi.send("397",new USSDController.CallbackMessage(){
                                @Override
                                public void responseMessage(String message) {

                                    ussdApi.send("4",new USSDController.CallbackMessage(){
                                        @Override
                                        public void responseMessage(String message) {

                                            ussdApi.send("4",new USSDController.CallbackMessage(){
                                                @Override
                                                public void responseMessage(String message) {

                                                    ussdApi.send("25580",new USSDController.CallbackMessage(){
                                                        @Override
                                                        public void responseMessage(String message) {

display.setText(message);

                                                        }
                                                    });
                                                }
                                            });

Oreo accessibility lifecycle issue

On android Oreo OnServiceConnected is only called when you toggle on accessibility service for the first time thus the app will only work once, If you want to make it work again you'll need to reboot your device or to disable accessibility and enable it again

Improvement of installation documentation

My request is just for the documentation. It's hard to install voipussd if we are a newbie in gradle as Android studio do all for us (regarding gradle)

So it will be nice perhaps to detail your documentation and explain briefly why to add each file where and how it is supposed to give an output

Additional context
Maybe describe for differents versions of android should be good. But I think it's too much complicated and unnecessary

Thanks for reading

how to make instance in kotlin ?

USSDApi ussdApi = USSDController.getInstance(context);

I tried var ussdApi : USSDApi = USSDController.instance

I am using USSDController.callUSSDInvoke(context .....
is this the way?

android:notificationTimeout 0 causes miss in events

2024-04-19 17:10:39.442 26099-26155 OpenGLRenderer          amrserver.android.ussddialer.debug   W  dequeueBuffer failed, error = -110; switching to fallback
2024-04-19 17:10:39.637 26099-26155 OpenGLRenderer          amrserver.android.ussddialer.debug   W  dequeueBuffer failed, error = -110; switching to fallback
2024-04-19 17:10:40.313 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug   D  EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363366055; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.ProgressDialog; Text: [USSD code running…]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:40.316 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug   D  EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363366103; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: com.android.phone.MMIDialogActivity; Text: [Phone Services]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:40.345 26099-26155 OpenGLRenderer          amrserver.android.ussddialer.debug   W  dequeueBuffer failed, error = -110; switching to fallback
2024-04-19 17:10:40.354 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug   D  EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363366188; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.ProgressDialog; Text: [USSD code running…]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:45.321 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug   D  EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363371178; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.AlertDialog; Text: [bKash
                                                                                                    1.Send Money
                                                                                                    2.Send Money to Non-bKash User
                                                                                                    3.Mobile Recharge
                                                                                                    4.Payment
                                                                                                    5.Cash Out
                                                                                                    6.Pay Bill
                                                                                                    7.Microfinance
                                                                                                    8.Download bKash App
                                                                                                    9.My bKash
                                                                                                    10.Reset PIN
                                                                                                     , CANCEL, SEND]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:45.323 26099-26099 onAccessibilityEvent    amrserver.android.ussddialer.debug   D  IS AN USSD
2024-04-19 17:10:45.427 26099-26099 in Not                  amrserver.android.ussddialer.debug   D  4
2024-04-19 17:10:45.428 26099-26099 notIT                   amrserver.android.ussddialer.debug   D  android.widget.TextView
2024-04-19 17:10:45.428 26099-26099 notIT                   amrserver.android.ussddialer.debug   D  android.widget.EditText
2024-04-19 17:10:45.428 26099-26099 notIT                   amrserver.android.ussddialer.debug   D  android.widget.Button
2024-04-19 17:10:45.428 26099-26099 notIT                   amrserver.android.ussddialer.debug   D  android.widget.Button
2024-04-19 17:10:45.429 26099-26099 in Not2                 amrserver.android.ussddialer.debug   D  4
2024-04-19 17:10:45.429 26099-26099 onAccessibilityEvent    amrserver.android.ussddialer.debug   D  YES Input
2024-04-19 17:10:45.430 26099-26099 Sending                 amrserver.android.ussddialer.debug   D  1
2024-04-19 17:10:45.485 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug   D  EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363371303; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.AlertDialog; Text: [bKash
                                                                                                    1.Send Money
                                                                                                    2.Send Money to Non-bKash User
                                                                                                    3.Mobile Recharge
                                                                                                    4.Payment
                                                                                                    5.Cash Out
                                                                                                    6.Pay Bill
                                                                                                    7.Microfinance
                                                                                                    8.Download bKash App
                                                                                                    9.My bKash
                                                                                                    10.Reset PIN
                                                                                                     , CANCEL, SEND]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:45.486 26099-26099 onAccessibilityEvent    amrserver.android.ussddialer.debug   D  IS AN USSD
2024-04-19 17:10:45.518 26099-26099 in Not                  amrserver.android.ussddialer.debug   D  0
2024-04-19 17:10:45.521 26099-26099 in Not2                 amrserver.android.ussddialer.debug   D  0
2024-04-19 17:10:45.522 26099-26099 onAccessibilityEvent    amrserver.android.ussddialer.debug   D  NOT INPUT
2024-04-19 17:10:45.547 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug   D  EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363371405; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.ProgressDialog; Text: [USSD code running…]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:46.961 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug   D  EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363372818; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.AlertDialog; Text: [Enter Receiver bKash Account No:
                                                                                                    , CANCEL, SEND]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:47.074 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug   D  EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363372932; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.AlertDialog; Text: [Enter Receiver bKash Account No:
                                                                                                    , CANCEL, SEND]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0

Look at the bottom parts
It fails to get latest screen contents from event

However
Setting android:notificationTimeout="500" or 200+ solves the issue in my case
https://stackoverflow.com/questions/45759236/why-onaccessibilityevent-method-of-accessibilityservice-is-reading-the-same

USSD Request throwing Exception

followed readme procedure, to make a USSD request even after giving accessibility and Phone permissions
exceptions is being thrown:

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxxx flg=0x10000000 cmp=com.android.server.telecom/.components.UserCallActivity (has extras) } from ProcessRecord{7f583ae 31356:com.example.ussd/u0a46} (pid=31356, uid=10046) with revoked permission android.permission.CALL_PHONE
at android.os.Parcel.createException(Parcel.java:2074)
at android.os.Parcel.readException(Parcel.java:2042)
at android.os.Parcel.readException(Parcel.java:1990)
at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:3973)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1716)
at android.app.Activity.startActivityForResult(Activity.java:5258)
at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:676)
at android.app.Activity.startActivityForResult(Activity.java:5216)

Interaction

This really not a bug, just a question.

Is it possible for VoIPUSSD to interact with client ? Like letting the user enter what he wants when the ussd interface appear in front of him instead of automatically writing response (ussdApi.send(data) function...)

Loop issues!

hi thanks for good work. i have problem hopefully you can help me.
when i call multi send menu it loop send 1->2->1->2
it not call to 1->2->3
thank for read my english not good

@OverRide
public void responseInvoke(String message) {
// first option list - select option 1
ussdController.send("1",new USSDController.CallbackMessage(){
@OverRide
public void responseMessage(String message) {
// second option list - select option 1
ussdController.send("2",new USSDController.CallbackMessage(){
@OverRide
public void responseMessage(String message) {
// opntion - select otion 2
ussdController.send("3",new USSDController.CallbackMessage(){
@OverRide
public void responseMessage(String message) {
...
}
}
});
}
});
}

Default Activity not found

Dear romelfudi,

I want to use your library into my project,
but when i insert your library into my dependencied, then what is caused my android studio say that
default activities doesnt found ? (i'd checked my androidmanifest, but i cant found the problem from my side)
please your help...

thank you
Capture

Failed to resolve: com.romellfudi

Hello,

When I try to add the library in dependencies, I get this error:

ERROR: Failed to resolve: com.romellfudi
Affected Modules: app

Any help

responseInvoke does not emit first line of message if it starts with a number

Hi thank you for your amazing work, I am trying to separate the message by new line but if the first line response starts with a number the responseInvoke() ignores the first line and then continue with the following line.

Example USSD Response:
Please choose promo
1 PromoSample1
2 PromoSample2

The response above works as expected but if the USSD response's first line has a number for example:
1 PromoSample1
2 PromoSample2

responseInvoke() will emit only "2 PromoSample2" and ignore "1 PromoSample1"

Screenshot

Ussd stop at first step

When I run the app for the first time the process work very good . But when I restart my app the process stop at the first step i don't understand.

Third Option not working

third option not working

ussdApi.callUSSDInvoke("*555#", map, new USSDController.CallbackInvoke() {

                @Override
                public void responseInvoke(String message) {
                    //

                    ussdApi.send("4",new USSDController.CallbackMessage(){
                        @Override
                        public void responseMessage(String message) {
                           
                            // second option list - select option 1
                            ussdApi.send("3",new USSDController.CallbackMessage(){
                                @Override
                                public void responseMessage(String message) {
                                    //
                                }
                            });

                          

                          


                        }
                    });
                    ussdApi.cancel();

                }



                @Override
                public void over(String message) {

        

                }




            });

rcursively creates callback

This is a simple response code

@OverRide
public void responseInvoke(String message) {
ussdApi.send("3",new USSDController.CallbackMessage(){
@OverRide
public void responseMessage(String message) {
Log.d("trim_log", "3 entered \n\n"+message);
}
});

what i want to loop 3 times(dynamic , it might be more) and to produce like below code using for loop

@OverRide
public void responseInvoke(String res) {
ussdApi.send("1",new USSDController.CallbackMessage(){
//
@OverRide
public void responseMessage(String ms) {
Log.d("trim_log", "1 entered");
//
ussdApi.send("2",new USSDController.CallbackMessage(){
//
@OverRide
public void responseMessage(String ms) {
Log.d("trim_log", "2 entered");
//
ussdApi.send("3",new USSDController.CallbackMessage(){
//
@OverRide
public void responseMessage(String ms) {
Log.d("trim_log", "3 entered");
});
});
});

}

???

App accessibility error

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxxxxxxxx flg=0x10000000 cmp=com.android.server.telecom/.components.UserCallActivity (has extras) }

this occurs after permission grant

Second time dialog stays open

When I run the app the first time everything works smooth. But when I run the app second-time USSD dialog stays open nothing is getting input

Cancel should set the `isRunning` flag to `false`

Issue:
I have a need to dial a bunch of USSDs. However, these USSDs will be canceled before the last step. The dialog is closed using the cancel() method provided. However, I noticed a weird issue. I am unable to dial a USSD manually after using the USSDController.

On checking the USSDService, I found that it is due to the isRunning flag not being updated.

Solution:

  1. Clicking the cancel method should close the dialog box and also update the isRunning flag as false.

I have considered alternatives

  1. Dialing a USSD first which will set the isRunning method to true. And then dialing the actual USSD that I had intended.
  2. Forking the repo.

Programmatically close dialog

Some USSD codes last response includes the input box which does not let the dialogs close after last response.

Can you please add an option to close dialog programmatically. Thanks

Not working in Android 13

In android 13, you can see a log of the result message in logcat from the ussd call but, the app still waits for a result and doesn't do anything.

Detecting failed

I am using OPPO Reno5.
Android version 13.
Here VoIpUSSD not working properly.
Dialing ok but feedback no given. I mean it can't send me feedback. It over or not or continue dialing.

Over method can't give me response properly on my this mobile. But on my other mobile its working fine and everything is ok

[VoIpUSSD] Automated Upgrade

Opening this issue will trigger GitHub Actions to fetch the lastest version of VoIpUSSD. More information will be provided in forthcoming comments below.

Lokk

Required Prerequisites for filing a bug

Required information

  1. Steps to reproduce the problem
  2. A link to the notebook or markdown file where the error is occurring
  3. If the error is happening in GitHub Actions, a link to the specific error along with how you are able to reproduce this error. You must provide this in addition to the link to the notebook or markdown file.
  4. A screenshot / dump of relevant logs or error messages you are receiving from your local development environment. Instructions of running a local development server is provided in the development guide.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.