Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broadcast returned 0 #227

Closed
palmier3 opened this issue Sep 21, 2019 · 38 comments
Closed

Broadcast returned 0 #227

palmier3 opened this issue Sep 21, 2019 · 38 comments
Labels

Comments

@palmier3
Copy link

palmier3 commented Sep 21, 2019

Hello everyone.
I already know about the #117 and some others issues that are related. Whoever that issues did not solve the problem for me.

My computer: I am on fedora 27, running adb 1.0.40.
My phone: wiko lenny 3, android 6, usb debug enabled. Other software requiring android 5 works properly (scrcpy)
Gnirehtet version: rust binary, gnirehtet-rust-linux64-v2.3

The error:

2019-09-21 13:37:23.590 INFO Main: Starting relay server...
2019-09-21 13:37:23.590 INFO Main: Checking gnirehtet client...
2019-09-21 13:37:23.590 INFO Relay: Relay server started
2019-09-21 13:37:23.664 INFO Main: Starting client...
Broadcasting: Intent { act=com.genymobile.gnirehtet.START cmp=com.genymobile.gnirehtet/.GnirehtetControlReceiver }
Broadcast completed: result=0

The first run of gnirehtet correctly install the apk on the phone:

gnirehtet.apk: 1 file pushed. 0.6 MB/s (21564 bytes in 0.035s)
	pkg: /data/local/tmp/gnirehtet.apk
Success

The output of adb logcat by running adb logcat -c -> ./gnirehtet run -> adb logcat -d :

01-01 02:31:22.922   832  3168 V ActivityManager: Broadcast: Intent { act=com.genymobile.gnirehtet.START flg=0x10 cmp=com.genymobile.gnirehtet/.GnirehtetControlReceiver } ordered=true userid=-2 callerApp=null

01-01 02:31:22.923   832  3168 D LRRejector:  isLowMemory isBackgroundAppEn=false, packageName=com.genymobile.gnirehtet
01-01 02:31:22.923   832  3168 D LRRejector: isShouldReject broadcast packageName=com.genymobile.gnirehtet , isAlowwAppflag =false ,islowramnow=true , isAboutForegroudApp = false , success=true

These are the only lines in the log regarding gnirehtet. The connection doesn't work and the confirmation popup didn't show up.

What I tried (in mixed order)

  • ./gnirehtet reinstall
  • reboot phone (after reinstall)
  • kill adb server and restart adb
  • browse the web regardless of the missing confirmation prompt
@rom1v
Copy link
Collaborator

rom1v commented Sep 21, 2019

Could you try building the current master branch, please?

It contains this commit: f868180

@palmier3
Copy link
Author

Thanks for the fast reply.
Sorry I missed the fact that the commit wasn't already in the release 2.3.
I never used rust nor I have the tools installed on my computer but I'll give it a try. It is possible it will take some time though.
Thank you.

@amosbird
Copy link

Hmm, I'm experiencing the same error now after updating to HEAD

@rom1v
Copy link
Collaborator

rom1v commented Sep 24, 2019

You need to uninstall and reinstall the version you built from master. If you get a "broadcast" log, then you don't use the last version.

@amosbird
Copy link

I did uninstall and reinstall, still no "broadcast" log in adb log

@rom1v
Copy link
Collaborator

rom1v commented Sep 24, 2019

still no "broadcast" log in adb log

Ah, so it's not the same error as this issue! If you don't have any broadcast logs, it's good.

What output do you get?

@amosbird
Copy link

amosbird commented Sep 24, 2019

nothing, adb logcat doesn't print new stuff when doing adb shell am broadcast -a com.genymobile.gnirehtet.START -n com.genymobile.gnirehtet/.GnirehtetControlReceiver

@rom1v
Copy link
Collaborator

rom1v commented Sep 24, 2019

adb shell am broadcast -a com.genymobile.gnirehtet.START -n com.genymobile.gnirehtet/.GnirehtetControlReceiver

Why are you doing this?

What happens if you ./gnirehtet run?

@amosbird
Copy link

Why are you doing this?

It's for debugging

What happens if you ./gnirehtet run?

it hangs after printing Broadcast returned 0

@rom1v
Copy link
Collaborator

rom1v commented Sep 24, 2019

it hangs after printing Broadcast returned 0

You don't use the master version if you get this message. How did you build it?

@amosbird
Copy link

for apk I did ./gradlew assembleDebug and for rust binary I did cargo build

@amosbird
Copy link

heh, weird, I'll investigate. The right command should be

adb shell am start -a com.genymobile.gnirehtet.START -n com.genymobile.gnirehtet/.GnirehtetActivity

@amosbird
Copy link

Heh, forget to use cargo build --release ....

@palmier3
Copy link
Author

Glad someone could actually try and compile since I really don't have time plus I never installed rust on my machine and it would take some time to get all the tools (running old fedora -> no more updated packages in the repositories).
@amosbird if you can confirm it worked after compiling properly I'll trust it works for me too and close the issue.
@rom1v if I may ask: do you know when this fix will be available in the binary release? Thanks.

@amosbird
Copy link

yeah it works fine

@rom1v
Copy link
Collaborator

rom1v commented Sep 26, 2019

do you know when this fix will be available in the binary release? Thanks.

I don't know. I am not able to build the Windows version right now (rust-lang/rust#48272), and there are few others things I'd like to do before a release.

running old fedora

For linux, here is a build on current master:
gnirehtet-rust-linux64-v2.3-19-g2a22b30.zip
SHA256: ae7d45bfbddb3afa5784d4dc94324ec0234e44d4185ed64cabb7b6c23177338c

Don't forget to ./gnirehtet uninstall beforehand.

@ErvinJohnEstrera
Copy link

do you know when this fix will be available in the binary release? Thanks.

I don't know. I am not able to build the Windows version right now (rust-lang/rust#48272), and there are few others things I'd like to do before a release.

running old fedora

For linux, here is a build on current master:
gnirehtet-rust-linux64-v2.3-19-g2a22b30.zip
SHA256: ae7d45bfbddb3afa5784d4dc94324ec0234e44d4185ed64cabb7b6c23177338c

Don't forget to ./gnirehtet uninstall beforehand.

Sir please provide a latest build on current master on windows too please, because I don't have any installed tool for building. This is very helpful to me because I can only update my apps thru my work pc because I don't have unlimited data at home. thanks!

@rom1v
Copy link
Collaborator

rom1v commented Sep 26, 2019

Sir please provide a latest build on current master on windows too please

For now, I can't:

I am not able to build the Windows version right now (rust-lang/rust#48272)

I need to fix (or workaround) this issue too.

@ErvinJohnEstrera
Copy link

Sir please provide a latest build on current master on windows too please

For now, I can't:

Ok sir, thanks for the reply. I will patiently wait for the update and for now I will go back to PIE until you release a new one. Thanks!

@palmier3
Copy link
Author

Thank @rom1v !
It works now. I have wanted this feature (without actually installing apps from the store) for a long time
Thank you for your work.

@rom1v
Copy link
Collaborator

rom1v commented Nov 13, 2019

Here is a build for current master (e87f7e6):

Do not forget to execute ./gnirehtet uninstall before testing it.

Consider it as a release candidate :) Feedbacks welcome.

@A-Fat-Duck
Copy link

Here is a build for current master (e87f7e6):

Do not forget to execute ./gnirehtet uninstall before testing it.

Consider it as a release candidate :) Feedbacks welcome.

Thanks, can confirm the win64 version works on my Oneplus 6T running A10

@rom1v
Copy link
Collaborator

rom1v commented Nov 15, 2019

Thank you for your feedback 👍

@ErvinJohnEstrera
Copy link

This is to confirm that it is now fully working on android 10 in all my devices, locked or unlocked bootloader. Thank you!

@aqshalfajarputra
Copy link

aqshalfajarputra commented Nov 15, 2019

Here is a build for current master (e87f7e6):

Do not forget to execute ./gnirehtet uninstall before testing it.

Consider it as a release candidate :) Feedbacks welcome.

Sorry, but my devices still can't pop up the vpn prompt.
I'm using Ubuntu 19.04
Devices : Realme X (ColorOS 6)

Starting: Intent { act=com.genymobile.gnirehtet.START cmp=com.genymobile.gnirehtet/.GnirehtetActivity }
Security exception: Permission Denial: starting Intent { act=com.genymobile.gnirehtet.START flg=0x10000000 cmp=com.genymobile.gnirehtet/.GnirehtetActivity } from null (pid=8540, uid=2000) requires android.permission.WRITE_SECURE_SETTINGS

java.lang.SecurityException: Permission Denial: starting Intent { act=com.genymobile.gnirehtet.START flg=0x10000000 cmp=com.genymobile.gnirehtet/.GnirehtetActivity } from null (pid=8540, uid=2000) requires android.permission.WRITE_SECURE_SETTINGS
	at com.android.server.am.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1953)
	at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:1244)
	at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:684)
	at com.android.server.am.ActivityStarter.startActivityMayWait(ActivityStarter.java:2287)
	at com.android.server.am.ActivityStarter.execute(ActivityStarter.java:625)
	at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:6002)
	at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:5976)
	at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:479)
	at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:161)
	at android.os.ShellCommand.exec(ShellCommand.java:103)
	at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:18957)
	at android.os.Binder.shellCommand(Binder.java:634)
	at android.os.Binder.onTransact(Binder.java:532)
	at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3512)
	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3801)
	at com.android.server.am.OppoActivityManagerService.onTransact(OppoActivityManagerService.java:775)
	at android.os.Binder.execTransact(Binder.java:731)

@rom1v
Copy link
Collaborator

rom1v commented Nov 15, 2019

@aqshalfajarputra This is a separate issue, see #5.

@aqshalfajarputra
Copy link

aqshalfajarputra commented Nov 15, 2019

@aqshalfajarputra This is a separate issue, see #5.

Thankyou!

@timea-techgirl
Copy link

Does gnirehtet update the apk automatically? I got an error opening the new version. I uninstalled the older apk from my phone and restarted gnirehtet, it worked fine.

@rom1v
Copy link
Collaborator

rom1v commented Nov 16, 2019

It updates the apk automatically only if the version number is different. The version number is only incremented on new release.

@timea-techgirl
Copy link

On android 6.0, this version is buggy, it was fine yesterday. Today, it kept giving me Error: Can't start main broadcast or something. I tried force-stopping the apk, reconnecting the phone, killing adb server...etc. Nothing worked. I had to revert to the release 2.3 version. Replaced with this version and it worked smoothly.

@rom1v
Copy link
Collaborator

rom1v commented Nov 17, 2019

Error: Can't start main broadcast or something.

On this version, there is no broadcast anymore. If you have such errors messages, then either the device part or the client part is the old version.

Did you ./gnirehtet uninstall?

@timea-techgirl
Copy link

I will reproduce the error again.

@sebas22
Copy link

sebas22 commented Nov 18, 2019

You asked feedback, so here is one :
I had broadcast 0 and no VPN pop-up with a version that was previously working.
After upgrading to the binaries you've put on your msg from 13th nov., (uninstall apk then install new one), I had the VPN popup, but no connexion. I made a gnirehtet restart then autorun, then I could connect, everythg is OK now.
A huge thanks for this very usefull soft !!!

@lumoe
Copy link

lumoe commented Nov 18, 2019

Here is a build for current master (e87f7e6):

* [`gnirehtet-java.zip`](https://tmp.rom1v.com/gnirehtet/issue227/1/gnirehtet-java-v2.3-24-ge87f7e6.zip) _SHA256: e745a740d5ec2e135b45feeb3422281f53060ae15cd03dd33bf86e6f69caf87b_

* [`gnirehtet-rust-linux64.zip`](https://tmp.rom1v.com/gnirehtet/issue227/1/gnirehtet-rust-linux64-v2.3-24-ge87f7e6.zip) _SHA256: 1970d1b83935f7976d125fe4910d0da1895e409b942da8e7fbe28aa0639fb8c1_

* [`gnirehtet-rust-win64.zip`](https://tmp.rom1v.com/gnirehtet/issue227/1/gnirehtet-rust-win64-v2.3-24-ge87f7e6.zip) _SHA256: 0770f1e25ddaaca9f792efd160a0c1b2f1e355fc597f898d4f428369ce6e82ec_

Do not forget to execute ./gnirehtet uninstall before testing it.

Consider it as a release candidate :) Feedbacks welcome.

New build works on OnePlus 7T running Android 10.
Thank you

@rom1v
Copy link
Collaborator

rom1v commented Nov 18, 2019

Thank you for all your feedbacks.

I just released v2.4.

@jesanabriah
Copy link

jesanabriah commented Apr 23, 2020

I compiled with the dev branch and it worked perfectly, thank you very much.
Asus X00RD, Android 8

@strangersth
Copy link

#227 (comment)

Hey there i am having same issue. Previously it used to work but now idk what happened suddenly. I uninstalled and reinstalled again still no luck.
Following error is shown.

image

@rom1v
Copy link
Collaborator

rom1v commented Jul 25, 2021

I think you use an old version of gnirehtet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests