HWZ Forums

Login Register FAQ Mark Forums Read

Question on Broadcast Reciever and Services on Android

Reply
 
LinkBack Thread Tools
Old 03-06-2019, 08:03 PM   #1
Senior Member
 
Join Date: Jul 2014
Posts: 1,063
Question on Broadcast Reciever and Services on Android

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

I am using Android 8.0 as a test device btw.


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.

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
twinbaby is offline   Reply With Quote
Reply
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ. Forum members and moderators are responsible for their own posts.

Please refer to our Terms of Service for more information.


Thread Tools

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On