Alex4SSB / ADB-Explorer

A fluent UI for ADB on Windows
MIT License
400 stars 33 forks source link

File name on targeted Android will be truncated when pushing file with long name #168

Closed wangjiahui1102 closed 1 year ago

wangjiahui1102 commented 1 year ago

Environment:

Description: Hit this issue when pushing files with long names like The.Glory.2022.EP01.HD1080P.X264.AAC.Korean.CHS.BDYS.mp4, it will be truncated to The.Glory.2022.EP01.HD1080P.X264.AAC.Korean. Try another name Who.Is.He.2023.EP23.HD1080P.X264.AAC.Mandarin.CHS.BDYS.mp4 it is also truncated to Who.Is.He.2023.EP23.HD1080P.X264.AAC.Mandarin.CHS.BD. The target folder is in the external storage so the full path could be long.

The UI shows correct filename at first but after switch to another directory and back then it will show the truncated filename.

This issue will cause the Android device cannot recognize the file type and fail to invoke the proper app when accessing the file. Could you please kindly help to check? Thanks in advance!

Alex4SSB commented 1 year ago

I tried naming files with the names you provided, but I have no issues pushing / pulling them. I even have a file with a longer name that is pushed and pulled with the name remaining intact: com.android.chrome_89.0.4389.105-438910534_11lang_11feat_31174470a9b1266fa7d8c87e62ac9c88_apkmirror.com.apkm

I have tested this on multiple devices, but for Android 7 I only have an emulator (still works). I suspect that this might be caused by Windows language, as I only have English Windows to test the app with, and we did have locale issues in the past.

Can you please enable the log (Settings -> ADB -> Enable Command Log) and see how the pull command looks for that file? I would suggest to turn off all polling and features for the test: image

wangjiahui1102 commented 1 year ago

Hello,

Just like you mentioned, it did have issue when source path has Chinese characters.

Below are what I have tested:

Source Path has Chinese Charaters Dest Path has Chinese Charaters File Name Will Be Truncated
Yes Yes Yes
Yes No Yes
No Yes No
No No No

Command Logs(Seems like the one of backslash is omitted by the editor. There are two backslashes in the delimiter of the source path from the log actually) 07:32:16:594 ⁞ C:\Users\xxxx\AppData\Local\IsolatedStorage\vrqj5bot.ucm\5xcoc0ch.tla\Url.aa34vwkcrfyyld4jvz1fmumqzd4403wc\Url.aa34vwkcrfyyld4jvz1fmumqzd4403wc\Files\AdbProgressRedirection.exe adb -s 192.168.123.23:5555 push "F:\视频\电视剧\Friends.Complete.BluRay.720p.x264.AAC-iSCG\Friends.S01.1994.BluRay.720p.x264.AAC-iSCG\Friends.S01E02.1994.BluRay.720p.x264.AAC-iSCG.mp4" "/storage/1A84B8C784B8A723/视频/电视剧/他是谁"

07:34:42:526 ⁞ C:\Users\xxxx\AppData\Local\IsolatedStorage\vrqj5bot.ucm\5xcoc0ch.tla\Url.aa34vwkcrfyyld4jvz1fmumqzd4403wc\Url.aa34vwkcrfyyld4jvz1fmumqzd4403wc\Files\AdbProgressRedirection.exe adb -s 192.168.123.23:5555 push "F:\视频\电视剧\Friends.Complete.BluRay.720p.x264.AAC-iSCG\Friends.S01.1994.BluRay.720p.x264.AAC-iSCG\Friends.S01E01.1994.BluRay.720p.x264.AAC-iSCG.mp4" "/storage/1A84B8C784B8A723/nas/videos"

07:36:40:213 ⁞ C:\Users\xxxx\AppData\Local\IsolatedStorage\vrqj5bot.ucm\5xcoc0ch.tla\Url.aa34vwkcrfyyld4jvz1fmumqzd4403wc\Url.aa34vwkcrfyyld4jvz1fmumqzd4403wc\Files\AdbProgressRedirection.exe adb -s 192.168.123.23:5555 push "F:\nas\videos\Friends.S01E01.1994.BluRay.720p.x264.AAC-iSCG.mp4" "/storage/1A84B8C784B8A723/nas/pictures"

07:39:51:465 ⁞ C:\Users\xxxx\AppData\Local\IsolatedStorage\vrqj5bot.ucm\5xcoc0ch.tla\Url.aa34vwkcrfyyld4jvz1fmumqzd4403wc\Url.aa34vwkcrfyyld4jvz1fmumqzd4403wc\Files\AdbProgressRedirection.exe adb -s 192.168.123.23:5555 push "F:\nas\videos\Friends.S01E01.1994.BluRay.720p.x264.AAC-iSCG.mp4" "/storage/1A84B8C784B8A723/视频/电视剧/他是谁"

Alex4SSB commented 1 year ago

Ok, so I tried pushing files with the paths you provided, but it still worked for me.

There are 4 things I would like you to try:

wangjiahui1102 commented 1 year ago

Hi,

I tried what you mentioned and it's still not working. And I also tried the adb push command directly and got the same results. I found it's possible an adb.exe bug. Similar issue mentioned here https://github.com/Genymobile/scrcpy/issues/2184. And I tried to use the workaround to add the original filename to the target path and it works.

eg. AdbProgressRedirection.exe adb -s 192.168.123.23:5555 push "F:\视频\电视剧\F0A5F566847FB1828C3F84809CD39864D7D42D3B.torrent" "/storage/1A84B8C784B8A723/视频/电视剧/F0A5F566847FB1828C3F84809CD39864D7D42D3B.torrent"

The command above can get the correct filename in the target. Not sure if we can enhance it to append the original filename at the target path in the command.

Alex4SSB commented 1 year ago

Ok, thanks a lot, I will try to implement your suggestion, after verifying it does not have some side effects.

Alex4SSB commented 1 year ago

Fixed in 2a8ff2723b71f6be8825a18aff54238d1d27dc12