fixed Java client crash when using AES-256; android console project made compatible...
authorVictor Kirhenshtein <victor@netxms.org>
Mon, 21 May 2012 17:53:25 +0000 (17:53 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Mon, 21 May 2012 17:53:25 +0000 (17:53 +0000)
.gitattributes
.gitignore
android/src/console/.classpath
android/src/console/AndroidManifest.xml
android/src/console/libs/simple-xml-2.4.1.jar [moved from android/src/console/jar/simple-xml-2.4.1.jar with 100% similarity]
android/src/console/src/org/netxms/ui/android/main/activities/helpers/ChartDciConfig.java
android/src/console/src/org/netxms/ui/android/main/adapters/OverviewAdapter.java
src/java/netxms-base/src/main/java/org/netxms/base/EncryptionContext.java
src/java/package.cmd

index 7e00686..bd89c2f 100644 (file)
@@ -6,7 +6,7 @@ android/src/console/.externalToolBuilders/generate_build_number.xml -text
 android/src/console/.externalToolBuilders/run.exe -text
 android/src/console/AndroidManifest.xml -text
 android/src/console/default.properties -text
-android/src/console/jar/simple-xml-2.4.1.jar -text
+android/src/console/libs/simple-xml-2.4.1.jar -text
 android/src/console/lint.xml -text
 android/src/console/project.properties -text
 android/src/console/res/drawable-hdpi-v11/ic_stat_connected.png -text
index 628b8f5..a8d3f6e 100644 (file)
@@ -5,7 +5,6 @@
 /aclocal.m4
 android/src/console/bin
 android/src/console/gen
-android/src/console/jar/*.jar
 android/src/console/libs/*.jar
 android/src/console/res/values/build_number.xml
 /autom4te.cache
index 1cd11e3..d43e33a 100644 (file)
@@ -4,9 +4,9 @@
        <classpathentry kind="src" path="gen"/>
        <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
        <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
-       <classpathentry exported="true" kind="lib" path="jar/netxms-base-1.2.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="jar/netxms-client-1.2.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="jar/netxms-client-api-1.2.0.jar"/>
-       <classpathentry kind="lib" path="jar/simple-xml-2.4.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="libs/netxms-base-1.2.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="libs/netxms-client-api-1.2.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="libs/netxms-client-1.2.1.jar"/>
+       <classpathentry exported="true" kind="lib" path="libs/simple-xml-2.4.1.jar"/>
        <classpathentry kind="output" path="bin/classes"/>
 </classpath>
index 54dda2a..90cd990 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="org.netxms.ui.android" android:versionName="1.2.0" android:versionCode="3">
+      package="org.netxms.ui.android" android:versionName="1.2.1" android:versionCode="3">
        <uses-sdk android:targetSdkVersion="11" android:minSdkVersion="8"></uses-sdk>
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
index c68f918..a08b8d4 100644 (file)
@@ -112,6 +112,6 @@ public class ChartDciConfig
         */
        public String getName()
        {
-               return ((name != null) && !name.isEmpty()) ? name : ("[" + Long.toString(dciId) + "]");
+               return ((name != null) && (name.length() != 0)) ? name : ("[" + Long.toString(dciId) + "]");
        }
 }
index 72e753c..d3ff586 100644 (file)
@@ -20,9 +20,7 @@ import android.widget.TextView;
 \r
 /**\r
  * Adapter for alarm list\r
- * \r
  */\r
-\r
 public class OverviewAdapter extends BaseAdapter\r
 {\r
        private Context context;\r
@@ -57,19 +55,19 @@ public class OverviewAdapter extends BaseAdapter
                values.add(node.getPrimaryIP().getHostAddress().toString());\r
                labels.add(r.getString(R.string.overview_system_description));\r
                values.add(node.getSystemDescription());\r
-               if (!node.getAgentVersion().isEmpty())\r
+               if (node.getAgentVersion().length() != 0)\r
                {\r
                        labels.add(r.getString(R.string.overview_netxms_agent));\r
                        values.add(node.getAgentVersion());\r
                        labels.add(r.getString(R.string.overview_agent_version));\r
                        values.add(node.getAgentVersion());\r
                }\r
-               if (!node.getPlatformName().isEmpty())\r
+               if (node.getPlatformName().length() != 0)\r
                {\r
                        labels.add(r.getString(R.string.overview_platform_name));\r
                        values.add(node.getPlatformName());\r
                }\r
-               if (!node.getSnmpSysName().isEmpty())\r
+               if (node.getSnmpSysName().length() != 0)\r
                {\r
                        labels.add(r.getString(R.string.overview_snmp_agent));\r
                        values.add(node.getSnmpSysName());\r
index 04c56b0..f28511d 100644 (file)
@@ -155,7 +155,7 @@ public final class EncryptionContext
         * Create and encrypt payload header for encrypted message\r
         * \r
         * @param msgBytes original message\r
-        * @return\r
+        * @return encrypted data block or null if there are not enough data to produce complete encrypted block\r
         * @throws IOException\r
         */\r
        private byte[] encryptPayloadHeader(byte[] msgBytes) throws IOException\r
@@ -193,7 +193,9 @@ public final class EncryptionContext
                outputStream.writeInt(0);               // length\r
                \r
                encryptor.init(Cipher.ENCRYPT_MODE, key, iv);\r
-               outputStream.write(encryptPayloadHeader(msgBytes));\r
+               byte[] ph = encryptPayloadHeader(msgBytes);\r
+               if (ph != null)\r
+                       outputStream.write(ph);\r
                \r
                outputStream.write(encryptor.update(msgBytes));\r
                outputStream.write(encryptor.doFinal());\r
index 344e3a7..ec64b1b 100644 (file)
@@ -15,9 +15,9 @@ copy netxms-base\target\netxms-base-%version%.jar netxms-eclipse\library\jar\
 copy netxms-client-api\target\netxms-client-api-%version%.jar netxms-eclipse\library\jar\
 copy netxms-client\target\netxms-client-%version%.jar netxms-eclipse\core\jar\
 
-copy netxms-base\target\netxms-base-%version%.jar ..\..\android\src\console\jar\
-copy netxms-client-api\target\netxms-client-api-%version%.jar ..\..\android\src\console\jar\
-copy netxms-client\target\netxms-client-%version%.jar ..\..\android\src\console\jar\
+copy netxms-base\target\netxms-base-%version%.jar ..\..\android\src\console\libs\
+copy netxms-client-api\target\netxms-client-api-%version%.jar ..\..\android\src\console\libs\
+copy netxms-client\target\netxms-client-%version%.jar ..\..\android\src\console\libs\
 
 copy netxms-base\target\netxms-base-%version%.jar ..\..\webui\webapp\Core\jar\
 copy netxms-client-api\target\netxms-client-api-%version%.jar ..\..\webui\webapp\Core\jar\