summaryrefslogtreecommitdiff
path: root/vdrmanager
diff options
context:
space:
mode:
Diffstat (limited to 'vdrmanager')
-rw-r--r--vdrmanager/AndroidManifest.xml2
-rw-r--r--vdrmanager/jni/Android.mk8
-rw-r--r--vdrmanager/jni/de_bjusystems_vdrmanager_utils_crypt_NativeDES.c24
-rw-r--r--vdrmanager/jni/de_bjusystems_vdrmanager_utils_crypt_NativeDES.h29
-rwxr-xr-xvdrmanager/libs/armeabi/libnative_des.sobin1584 -> 0 bytes
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/utils/crypt/NativeDES.java21
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java42
7 files changed, 28 insertions, 98 deletions
diff --git a/vdrmanager/AndroidManifest.xml b/vdrmanager/AndroidManifest.xml
index 1b80d25..bdaeece 100644
--- a/vdrmanager/AndroidManifest.xml
+++ b/vdrmanager/AndroidManifest.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.bjusystems.vdrmanager" android:versionName="0.4.0"
- android:versionCode="40">
+ android:versionCode="400">
<application android:icon="@drawable/app_logo"
android:label="@string/app_name" android:debuggable="true"
android:name=".app.VdrManagerApp">
diff --git a/vdrmanager/jni/Android.mk b/vdrmanager/jni/Android.mk
deleted file mode 100644
index a5427ce..0000000
--- a/vdrmanager/jni/Android.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := native_des
-LOCAL_SRC_FILES := de_bjusystems_vdrmanager_utils_crypt_NativeDES.c
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/vdrmanager/jni/de_bjusystems_vdrmanager_utils_crypt_NativeDES.c b/vdrmanager/jni/de_bjusystems_vdrmanager_utils_crypt_NativeDES.c
deleted file mode 100644
index 569b694..0000000
--- a/vdrmanager/jni/de_bjusystems_vdrmanager_utils_crypt_NativeDES.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#include "de_bjusystems_vdrmanager_utils_crypt_NativeDES.h"
-
- /*
- * Class: de_bjusystems_vdrmanager_utils_crypt_NativeDES
- * Method: encrypt
- * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
- */
- JNIEXPORT jstring JNICALL Java_de_bjusystems_vdrmanager_utils_crypt_NativeDES_encrypt(
- JNIEnv *env, jobject c, jstring jstr, jstring jkey) {
-
- return jstr;
- }
-
- /*
- * Class: de_bjusystems_vdrmanager_utils_crypt_NativeDES
- * Method: decrypt
- * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
- */
- JNIEXPORT jstring JNICALL Java_de_bjusystems_vdrmanager_utils_crypt_NativeDES_decrypt(
- JNIEnv *env, jobject c, jstring jstr, jstring key) {
-
- return jstr;
- }
-
diff --git a/vdrmanager/jni/de_bjusystems_vdrmanager_utils_crypt_NativeDES.h b/vdrmanager/jni/de_bjusystems_vdrmanager_utils_crypt_NativeDES.h
deleted file mode 100644
index b54241c..0000000
--- a/vdrmanager/jni/de_bjusystems_vdrmanager_utils_crypt_NativeDES.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class de_bjusystems_vdrmanager_utils_crypt_NativeDES */
-
-#ifndef _Included_de_bjusystems_vdrmanager_utils_crypt_NativeDES
-#define _Included_de_bjusystems_vdrmanager_utils_crypt_NativeDES
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: de_bjusystems_vdrmanager_utils_crypt_NativeDES
- * Method: encrypt
- * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_de_bjusystems_vdrmanager_utils_crypt_NativeDES_encrypt
- (JNIEnv *, jobject, jstring, jstring);
-
-/*
- * Class: de_bjusystems_vdrmanager_utils_crypt_NativeDES
- * Method: decrypt
- * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_de_bjusystems_vdrmanager_utils_crypt_NativeDES_decrypt
- (JNIEnv *, jobject, jstring, jstring);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/vdrmanager/libs/armeabi/libnative_des.so b/vdrmanager/libs/armeabi/libnative_des.so
deleted file mode 100755
index a4d3aba..0000000
--- a/vdrmanager/libs/armeabi/libnative_des.so
+++ /dev/null
Binary files differ
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/crypt/NativeDES.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/crypt/NativeDES.java
deleted file mode 100644
index 114f540..0000000
--- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/crypt/NativeDES.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package de.bjusystems.vdrmanager.utils.crypt;
-
-public class NativeDES {
- static {
- System.loadLibrary("native_des");
- }
- /**
- * @param str
- * @param key
- * @return
- */
- public native String encrypt( String str, String key);
-
-
- /**
- * @param str
- * @param key
- * @return
- */
- public native String decrypt(String str, String key);
-}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java
index 1b97237..f24ac4c 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java
@@ -13,10 +13,12 @@ import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.SSLSocketFactory;
+
import android.util.Log;
import de.bjusystems.vdrmanager.app.C;
import de.bjusystems.vdrmanager.data.Preferences;
-import de.bjusystems.vdrmanager.utils.crypt.NativeDES;
/**
* Class for SVDRP communication
@@ -50,8 +52,8 @@ public abstract class SvdrpClient<Result> {
// }
private Timer watchDog = new Timer();
-
- private NativeDES crypt = new NativeDES();
+
+ //private NativeDES crypt = new NativeDES();
public boolean isConnected() {
if (socket == null) {
@@ -154,7 +156,17 @@ public abstract class SvdrpClient<Result> {
try {
// connect
informListener(SvdrpEvent.CONNECTING, null);
- socket = new Socket();
+
+ if (Preferences.get().isSecure() || true) {
+
+ SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory
+ .getDefault(); // Erzeugt eine SSLSocketFactory mit
+ // Standartkonfiguration
+ socket = (SSLSocket) factory.createSocket();
+ } else {
+ socket = new Socket();
+ }
+
socket.connect(
new InetSocketAddress(prefs.getSvdrpHost(), prefs
.getSvdrpPort()),
@@ -202,8 +214,8 @@ public abstract class SvdrpClient<Result> {
// create streams
outputStream = socket.getOutputStream();
inputStream = socket.getInputStream();
- //TODO http://projects.vdr-developer.org/issues/790
- //inputStream = new InflaterInputStream(socket.getInputStream())
+ // TODO http://projects.vdr-developer.org/issues/790
+ // inputStream = new InflaterInputStream(socket.getInputStream())
// password needed?
informListener(SvdrpEvent.LOGIN, null);
@@ -244,9 +256,9 @@ public abstract class SvdrpClient<Result> {
protected void writeLine(final String line) throws IOException {
String command = line + "\r\n";
- if(false && Preferences.get().isSecure()){
- command = crypt.encrypt(command, Preferences.get().getPassword());
- }
+ //if (false && Preferences.get().isSecure()) {
+ //command = crypt.encrypt(command, Preferences.get().getPassword());
+ //}
final byte[] bytes = command.getBytes("utf-8");
outputStream.write(bytes);
outputStream.flush();
@@ -286,17 +298,17 @@ public abstract class SvdrpClient<Result> {
// remember char
lineBytes.write(c);
}
-
+
String line = null;
- try{
+ try {
line = lineBytes.toString(Preferences.get().getEncoding());
- } catch(UnsupportedEncodingException usex){
+ } catch (UnsupportedEncodingException usex) {
Log.w(TAG, usex);
line = lineBytes.toString();
}
- if(false && Preferences.get().isSecure()){
- line = crypt.decrypt(line, Preferences.get().getPassword());
- }
+ //if (false && Preferences.get().isSecure()) {
+ //line = crypt.decrypt(line, Preferences.get().getPassword());
+ //}
return line;
}