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

The Android client does not start #65

Closed
theprogrammer67 opened this issue Dec 6, 2017 · 23 comments
Closed

The Android client does not start #65

theprogrammer67 opened this issue Dec 6, 2017 · 23 comments

Comments

@theprogrammer67
Copy link

The Android client does not start. No notifications on the phone screen
Android version - 6 and 7
Can I run it manually?

2017-12-06 15:35:24.367 INFO Main: Checking gnirehtet client...
2017-12-06 15:35:24.493 INFO Main: Starting relay server...
2017-12-06 15:35:24.493 INFO Main: Starting client...
2017-12-06 15:35:24.496 INFO Relay: Relay server started
Broadcasting: Intent { act=com.genymobile.gnirehtet.START cmp=com.genymobile.gnirehtet/.GnirehtetControlReceiver }
Broadcast completed: result=0

@rom1v
Copy link
Collaborator

rom1v commented Dec 6, 2017

What is the result of:

adb shell dumpsys package com.genymobile.gnirehtet | grep version

?

What if you adb reinstall?

@theprogrammer67
Copy link
Author

    versionCode=4 targetSdk=26
    versionName=2.1

@theprogrammer67
Copy link
Author

theprogrammer67 commented Dec 6, 2017

What if you adb reinstall?

I did not understand (

@theprogrammer67
Copy link
Author

with adb is not installed. Installed manually. Perhaps that's why it does not start?

2017-12-06 16:10:43.547 INFO Main: Installing gnirehtet client...
gnirehtet.apk: 1 file pushed. 0.5 MB/s (20616 bytes in 0.038s)
        pkg: /data/local/tmp/gnirehtet.apk
Failure [INSTALL_CANCELED_BY_USER]

@rom1v
Copy link
Collaborator

rom1v commented Dec 6, 2017

Sorry, I meant: what if you gnirehtet reinstall? :)

@theprogrammer67
Copy link
Author

theprogrammer67 commented Dec 6, 2017

Probably the Chinese are paranoid.
XIAOMI: I could not turn on the USB installation
https://stackoverflow.com/questions/37641670/adb-install-failure-install-canceled-by-user

@theprogrammer67
Copy link
Author

I think the reason is this

@theprogrammer67
Copy link
Author

is it possible to start the service from the phone?

@rom1v
Copy link
Collaborator

rom1v commented Dec 6, 2017

is it possible to start the service from the phone?

No.

@casper
Copy link

casper commented Dec 24, 2017

I have the same problem. I installed the APK manually by copying it over to the phone.

It seems to be installed fine. This is the output of the dumpsys command:
https://gist.github.com/casper/0a92e9a9b40458822cca855ce04f01bf

Shouldn't it be working this way too? When I run the START command the output is:

Broadcasting: Intent { act=com.genymobile.gnirehtet.START }
Broadcast completed: result=0

Does this mean it's running as it should? I still can't connect anywhere though.
Any way to debug this further to try and figure out the problem?

@rom1v
Copy link
Collaborator

rom1v commented Dec 29, 2017

Does this mean it's running as it should?

It should open a dialog asking permission for VPN. Did you try this command when the screen was on?

@casper
Copy link

casper commented Dec 30, 2017

It should open a dialog asking permission for VPN. Did you try this command when the screen was on?

Yes, with screen on. It never shows the VPN dialog, and it hasn't registered itself as a VPN in the Android settings either. Using the Java version on the computer btw, if that matters.

@rom1v
Copy link
Collaborator

rom1v commented Dec 30, 2017

Are there any relevant logs in the output of adb logcat when you start gnirehtet?

@casper
Copy link

casper commented Dec 30, 2017

Seems this might be relevant:

12-30 11:06:27.170 18777 18777 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
12-30 11:06:27.176 18777 18777 D AndroidRuntime: CheckJNI is OFF
12-30 11:06:27.216 18777 18777 D ICU     : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
12-30 11:06:27.253 18777 18777 E HAL     : Dawei load: module=/system/lib64/hw/memtrack.msm8937.so
12-30 11:06:27.257 18777 18777 I Radio-JNI: register_android_hardware_Radio DONE
12-30 11:06:27.291 18777 18777 D AndroidRuntime: Calling main entry com.android.commands.am.Am
12-30 11:06:27.321  1283  1329 D com.android.server.pm.PackageManagerServiceInjector: MIUILOG- permission denied android.permission.WRITE_SECURE_SETTINGS
12-30 11:06:27.321  1283  1329 W BroadcastQueue: Permission Denial: broadcasting Intent { act=com.genymobile.gnirehtet.START flg=0x10 cmp=com.genymobile.gnirehtet/.GnirehtetControlReceiver } from null (pid=18777, uid=2000) requires android.permission.WRITE_SECURE_SETTINGS due to receiver com.genymobile.gnirehtet/.GnirehtetControlReceiver
12-30 11:06:27.323 18777 18777 D AndroidRuntime: Shutting down VM

@rom1v
Copy link
Collaborator

rom1v commented Dec 30, 2017

@casper

Permission Denial: broadcasting Intent { act=com.genymobile.gnirehtet.START flg=0x10 cmp=com.genymobile.gnirehtet/.GnirehtetControlReceiver } from null (pid=18777, uid=2000) requires android.permission.WRITE_SECURE_SETTINGS due to receiver com.genymobile.gnirehtet/.GnirehtetControlReceiver

Then see this issue.

@casper
Copy link

casper commented Dec 30, 2017

Thanks. I solved it through #40 by editing the APK file and removing the permission requirement.

I did it this way because you cannot set elevated USB permissions on any new Xiaomi MIUI phone without requesting special permissions from Xiaomi. At least I was not able to do it on my phone. Works fine now :) Thanks for your help.

@rom1v rom1v closed this as completed Dec 30, 2017
@rom1v rom1v reopened this Dec 30, 2017
@rom1v
Copy link
Collaborator

rom1v commented Dec 30, 2017

@theprogrammer67 does it also solve your problem?

@theprogrammer67
Copy link
Author

I remove the android:permission="android.permission.WRITE_SECURE_SETTINGS" line from AndroidManifest.xml file. And now everything works on XIAOMI

@theprogrammer67
Copy link
Author

Happy New Year! ))

@solokiran
Copy link

solokiran commented Nov 27, 2018

I have removed the said permission. here's the apk for v2.3 for XIAOMI that I am using

https://github.com/solokiran/hello-world/blob/master/gnirehtet2.apk

@abhinandan2
Copy link

For others who might stumble upon here, on XIOMI phones, I had similar problem. By using logcat, I was able to find out that I need to allow the app to autostart in Security Center, and then it worked perfectly :). Thank you @rom1v 👍

@dodyirawan85
Copy link

I have removed the said permission. here's the apk for v2.3 for XIAOMI that I am using

https://github.com/solokiran/hello-world/blob/master/gnirehtet2.apk

Thank you, worked on color os 5 too

@anandumdas
Copy link

For Xiaomi devices you can enable USB debugging(Security settings) from developer options. It is there below the USB debugging option. No need to change the APK

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

No branches or pull requests

7 participants