Genymobile / gnirehtet

Gnirehtet provides reverse tethering for Android
Apache License 2.0
6.3k stars 579 forks source link

Can start app on Android 11 / Samsung S20 FE #359

Open JeffreyDraaijer opened 3 years ago

JeffreyDraaijer commented 3 years ago

Hi,

Running the command gnirehtet start and gnirehtet run doesn't start the application on my Android device. The command being executed as mentioned in the documentation: "adb shell am start -a com.genymobile.gnirehtet.START \ -n com.genymobile.gnirehtet/.GnirehtetActivity".

Changing the command to: "adb shell "am start -n com.genymobile.gnirehtet/.GnirehtetActivity -a com.genymobile.gnirehtet.START"" does work for my Android device.

I don't know if this is an issue, but wanted to let you know.

Cheers, Jeffrey

rom1v commented 3 years ago

Running the command gnirehtet start and gnirehtet run doesn't start the application on my Android device.

Which Android version? So the only thing you change is the order of the -n ... and -a ... parameter, or the double-quote " change is significant?

Could you please post the logcat when you do that?

adb logcat -c  # clear
adb shell am start -a com.genymobile.gnirehtet.START -n com.genymobile.gnirehtet/.GnirehtetActivity
adb logcat -d logcat.txt

Then post the logcat.

JeffreyDraaijer commented 3 years ago

Hi Romain,

Running the command like the below gives me an error.

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

But running the same command without the break line it works:

adb shell am start -a com.genymobile.gnirehtet.START -n com.genymobile.gnirehtet/.GnirehtetActivity
rom1v commented 3 years ago

Oh yes, that's expected.

If you want to break a line, you need a \ in shell:

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

(oh ok I did a copy-paste which included a newline in my previous message, I fixed it)

rom1v commented 3 years ago

So:

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

works, but ./gnirehtet start does not? What's the output?

JeffreyDraaijer commented 3 years ago

The output is

gnirehtet start
2021-02-09 15:53:18.779 I Gnirehtet: Checking gnirehtet client...

We should expect: Starting: Intent { act=com.genymobile.gnirehtet.START cmp=com.genymobile.gnirehtet/.GnirehtetActivity }

gnirehtet stop
2021-02-09 15:53:59.489 I Gnirehtet: Stopping client...
Starting: Intent { act=com.genymobile.gnirehtet.STOP cmp=com.genymobile.gnirehtet/.GnirehtetActivity }
rom1v commented 3 years ago

2021-02-09 15:53:18.779 I Gnirehtet: Checking gnirehtet client...

Could you execute:

adb shell dumpsys package com.genymobile.gnirehtet
JeffreyDraaijer commented 3 years ago

2021-02-09 15:53:18.779 I Gnirehtet: Checking gnirehtet client...

Could you execute:

adb shell dumpsys package com.genymobile.gnirehtet

Sure, what information do you need from the output?

rom1v commented 3 years ago

None, it's just where it seems it is blocked when you call gnirehtet start:

https://github.com/Genymobile/gnirehtet/blob/f5c0710c751f7ca82ce413058abc57d9af7208c3/relay-rust/src/main.rs#L538-L542

JeffreyDraaijer commented 3 years ago

That command is working without a problem. For the time I've created my own .cmd file and it's running the following commands.

@adb reverse localabstract:gnirehtet tcp:31416
@adb shell dumpsys package com.genymobile.gnirehtet
@adb shell "am start -a com.genymobile.gnirehtet.START -n com.genymobile.gnirehtet/.GnirehtetActivity"
@java -jar gnirehtet.jar relay 
@pause