2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-09-03 23:55:08 +00:00

Compare commits

...

4 Commits
v0.8d ... v0.8e

Author SHA1 Message Date
Albert Vaca
ab4a1079cc Increased version number to release 2015-03-15 17:52:25 -07:00
Albert Vaca
57871802d8 Only try to mount the root of the phone if we have read access to it
BUG: 336043
2015-03-15 17:52:25 -07:00
Albert Vaca
838be381c3 Establishing connection only worked one way (bug introduced in 459fe40) 2015-03-15 16:58:28 -07:00
l10n daemon script
53ad94ef32 SVN_SILENT made messages (after extraction) 2015-03-14 02:09:03 +00:00
5 changed files with 51 additions and 42 deletions

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.kde.kdeconnect_tp"
android:versionCode="804"
android:versionName="0.8d">
android:versionCode="805"
android:versionName="0.8e">
<uses-sdk android:minSdkVersion="9"
android:targetSdkVersion="21" />

View File

@@ -52,7 +52,10 @@
<string name="received_url_title">Verknüpfung von %1s erhalten</string>
<string name="incoming_file_title">Eingehende Datei von %1s</string>
<string name="incoming_file_text">%1s</string>
<string name="outgoing_file_text">%1s</string>
<string name="received_file_title">Datei von %1s erhalten</string>
<string name="sent_file_text">%1s</string>
<string name="sent_file_failed_text">%1s</string>
<string name="tap_to_answer">Tippen zum Antworten</string>
<string name="reconnect">Erneut verbinden</string>
<string name="right_click">Rechtsklick senden</string>
@@ -99,5 +102,6 @@
<string name="sftp_readonly">(Nur lesen)</string>
<string name="sftp_camera">Kamerabilder</string>
<string name="add_host">Rechner/IP hinzufügen</string>
<string name="add_host_hint">Rechnername oder IP</string>
<string name="mpris_player_on_device">%1$s auf %2$s</string>
</resources>

View File

@@ -162,7 +162,7 @@ public class LanLinkProvider extends BaseLinkProvider {
//TextLineCodecFactory will buffer incoming data and emit a message very time it finds a \n
TextLineCodecFactory textLineFactory = new TextLineCodecFactory(Charset.defaultCharset(), LineDelimiter.UNIX, LineDelimiter.UNIX);
textLineFactory.setDecoderMaxLineLength(512*1024); //Allow to receive up to 512kb of data
tcpAcceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(textLineFactory));
connector.getFilterChain().addLast("codec", new ProtocolCodecFilter(textLineFactory));
int tcpPort = identityPackage.getInt("tcpPort",port);
ConnectFuture future = connector.connect(new InetSocketAddress(address.getAddress(), tcpPort));

View File

@@ -90,7 +90,7 @@ public class StorageHelper {
File dirs[] = storage.listFiles();
for (File dir : dirs) {
//Log.e("getStorageList", "path: "+dir.getAbsolutePath());
if (dir.isDirectory()) {
if (dir.isDirectory() && dir.canRead() && dir.canExecute()) {
String path, path2;
path2 = dir.getAbsolutePath();
try {
@@ -101,9 +101,10 @@ public class StorageHelper {
}
if (!path.startsWith("/storage/emulated") || dirs.length == 1) {
if (!paths.contains(path) && !paths.contains(path2)) {
if (mounts == null || mounts.contains(path) || mounts.contains(path2))
list.add(0, new StorageInfo(path, false, true, cur_removable_number++));
paths.add(path);
if (mounts == null || mounts.contains(path) || mounts.contains(path2)) {
list.add(0, new StorageInfo(path, false, true, cur_removable_number++));
paths.add(path);
}
}
}
}

View File

@@ -90,51 +90,55 @@ public class SftpPlugin extends Plugin {
np2.set("user", server.passwordAuth.getUser());
np2.set("password", server.passwordAuth.getPassword());
//Kept for compatibility, but new desktop clients will read "multiPaths" instead,
// that supports devices with more than one external storage
//Kept for compatibility, in case "multiPaths" is not possible or the other end does not support it
np2.set("path", Environment.getExternalStorageDirectory().getAbsolutePath());
List<StorageHelper.StorageInfo> storageList = StorageHelper.getStorageList();
ArrayList<String> paths = new ArrayList<String>();
ArrayList<String> pathNames = new ArrayList<String>();
File root = new File("/");
if (root.canExecute() && root.canRead()) {
List<StorageHelper.StorageInfo> storageList = StorageHelper.getStorageList();
ArrayList<String> paths = new ArrayList<String>();
ArrayList<String> pathNames = new ArrayList<String>();
for (StorageHelper.StorageInfo storage : storageList) {
paths.add(storage.path);
StringBuilder res = new StringBuilder();
for (StorageHelper.StorageInfo storage : storageList) {
paths.add(storage.path);
StringBuilder res = new StringBuilder();
if (storageList.size() > 1) {
if (!storage.removable) {
res.append(context.getString(R.string.sftp_internal_storage));
} else if (storage.number > 1) {
res.append(context.getString(R.string.sftp_sdcard_num, storage.number));
} else {
res.append(context.getString(R.string.sftp_sdcard));
}
} else {
res.append(context.getString(R.string.sftp_all_files));
}
String pathName = res.toString();
if (storage.readonly) {
res.append(" ");
res.append(context.getString(R.string.sftp_readonly));
}
pathNames.add(res.toString());
//Shortcut for users that only want to browse camera pictures
String dcim = storage.path + "/DCIM/Camera";
if (new File(dcim).exists()) {
paths.add(dcim);
if (storageList.size() > 1) {
pathNames.add(context.getString(R.string.sftp_camera) + "(" + pathName + ")");
if (!storage.removable) {
res.append(context.getString(R.string.sftp_internal_storage));
} else if (storage.number > 1) {
res.append(context.getString(R.string.sftp_sdcard_num, storage.number));
} else {
res.append(context.getString(R.string.sftp_sdcard));
}
} else {
pathNames.add(context.getString(R.string.sftp_camera));
res.append(context.getString(R.string.sftp_all_files));
}
String pathName = res.toString();
if (storage.readonly) {
res.append(" ");
res.append(context.getString(R.string.sftp_readonly));
}
pathNames.add(res.toString());
//Shortcut for users that only want to browse camera pictures
String dcim = storage.path + "/DCIM/Camera";
if (new File(dcim).exists()) {
paths.add(dcim);
if (storageList.size() > 1) {
pathNames.add(context.getString(R.string.sftp_camera) + "(" + pathName + ")");
} else {
pathNames.add(context.getString(R.string.sftp_camera));
}
}
}
if (paths.size() > 0) {
np2.set("multiPaths", paths);
np2.set("pathNames", pathNames);
}
}
np2.set("multiPaths", paths);
np2.set("pathNames", pathNames);
device.sendPackage(np2);
return true;