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

Add workaround for Samsung devices #6

Open
ShapeShifter499 opened this issue Jan 13, 2023 · 30 comments
Open

Add workaround for Samsung devices #6

ShapeShifter499 opened this issue Jan 13, 2023 · 30 comments

Comments

@ShapeShifter499
Copy link

ShapeShifter499 commented Jan 13, 2023

Due to some issue with the way samsung devices handles things. Unsure what exactly if I'm being honest ANDROID_NO_USE_FWMARK_CLIENT=1 fakeroot is needed to run termux-adb or adb in general through termux. Initially I didn't need it but now I notice it fails if I don't use that. I'm wondering if it would be possible to add some sort of detection for Samsung devices and have that automatically appended?

If not at least add a footnote to the readme about it.

EDIT:Fold 4 user

@nohajc
Copy link
Owner

nohajc commented Jan 15, 2023

Thanks for the report. I don't own any Samsung device, so I had no idea. Before I decide what to do about it, I'd like to understand more how this even works.

I already found some information but if you have any useful resources, you're welcome to share them.

@RohitVerma882
Copy link

I haven't tried but I'm just asking,
doesn't this work on all Samsung devices?
Can this problem be solved by patching adb? Or is there no other solution other than fakeroot?

@nohajc
Copy link
Owner

nohajc commented Jul 11, 2023

I don't really know... Haven't got around to investigate this further.

@CamsShaft
Copy link

I'm using an S22 SM-S901W Snapdragon on android 14. Whenever I type in termux-adb it seems to be working. I'm still doing some research for my S10 G973U which is also Snapdragon android 12 and don't want to screw anything up. Haven't even plugged it in yet so here's hoping it's good news... Feel free to throw some advice my way since I don't even know if it'll work at all. All I want for Christmas is my OEM and bootloader unlocked!

@Zorono
Copy link

Zorono commented Apr 28, 2024

I can't run it anyway on my phone (Samsung A24 - Android 14)...

CANNOT LINK EXECUTABLE "termux-adb": cannot locate symbol "_ZN6google8protobuf8internal8TcParser15GenericFallbackEPNS0_11MessageLiteEPKcPNS1_12ParseContextENS1_11TcFieldDataEPKNS1_16TcParseTableBaseEm" referenced by "/data/data/com.termux/files/usr/bin/termux-adb"...

@nohajc
Copy link
Owner

nohajc commented Apr 28, 2024

This looks unrelated to Samsung. Do you have the latest version running? It's possible I'll need to do a new build. This linking issue happens from time to time when Termux updates the protobuf library.

@CamsShaft
Copy link

I can't run it anyway on my phone (Samsung A24 - Android 14)...

CANNOT LINK EXECUTABLE "termux-adb": cannot locate symbol "_ZN6google8protobuf8internal8TcParser15GenericFallbackEPNS0_11MessageLiteEPKcPNS1_12ParseContextENS1_11TcFieldDataEPKNS1_16TcParseTableBaseEm" referenced by "/data/data/com.termux/files/usr/bin/termux-adb"...

"pkg install android-tools" don't forget to split screen the first time you connect. Also after you do "adb pair ip:port pairing code" you have to run "adb connect ip:port". Every time after that all you need to do is turn on wireless debugging and "adb connect ip:port"

@CamsShaft
Copy link

Sorry @nohajc. Don't mean to step on any toes here, just trying to help. Rish is pretty easy to use to get a shell too

@nohajc
Copy link
Owner

nohajc commented Apr 28, 2024

I can't run it anyway on my phone (Samsung A24 - Android 14)...

CANNOT LINK EXECUTABLE "termux-adb": cannot locate symbol "_ZN6google8protobuf8internal8TcParser15GenericFallbackEPNS0_11MessageLiteEPKcPNS1_12ParseContextENS1_11TcFieldDataEPKNS1_16TcParseTableBaseEm" referenced by "/data/data/com.termux/files/usr/bin/termux-adb"...

"pkg install android-tools" don't forget to split screen the first time you connect. Also after you do "adb pair ip:port pairing code" you have to run "adb connect ip:port". Every time after that all you need to do is turn on wireless debugging and "adb connect ip:port"

I don't think the issue has anything to do with wireless debugging either. You should be able to use termux-adb for normal USB debugging.

These linking errors usually appear when there's an update of termux dependencies and it just means I have to compile my code again. Unfortunately, google's protocol buffer C++ library doesn't keep any binary compatibility.

@nohajc
Copy link
Owner

nohajc commented Apr 28, 2024

Anyway, this time I cannot reproduce it. I just did pkg upgrade and I'm running termux-adb 0.2.2-1 without issue.

@Zorono
Copy link

Zorono commented Apr 28, 2024

Anyway, this time I cannot reproduce it. I just did pkg upgrade and I'm running termux-adb 0.2.2-1 without issue.

i tried turning off 'Auto Blocker' (incase it is a security layer related issue) but it didn't help either...

Termux version: v0.118.0+8e3a898

@nohajc
Copy link
Owner

nohajc commented Apr 28, 2024

Is this some beta or a custom build?

When I run termux-info I get

TERMUX_VERSION=0.118.0

@Zorono
Copy link

Zorono commented Apr 29, 2024

Is this some beta or a custom build?

When I run termux-info I get

TERMUX_VERSION=0.118.0

a debug build from GitHub actions' artifact of commit 8e3a898

@nohajc
Copy link
Owner

nohajc commented Apr 29, 2024

That will be the problem. The way I build and release the package now, I can only support one revision at a time. That means it works with the current stable but it will most likely stop working soon as the changes you're building against make it to a release. At that point I'll make sure I update my repo too.

You'd basically have to do your own termux-adb build to have it running now. I'm not happy about the situation but unfortunately didn't have time to come up with a proper solution yet.

If termux-adb became part of the official Termux repository, it would solve all these issues. I didn't have such ambition so far though...

@huynhtanloc2612
Copy link

Hi @nohajc ,
Thanks for making termux-adb which is what I am looking for a while.
Is there any update on the release. I have just installed it which version is 0.2.1-3 on my Samsung phone (S22 Ultra - Android 14) and I see the similar error.
CANNOT LINK EXECUTABLE "termux-adb": cannot locate symbol "_ZN6google8protobuf11MessageLite15ParseFromStringEN4absl12lts_2023080211string_viewE" referenced by "/data/data/com.termux/files/usr/bin/termux-adb"...

@nohajc
Copy link
Owner

nohajc commented May 12, 2024

Hi, I'm going to look into it.

@nohajc
Copy link
Owner

nohajc commented May 12, 2024

Ok, first, apologies for any confusion as I was previously referring to version 0.2.2-1 which is in fact not released.

I did however try with 0.2.1-3 and stable Termux (after pkg upgrade) and it doesn't give me the linker error.

Can you verify you're running Termux from F-Droid and not any custom build?

Also, which version of libprotobuf do you have?

It should be

$ pkg show libprotobuf
Package: libprotobuf
Version: 2:25.1
Maintainer: @termux

@huynhtanloc2612
Copy link

Yes, I am using official Termux app from F-Droid
And libprotobuf version is shown below:

Version: 2:25.1-1
Maintainer: @termux
Installed-Size: 6943 kB
Depends: abseil-cpp, libc++, zlib
Breaks: libprotobuf-dev, protobuf-static (<< 25.1)
Replaces: libprotobuf-dev
Homepage: https://github.com/protocolbuffers/protobuf
Download-Size: 1087 kB
APT-Manual-Installed: no
APT-Sources: https://termux.librehat.com/apt/termux-main stable/main aarch64 Packages
Description: Protocol buffers C++ library```

@nohajc
Copy link
Owner

nohajc commented May 12, 2024

Ok, turned out I was using a different repository mirror which wasn't exactly up to date. I switched to the official one, upgraded and now I can replicate your issue.

I'll make a new build ASAP. Thanks for reporting!

@nohajc
Copy link
Owner

nohajc commented May 12, 2024

@huynhtanloc2612 Try to upgrade now. Version 0.2.1-4 should fix the problem.

@huynhtanloc2612
Copy link

@huynhtanloc2612 Try to upgrade now. Version 0.2.1-4 should fix the problem.

Great! Previous problem was fixed. There is no error now. I will do more tests with usb cable tomorrow (because I don't have any cable with me now) and let you know if it is ok.
Thank you very much for your very fast support.

@nohajc
Copy link
Owner

nohajc commented May 12, 2024

I made another release (this time really 0.2.2) which should improve stability (i.e. things won't break every time Termux upgrades the problematic dependencies).

@huynhtanloc2612
Copy link

@huynhtanloc2612 Try to upgrade now. Version 0.2.1-4 should fix the problem.

Great! Previous problem was fixed. There is no error now. I will do more tests with usb cable tomorrow (because I don't have any cable with me now) and let you know if it is ok. Thank you very much for your very fast support.

I have just tested with cable and saw that termux-adb (v0.2.1-4) could detect and connect with other devices successfully and adb commands work correctly.
However, it took quite long time (around 30 seconds) from connecting the devices (phones) with usb cable to the time I could see connected devices appeared as a result of termux-adb devices command. Is it the issue or limitation? Thanks.

@nohajc
Copy link
Owner

nohajc commented May 13, 2024

30 seconds seems like too much... One thing you could try is to

  1. run termux-adb kill-server
  2. connect your device
  3. run termux-adb devices

On the first run, termux-adb should detect all connected devices relatively fast. If the server is already running, devices are checked periodically in the background but it should be more often than 30 s.

Sometimes, the phone's battery saving features can mess with the clock (like stopping the ticks or slowing them down) but this typically happens to me only when the display is off.

I'll try to play with it and see if I can reproduce any of that with the new version.

@huynhtanloc2612
Copy link

I have tried above suggestion but device detection time is no change (still very slow)
I also have tested termux-adb (v0.2.2-1) on other device (Xiaomi 6 Pro - Android 8.1.0) which works correctly and fast.
Slowness may depend Android version or device manufactorer.

@nohajc
Copy link
Owner

nohajc commented May 13, 2024

Slowness may depend Android version or device manufactorer.

That was my theory too. Unfortunately, such problems may be very difficult to work around within Termux.

I suppose if somebody made a native ADB app designed for Android, it might give better results.

@huynhtanloc2612
Copy link

huynhtanloc2612 commented May 13, 2024

Slowness may depend Android version or device manufactorer.

That was my theory too. Unfortunately, such problems may be very difficult to work around within Termux.

I suppose if somebody made a native ADB app designed for Android, it might give better results.

Can we feedback or suggest Termux developers about this issue of ADB so they can give good solution to overcome it and suggest integrating termux-adb to official Termux repo...as well? I think it will be great.

@huynhtanloc2612
Copy link

Slowness may depend Android version or device manufactorer.

That was my theory too. Unfortunately, such problems may be very difficult to work around within Termux.

I suppose if somebody made a native ADB app designed for Android, it might give better results.

@nohajc I have just found that the slowness happened with termux-usb command.
I tried termux-usb -l, it took the same amount of wating time before the result appeared and then I tried termux-adb devices the connected devices were showed as a result.
So I guess issue of slowness is termux-usb
Hope it give you some ideas.

@nohajc
Copy link
Owner

nohajc commented May 14, 2024

@nohajc I have just found that the slowness happened with termux-usb command.
I tried termux-usb -l, it took the same amount of wating time before the result appeared and then I tried termux-adb devices the connected devices were showed as a result.
So I guess issue of slowness is termux-usb
Hope it give you some ideas.

Can I ask you to report it in the termux repo? With the information about your device etc.

I can try to talk to someone about integration to the official repository in the meantime.

Thanks!

@huynhtanloc2612
Copy link

huynhtanloc2612 commented May 14, 2024

@nohajc I have just found that the slowness happened with termux-usb command.
I tried termux-usb -l, it took the same amount of wating time before the result appeared and then I tried termux-adb devices the connected devices were showed as a result.
So I guess issue of slowness is termux-usb
Hope it give you some ideas.

Can I ask you to report it in the termux repo? With the information about your device etc.

I can try to talk to someone about integration to the official repository in the meantime.

Thanks!

Yes, I have just reported this termux/termux-api#680

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

6 participants