[ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

cpp64
Junior Member
Junior Member
Posts: 83
Joined: 2023-05-12, 16:03 UTC

[ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *cpp64 »

Android 14 (upgraded from Android 13)
TC FTP Plugin

Creating a new connection "TestNewFTP" also creates ":TestNewFTP".
--> Both "TestNewFTP" and ":TestNewFTP" are created.
Last edited by cpp64 on 2023-12-02, 01:56 UTC, edited 2 times in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48092
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [ bug ][ Android 14] [ FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *ghisler(Author) »

Sorry, I cannot reproduce that.
Author of Total Commander
https://www.ghisler.com
cpp64
Junior Member
Junior Member
Posts: 83
Joined: 2023-05-12, 16:03 UTC

Re: [ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *cpp64 »

2ghisler(Author)

Device: Samsung Galaxy Tab S9
OS: Android 14

// Problems
Creating a "<title>" in the FTP plugin and SFTP plugin creates an additional ":<title>".

// Download snapshot (WeTransfer, 7 days)
https://we.tl/t-RF1sTJ9yCX
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48092
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *ghisler(Author) »

I have just tried it on the Android 14 emulator, but it does not happen. Maybe it depends on what you entered in the connection settings?
Does it happen when you enter a simple IP address like
192.168.0.1
in the server name field and leave all other fields unchanged?

I have also tried to change the system language to Korean, but the error doesn't occur with that either.
Author of Total Commander
https://www.ghisler.com
cpp64
Junior Member
Junior Member
Posts: 83
Joined: 2023-05-12, 16:03 UTC

Re: [ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *cpp64 »

2ghisler(Author)

I have captured it as an mp4 video using "192.168.0.1".

// mp4 (WeTransfer, 7 days)
https://we.tl/t-7Szx2eKK0D

In the title at the top of ftp1's property, a [:] is added before ftp1.
--> 연결 편집: [:]ftp1

On the other device (Android 13), the [:] is not added.
--> 연결 편집: ftp1

It looks like "ftp1" is referring to ":ftp1" and ":ftp1" is referring to "::ftp1". // [:] is added recursively.
User avatar
geemaan
Junior Member
Junior Member
Posts: 5
Joined: 2012-03-18, 20:56 UTC

Re: [ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *geemaan »

I can confirm this is happening on my pixel 8 pro, in the Lan plugin too.
EDIT: I can also reproduce it on my Pixel 5 running android 14.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48092
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *ghisler(Author) »

Sorry, I'm out of ideas. I have followed your steps exactly, but no entry with ":" at the start was created.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48092
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *ghisler(Author) »

If you have some spare time for testing, you could send me the plugin configuration files:
1. You will need Android adb.exe. You can get it for example from the Android ADB plugin:
http://totalcmd.net/plugring/android_adb.html
No need to install the plugin, just unpack all the files from the bin subdirectory
2. You will need to enable debugging on your Android device
3. Make sure you don't have any passwords stored in clear text (without master password)! If you have in FTP, get the SFTP plugin and add a sample user with sample password, or vice versa.
4. Open a command line (cmd.exe) and use the following command (abp.jar is in subdirectory "executable"):
adb backup -apk com.ghisler.tcplugins.FTP -f ftp.adb
or for sftp:
adb backup -apk com.ghisler.tcplugins.SFTP -f sftp.adb
5. Confirm the backup without password on your Android device
6. Send me the file to cghisler at gmail dot com (not to ghisler.com)

Optional
If you prefer to look at the backup yourself, you can use the tool android-backup-processor, but it requires Java. It can be used as follows:
java -jar abp.jar unpack ftp.adb ftp.tar
Then that tar file can be opened in Total Commander or Windows 11 Explorer. The settings are then in the subfolder
apps\apps\com.ghisler.tcplugins.FTP\sp
Author of Total Commander
https://www.ghisler.com
User avatar
geemaan
Junior Member
Junior Member
Posts: 5
Joined: 2012-03-18, 20:56 UTC

Re: [ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *geemaan »

Yes! I totally forgot about adb backup. I used to mess with app data this way. I'll do when I'll find the time. Thanks for the suggestion!

*EDIT*

Now I know why: It seems that since Android 12 adb backup does not work. Using your instructions for backup all I got were 2 identical 47 bytes files. I did not bother sending them to you.
cpp64
Junior Member
Junior Member
Posts: 83
Joined: 2023-05-12, 16:03 UTC

Re: [ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *cpp64 »

2ghisler(Author)

The "adb backup" command does not work properly on Android 14.
The outputs are two identical 47 bytes files.
And the converted (s)ftp.tar is empty.

// (s)ftp.adb (47 bytes)
--------------------
ANDROID BACKUP
5
1
none
x___________________
--------------------


ps.
The "adb backup" command also does not work properly on Android 4.1.2.
The output is a 41 bytes file.

// ftp.adb (41 bytes)
--------------------
ANDROID BACKUP
1
1
none
x________________
--------------------
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48092
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *ghisler(Author) »

Strange, it worked fine with the Android 14 emulator. :(

I have added a button "Backup" to the connection settings which allows to backup all connections to a file, using the Android "Save" dialog. The function removes all passwords from the backup. You can get it here:
https://www.totalcommander.ch/aplg/tcandroidsftp28a.apk
Author of Total Commander
https://www.ghisler.com
cpp64
Junior Member
Junior Member
Posts: 83
Joined: 2023-05-12, 16:03 UTC

Re: [ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *cpp64 »

2ghisler(Author)

when creating a "sftp1", ":sftp1" is also created.
And the information is written to ":sftp1", not "sftp1"

--------------------

Title:[sftp1]
server:[192.168.0.1]
username:[user1]

--------------------
SFTP
com.ghisler.tcplugins.SFTP_preferences.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map />

SFTP.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name=":sftp1">192.168.0.1</string>
<string name="sftp1"></string>
</map>

SFTP_sftp1.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map />

android.app.ActivityThread.IDS.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="IDSCount" value="1" />
</map>

SFTP_:sftp1.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="server">192.168.0.1</string>
<string name="proxy"></string>
<string name="scp">1</string>
<string name="password"></string>
<string name="remotedir"></string>
<string name="codepage">-2</string>
<string name="username">user1</string>
<string name="usercertfile"></string>
</map>
--------------------
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48092
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *ghisler(Author) »

Thanks, so it seems that the data is written incorrectly on your device, not read incorrectly. I will investigate in that direction.
Can you delete the sftp1 connection and then rename :sftp1 to sftp1 ?

Edit: I found something: When creating or editing a connection, the plugin adds the name as follows:
connectIntent.setData(Uri.fromParts("server:", connName, ""));
This creates an URL in the form server::connection_name (which is actually incorrect).

The dialog receives this and calls uri.getSchemeSpecificPart(); which returns just
connection_name
on all devices I tested. It seems that it returns
:connection_name
on your device.

So apparently someone fixed the bug in getSchemeSpecificPart(); for your device, causing this new bug.

Here is a test version which should not create new :connection_name entries:
https://www.totalcommander.ch/aplg/tcandroidsftp28b.apk
Author of Total Commander
https://www.ghisler.com
User avatar
geemaan
Junior Member
Junior Member
Posts: 5
Joined: 2012-03-18, 20:56 UTC

Re: [ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *geemaan »

I updated yesterday to Android 14 QPR1 and it seems that I cannot replicate this any more.
However the exported backup file lists more xml files than the connections listed by the sftp plugin in tc. Those look like this:

Code: Select all

SFTP_:test lib.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map />

SFTP_test lib.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map />

SFTP_rpi3.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map />
I guess they are orphan configurations. They are not shown in the connection list because they are not referenced any more in the master SFTP.xml file.
cpp64
Junior Member
Junior Member
Posts: 83
Joined: 2023-05-12, 16:03 UTC

Re: [ bug ][ Android 14] [ (S)FTP Plugin ] Creating a new connection "TestNewFTP" also creates ":TestNewFTP"

Post by *cpp64 »

2ghisler(Author)

Confirmed fixed.
"tcandroidsftp28b.apk" works well.

ps.
// Before the fix.
// tested in FTP-Plugin. (I have no SFTP server)
Connecting <:Title> is OK.
Connecting <Title> is not possible. (Because <Title> is empty)
Delete <Title> is OK.
Rename <:Title> to <Title> is OK.
Connecting <Title> (renamed from <:Title>) is OK.
But editing the property of <Title> (renamed from <:Title>) is not possible. (Because <Title> points to the deleted <:Title>)
--> Reading is OK. But writing points to [:]<title>.
Last edited by cpp64 on 2023-12-08, 13:09 UTC, edited 1 time in total.
Post Reply