• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Service and the Broadcast

xracerx

Lurker
Hi there,

I have issues with android services and broadcast activity when doing some development.

I am using Android 8.0 as a test device btw.

Code:
serviceIntent.setComponent(new ComponentName("com.service.sillyservice", "com.service.sillyservice.SillyService"));
serviceIntent.putExtra("COMMAND","ls");
startService(serviceIntent);

Assuming it will invoke the start service from another activity:
public int onStartCommand(Intent var1, int var2, int var3) {

its return value is "1", how do I get the value of "1" and store it some where.


Code:
        broadcastIntent.setComponent(new ComponentName("com.broadcast.vulnerablereceiver", "com.elearnsecurity.vulnerablereceiver.VulnerableReceiver"));
                    broadcastIntent.setAction("com.broadcast.vulnerablereceiver.CHANGEPW");
                    broadcastIntent.putExtra("PASSWORD",1);

I am trying to mirror the same here:
run app.broadcast.send --action com.broadcast.vulnerablereceiver.CHANGEPW" --component com.broadcast.vulnerablereceiver com.broadcast.vulnerablereceiver.VulnerableReceiver --extra string PASSWORD 1

However, for some it show something like:
Unable to start receiver com.broadcast.vulnerablereceiver.VulnerableReceiver: java.lang.NullPointerException: println needs a message
 
Back
Top Bottom