Android Question B4A SFTP Library

Nenad Hukavec

Member
Licensed User
Longtime User
Hello,

I haven't needed SFTP for a long time, and now I see that Jsch library no longer works with the new version of the SFTP server due to deprecated algorithms.
Is there a newer version or some other alternative for SFTP? I can't find anything useful...
 

Nenad Hukavec

Member
Licensed User
Longtime User
Tnx I saw that but it's too complicated to implement in an old app built for Android 4.4.
I am looking for a library that would work like Jsch without additional dependencies.
And maybe it's time for those old devices to stop working after almost ten years! :)
 
Upvote 0

Martin Domian

Member
Licensed User
Longtime User
I did try at and it crashed in the first Row


DownloadFileFromSFTP:
Sub DownloadFileFromSFTP(FullFilename As String, Titel As String, Aufruf As Int)
        
    Dim mSSH As SSHJ
    
    mSSH.Initialize("SSH")
    mSSH.AddHostKeyPromiscuousVerifier
    mSSH.AddAuthPassword (Starter.settings.get ("FTP.PW"))
    mSSH.Connect(Starter.settings.get ("FTP.Server") , Starter.settings.get ("FTP.Port") , Starter.settings.get ("FTP.User"))
    
    Wait For ssh_Connected (success As Boolean)
    
    If success Then
        ToastMessageShow("Die " & Titel & " werden geladen",False)
        Dim SFTP As SSHJSFTPClient = mSSH.GetSFTPClient
        Dim SF As Object = SFTP.Download(Starter.settings.get ("FTP.Folder") & "/" & FullFilename, File.DirInternal & "/" & FullFilename,False)
        wait for (SF) SFTPDownloadFinished(success As Boolean, remoteFilePath As String,LocalFilePath As String)
        If success Then
            ToastMessageShow("Die " & Titel & " wurden vom SFTP Server geladen",False)
            If Aufruf = 1 Then CreateZahlungsarten
            If Aufruf = 2 Then CreateOrganisationen
        Else
            ToastMessageShow("Das Laden der " & Titel & " vom SFTP Server ist fehlgeschlagen mit dem Fehler '" & LastException.Message & "'.", False)
        End If
        SFTP.Close
    Else
        ToastMessageShow ("Die Verbindung zum SFTP Server '" & Starter.settings.get ("FTP.Server") & "' konnte nicht hergestellt werden",False)
    End If   
    mSSH.Close
    
End Sub
 
Upvote 0
Top