2013-05-30 Miguel de Dios <miguel.dedios@artica.es>
* .classpath, .settings, .settings/org.eclipse.jdt.core.prefs: added garbage files necesaries for eclipse. * AndroidManifest.xml: update the version. * bin/AndroidManifest.xml: erased temp file from project compilation in eclipse. * proguard.cfg: fixed the file and change the deprecated instructions. * src/pandroid/agent/PandroidAgentListener.java: added the code for to magical change to open source version. * src/pandroid/agent/PandroidAgentTentacle.java, src/pandroid/agent/PandroidAgent.java: improved the source code style. * res/values/strings.xml, res/values-en/strings.xml, res/values-es/strings.xml: updated the texts. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8232 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
221038a759
commit
c4612236f6
|
@ -5,5 +5,6 @@
|
||||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||||
<classpathentry kind="lib" path="libs/commons-lang3-3.0.1.jar"/>
|
<classpathentry kind="lib" path="libs/commons-lang3-3.0.1.jar"/>
|
||||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||||
|
<classpathentry kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
|
||||||
<classpathentry kind="output" path="bin/classes"/>
|
<classpathentry kind="output" path="bin/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.6
|
|
@ -16,8 +16,8 @@
|
||||||
-->
|
-->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="pandroid.agent"
|
package="pandroid.agent"
|
||||||
android:versionCode="2"
|
android:versionCode="3"
|
||||||
android:versionName="1.5" >
|
android:versionName="1.6" >
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
2013-05-30 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* .classpath, .settings, .settings/org.eclipse.jdt.core.prefs:
|
||||||
|
added garbage files necesaries for eclipse.
|
||||||
|
|
||||||
|
* AndroidManifest.xml: update the version.
|
||||||
|
|
||||||
|
* bin/AndroidManifest.xml: erased temp file from project compilation
|
||||||
|
in eclipse.
|
||||||
|
|
||||||
|
* proguard.cfg: fixed the file and change the deprecated
|
||||||
|
instructions.
|
||||||
|
|
||||||
|
* src/pandroid/agent/PandroidAgentListener.java: added the code for
|
||||||
|
to magical change to open source version.
|
||||||
|
|
||||||
|
* src/pandroid/agent/PandroidAgentTentacle.java,
|
||||||
|
src/pandroid/agent/PandroidAgent.java: improved the source code
|
||||||
|
style.
|
||||||
|
|
||||||
|
* res/values/strings.xml, res/values-en/strings.xml,
|
||||||
|
res/values-es/strings.xml: updated the texts.
|
||||||
|
|
||||||
2013-05-28 Junichi Satoh <junichi@rworks.jp>
|
2013-05-28 Junichi Satoh <junichi@rworks.jp>
|
||||||
|
|
||||||
* res/values-ja/strings.xml: Fixed a translation.
|
* res/values-ja/strings.xml: Fixed a translation.
|
||||||
|
|
|
@ -1,74 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
// Pandora FMS - http://pandorafms.com
|
|
||||||
// ==================================================
|
|
||||||
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
|
||||||
// Please see http://pandorafms.org for full contribution list
|
|
||||||
|
|
||||||
// This program is free software; you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License
|
|
||||||
// as published by the Free Software Foundation; version 2
|
|
||||||
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
-->
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="pandroid.agent"
|
|
||||||
android:versionCode="2"
|
|
||||||
android:versionName="1.5">
|
|
||||||
<application android:icon="@drawable/icon" android:label="@string/app_name">
|
|
||||||
<activity
|
|
||||||
android:name=".PandroidAgent"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:configChanges="keyboardHidden|orientation"
|
|
||||||
android:theme="@android:style/Theme.NoTitleBar"
|
|
||||||
>
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity android:name=".Status" />
|
|
||||||
<activity android:name=".Setup" />
|
|
||||||
|
|
||||||
<service android:enabled="true" android:name="pandroid.agent.PandroidAgentListener" />
|
|
||||||
<receiver android:name="pandroid.agent.EventReceiver" />
|
|
||||||
<activity
|
|
||||||
android:name=".About"
|
|
||||||
android:label="@string/pandroid_agent_str"
|
|
||||||
android:theme="@android:style/Theme.Dialog"
|
|
||||||
/>
|
|
||||||
<activity
|
|
||||||
android:name=".Help"
|
|
||||||
android:label="@string/help_str"
|
|
||||||
android:theme="@android:style/Theme.Dialog"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<receiver android:name=".SMSBroadcastReceiver">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.provider.Telephony.SMS_RECEIVED"></action>
|
|
||||||
</intent-filter>
|
|
||||||
</receiver>
|
|
||||||
|
|
||||||
</application>
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
|
|
||||||
<uses-permission android:name="android.permission.GET_TASKS"/>
|
|
||||||
<uses-permission android:name="android.permission.BATTERY_STATS"/>
|
|
||||||
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
|
|
||||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
|
||||||
<uses-permission android:name="android.permission.READ_SMS"/>
|
|
||||||
|
|
||||||
|
|
||||||
<uses-feature android:name="android.hardware.sensor.light" />
|
|
||||||
<uses-feature android:name="android.hardware.location" />
|
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="8"/>
|
|
||||||
</manifest>
|
|
|
@ -16,11 +16,11 @@
|
||||||
native <methods>;
|
native <methods>;
|
||||||
}
|
}
|
||||||
|
|
||||||
-keepclasseswithmembernames class * {
|
-keepclasseswithmembers class * {
|
||||||
public <init>(android.content.Context, android.util.AttributeSet);
|
public <init>(android.content.Context, android.util.AttributeSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
-keepclasseswithmembernames class * {
|
-keepclasseswithmembers class * {
|
||||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
public <init>(android.content.Context, android.util.AttributeSet, int);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@
|
||||||
<string name="mobileWebURL">Mobile server URL:</string>
|
<string name="mobileWebURL">Mobile server URL:</string>
|
||||||
<string name="go_to_web">View Mobile site</string>
|
<string name="go_to_web">View Mobile site</string>
|
||||||
|
|
||||||
<string name="bufferSize">XML Buffer Size(KB)</string>
|
<string name="bufferSize">XML Buffer Size (KB) (Enterprise Only)</string>
|
||||||
|
|
||||||
<string name="enter">enter</string>
|
<string name="enter">enter</string>
|
||||||
<string name="back">back</string>
|
<string name="back">back</string>
|
||||||
|
|
|
@ -122,7 +122,7 @@
|
||||||
<string name="mobileWebURL">URL de servidor móvil:</string>
|
<string name="mobileWebURL">URL de servidor móvil:</string>
|
||||||
<string name="go_to_web">Ver sitio móvil</string>
|
<string name="go_to_web">Ver sitio móvil</string>
|
||||||
|
|
||||||
<string name="bufferSize">Tamaño de búfer XML(KB)</string>
|
<string name="bufferSize">Tamaño de búfer XML (KB) (Enterprise solamente)</string>
|
||||||
|
|
||||||
<string name="enter">Intro</string>
|
<string name="enter">Intro</string>
|
||||||
<string name="back">Volver</string>
|
<string name="back">Volver</string>
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
<string name="mobileWebURL">Mobile server URL:</string>
|
<string name="mobileWebURL">Mobile server URL:</string>
|
||||||
<string name="go_to_web">View Mobile site</string>
|
<string name="go_to_web">View Mobile site</string>
|
||||||
|
|
||||||
<string name="bufferSize">XML Buffer Size(KB)</string>
|
<string name="bufferSize">XML Buffer Size (KB) (Enterprise Only)</string>
|
||||||
|
|
||||||
<string name="enter">enter</string>
|
<string name="enter">enter</string>
|
||||||
<string name="back">back</string>
|
<string name="back">back</string>
|
||||||
|
|
|
@ -16,12 +16,9 @@ package pandroid.agent;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.TabActivity;
|
import android.app.TabActivity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.SharedPreferences.Editor;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
|
|
|
@ -40,11 +40,6 @@ import android.content.IntentFilter;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.Editor;
|
import android.content.SharedPreferences.Editor;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.hardware.Sensor;
|
|
||||||
import android.hardware.SensorEvent;
|
|
||||||
import android.hardware.SensorEventListener;
|
|
||||||
import android.hardware.SensorManager;
|
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.location.Criteria;
|
import android.location.Criteria;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
|
@ -77,7 +72,7 @@ public class PandroidAgentListener extends Service {
|
||||||
//boolean showLastXML = true;
|
//boolean showLastXML = true;
|
||||||
|
|
||||||
|
|
||||||
private LocationManager locmgr = null;
|
//private LocationManager locmgr = null;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -188,8 +183,7 @@ public class PandroidAgentListener extends Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Void unused)
|
protected void onPostExecute(Void unused) {
|
||||||
{
|
|
||||||
|
|
||||||
// SharedPreferences agentPreferences = getApplicationContext().getSharedPreferences(
|
// SharedPreferences agentPreferences = getApplicationContext().getSharedPreferences(
|
||||||
// getApplicationContext().getString(R.string.const_string_preferences),
|
// getApplicationContext().getString(R.string.const_string_preferences),
|
||||||
|
@ -222,7 +216,8 @@ public class PandroidAgentListener extends Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
}
|
||||||
|
catch (Exception e) {
|
||||||
Log.e("notification", e.toString());
|
Log.e("notification", e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,14 +245,23 @@ public class PandroidAgentListener extends Service {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
xml = new buildXMLTask().execute().get();
|
xml = new buildXMLTask().execute().get();
|
||||||
} catch (InterruptedException e) {
|
}
|
||||||
|
catch (InterruptedException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
xmlBuilt = false;
|
xmlBuilt = false;
|
||||||
} catch (ExecutionException e) {
|
}
|
||||||
|
catch (ExecutionException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
xmlBuilt = false;
|
xmlBuilt = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (xmlBuilt) {
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
|
||||||
new contactTask().execute(xml);
|
new contactTask().execute(xml);
|
||||||
//TODO ensure not a problem
|
//TODO ensure not a problem
|
||||||
//updateValues();
|
//updateValues();
|
||||||
|
@ -344,13 +348,19 @@ public class PandroidAgentListener extends Service {
|
||||||
for (int i = 1; i<buffer.length; i++) {
|
for (int i = 1; i<buffer.length; i++) {
|
||||||
File file = new File("/data/data/pandroid.agent/files/" + buffer[i]);
|
File file = new File("/data/data/pandroid.agent/files/" + buffer[i]);
|
||||||
bufferSize += file.length();
|
bufferSize += file.length();
|
||||||
|
|
||||||
|
//-----INIT---- HACK TO ENTERPRISE
|
||||||
|
file.delete();
|
||||||
|
bufferSize = 0;
|
||||||
|
//-----END----- HACK TO ENTERPRISE
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if size of buffer is less than a value
|
//Check if size of buffer is less than a value
|
||||||
if ((bufferSize / 1024) < Core.bufferSize) {
|
if ((bufferSize / 1024) < Core.bufferSize) {
|
||||||
writeFile(destFileName, lastXML);
|
writeFile(destFileName, lastXML);
|
||||||
putSharedData("PANDROID_DATA", "lastXML", lastXML, "string");
|
putSharedData("PANDROID_DATA", "lastXML", lastXML, "string");
|
||||||
}else{
|
}
|
||||||
|
else{
|
||||||
//buffer full
|
//buffer full
|
||||||
}
|
}
|
||||||
putSharedData("PANDROID_DATA", "lastXML", lastXML, "string");
|
putSharedData("PANDROID_DATA", "lastXML", lastXML, "string");
|
||||||
|
@ -536,7 +546,8 @@ public class PandroidAgentListener extends Service {
|
||||||
/* ensure that everything is really written out and close */
|
/* ensure that everything is really written out and close */
|
||||||
osw.flush();
|
osw.flush();
|
||||||
osw.close();
|
osw.close();
|
||||||
} catch (IOException e) {
|
}
|
||||||
|
catch (IOException e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -801,7 +812,7 @@ public class PandroidAgentListener extends Service {
|
||||||
if ((task.length() != 0) && (taskHumanName.length() != 0)) {
|
if ((task.length() != 0) && (taskHumanName.length() != 0)) {
|
||||||
ActivityManager activityManager = (ActivityManager)getApplication().getSystemService(ACTIVITY_SERVICE);
|
ActivityManager activityManager = (ActivityManager)getApplication().getSystemService(ACTIVITY_SERVICE);
|
||||||
List<RunningAppProcessInfo> runningAppProcessInfos = activityManager.getRunningAppProcesses();
|
List<RunningAppProcessInfo> runningAppProcessInfos = activityManager.getRunningAppProcesses();
|
||||||
PackageManager pm = getApplication().getPackageManager();
|
//PackageManager pm = getApplication().getPackageManager();
|
||||||
RunningAppProcessInfo runningAppProcessInfo;
|
RunningAppProcessInfo runningAppProcessInfo;
|
||||||
|
|
||||||
for (int i = 0; i < runningAppProcessInfos.size(); i++) {
|
for (int i = 0; i < runningAppProcessInfos.size(); i++) {
|
||||||
|
|
|
@ -74,10 +74,12 @@ class tentacle_client {
|
||||||
try {
|
try {
|
||||||
socketCliente.connect(new InetSocketAddress(address, port), 2000);
|
socketCliente.connect(new InetSocketAddress(address, port), 2000);
|
||||||
|
|
||||||
} catch (UnknownHostException e) {
|
}
|
||||||
|
catch (UnknownHostException e) {
|
||||||
getError("Host doesn't exist");
|
getError("Host doesn't exist");
|
||||||
return -1;
|
return -1;
|
||||||
} catch (IOException e) {
|
}
|
||||||
|
catch (IOException e) {
|
||||||
getError("Could not connect: The host is down");
|
getError("Could not connect: The host is down");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -87,7 +89,8 @@ class tentacle_client {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
serverOutput = new DataOutputStream(socketCliente.getOutputStream());
|
serverOutput = new DataOutputStream(socketCliente.getOutputStream());
|
||||||
} catch (IOException e1) {
|
}
|
||||||
|
catch (IOException e1) {
|
||||||
getError("Could not get Data output stream");
|
getError("Could not get Data output stream");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +98,8 @@ class tentacle_client {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
serverInput = new BufferedReader(new InputStreamReader(socketCliente.getInputStream()));
|
serverInput = new BufferedReader(new InputStreamReader(socketCliente.getInputStream()));
|
||||||
} catch (IOException e1) {
|
}
|
||||||
|
catch (IOException e1) {
|
||||||
getError("Could not get Buffered reader");
|
getError("Could not get Buffered reader");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,9 +111,11 @@ class tentacle_client {
|
||||||
BufferedInputStream buf = new BufferedInputStream(new FileInputStream(file));
|
BufferedInputStream buf = new BufferedInputStream(new FileInputStream(file));
|
||||||
buf.read(data, 0, data.length);
|
buf.read(data, 0, data.length);
|
||||||
buf.close();
|
buf.close();
|
||||||
} catch (FileNotFoundException e) {
|
}
|
||||||
|
catch (FileNotFoundException e) {
|
||||||
getError("File not found");
|
getError("File not found");
|
||||||
} catch (IOException e) {
|
}
|
||||||
|
catch (IOException e) {
|
||||||
getError("Could not read from file");
|
getError("Could not read from file");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue