mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
2012-08-24 Mark Holland <mark@mark-holland.me.uk>
* AndroidManifest.xml: Added experimental start pandroid on device boot(not operational) * res/layout/setup.xml: Removed duplicate password button * res/layout/setupnosim.xml: Removed unused text view * src/pandroid/agent/core.java: set inventory to disabled by default * src/pandroid/agent/PandroidAgentListener.java: Fixed inventory report if condition * src/pandroid/agent/PandroidAgentTentacle.java: Fixed if condition when server response == null, Changed how data is written to serverOutput, fixes utf-8. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6909 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
aeaf22db85
commit
0633856ce1
@ -36,6 +36,20 @@
|
|||||||
|
|
||||||
<service android:enabled="true" android:name="pandroid.agent.PandroidAgentListener" />
|
<service android:enabled="true" android:name="pandroid.agent.PandroidAgentListener" />
|
||||||
<receiver android:name="pandroid.agent.EventReceiver" />
|
<receiver android:name="pandroid.agent.EventReceiver" />
|
||||||
|
|
||||||
|
<receiver
|
||||||
|
android:name="pandroid.agent.StartMyServiceAtBootReceiver"
|
||||||
|
android:enabled="true"
|
||||||
|
android:exported="true"
|
||||||
|
android:label="StartMyServiceAtBootReceiver">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
|
<service android:enabled="true" android:name="pandroid.agent.MyStartService" />
|
||||||
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".About"
|
android:name=".About"
|
||||||
android:label="@string/pandroid_agent_str"
|
android:label="@string/pandroid_agent_str"
|
||||||
@ -65,7 +79,7 @@
|
|||||||
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
|
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
|
||||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||||
<uses-permission android:name="android.permission.READ_SMS"/>
|
<uses-permission android:name="android.permission.READ_SMS"/>
|
||||||
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
|
|
||||||
<uses-feature android:name="android.hardware.sensor.light" />
|
<uses-feature android:name="android.hardware.sensor.light" />
|
||||||
<uses-feature android:name="android.hardware.location" />
|
<uses-feature android:name="android.hardware.location" />
|
||||||
|
@ -1,3 +1,24 @@
|
|||||||
|
2012-08-24 Mark Holland <mark@mark-holland.me.uk>
|
||||||
|
|
||||||
|
* AndroidManifest.xml: Added experimental start
|
||||||
|
pandroid on device boot(not operational)
|
||||||
|
|
||||||
|
* res/layout/setup.xml: Removed duplicate password
|
||||||
|
button
|
||||||
|
|
||||||
|
* res/layout/setupnosim.xml: Removed unused text view
|
||||||
|
|
||||||
|
* src/pandroid/agent/core.java: set inventory to disabled
|
||||||
|
by default
|
||||||
|
|
||||||
|
* src/pandroid/agent/PandroidAgentListener.java: Fixed
|
||||||
|
inventory report if condition
|
||||||
|
|
||||||
|
* src/pandroid/agent/PandroidAgentTentacle.java: Fixed if
|
||||||
|
condition when server response == null, Changed how data
|
||||||
|
is written to serverOutput, fixes utf-8.
|
||||||
|
|
||||||
|
|
||||||
2012-08-22 Mark Holland <mark@mark-holland.me.uk>
|
2012-08-22 Mark Holland <mark@mark-holland.me.uk>
|
||||||
|
|
||||||
* AndroidManifest.xml: Changed icon drawable to
|
* AndroidManifest.xml: Changed icon drawable to
|
||||||
|
Binary file not shown.
@ -282,12 +282,6 @@
|
|||||||
android:textSize="14dip" />
|
android:textSize="14dip" />
|
||||||
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/set_password"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/set_password" />
|
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/checkNotification"
|
android:id="@+id/checkNotification"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -178,13 +178,7 @@
|
|||||||
android:textColor="#bbbbbb"
|
android:textColor="#bbbbbb"
|
||||||
android:textSize="14dip" />
|
android:textSize="14dip" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/field5"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/task" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/checkNotification"
|
android:id="@+id/checkNotification"
|
||||||
|
@ -67,7 +67,7 @@ public class Core {
|
|||||||
static volatile public String defaultBytesSentReport = "enabled"; // "disabled" or "enabled"
|
static volatile public String defaultBytesSentReport = "enabled"; // "disabled" or "enabled"
|
||||||
static volatile public String defaultHelloSignalReport = "enabled"; // "disabled" or "enabled"
|
static volatile public String defaultHelloSignalReport = "enabled"; // "disabled" or "enabled"
|
||||||
static volatile public String defaultRoamingReport = "enabled"; // "disabled" or "enabled"
|
static volatile public String defaultRoamingReport = "enabled"; // "disabled" or "enabled"
|
||||||
static volatile public String defaultInventoryReport = "enabled"; // "disabled" or "enabled"
|
static volatile public String defaultInventoryReport = "disabled"; // "disabled" or "enabled"
|
||||||
static volatile public String defaultNotificationCheck = "enabled"; // "disabled" or "enabled"
|
static volatile public String defaultNotificationCheck = "enabled"; // "disabled" or "enabled"
|
||||||
static volatile public boolean defaultHasSim = false;
|
static volatile public boolean defaultHasSim = false;
|
||||||
|
|
||||||
|
@ -275,6 +275,10 @@ public class PandroidAgentListener extends Service {
|
|||||||
String RoamingReport = getSharedData("PANDROID_DATA", "RoamingReport", Core.defaultRoamingReport, "string");
|
String RoamingReport = getSharedData("PANDROID_DATA", "RoamingReport", Core.defaultRoamingReport, "string");
|
||||||
String InventoryReport = getSharedData("PANDROID_DATA", "InventoryReport", Core.defaultInventoryReport, "string");
|
String InventoryReport = getSharedData("PANDROID_DATA", "InventoryReport", Core.defaultInventoryReport, "string");
|
||||||
|
|
||||||
|
if(InventoryReport.equals("enabled"))
|
||||||
|
{
|
||||||
|
buffer += buildInventoryXML();
|
||||||
|
}
|
||||||
|
|
||||||
if (BatteryLevelReport.equals("enabled"))
|
if (BatteryLevelReport.equals("enabled"))
|
||||||
buffer += buildmoduleXML("battery_level", "The current Battery level", "generic_data", batteryLevel);
|
buffer += buildmoduleXML("battery_level", "The current Battery level", "generic_data", batteryLevel);
|
||||||
@ -341,9 +345,8 @@ public class PandroidAgentListener extends Service {
|
|||||||
if (HelloSignalReport.equals("enabled"))
|
if (HelloSignalReport.equals("enabled"))
|
||||||
buffer += buildmoduleXML("helloSignal","Hello Signal", "generic_data", helloSignal);
|
buffer += buildmoduleXML("helloSignal","Hello Signal", "generic_data", helloSignal);
|
||||||
|
|
||||||
if(InventoryReport.equals("enabled"))
|
|
||||||
Log.v("MARK",InventoryReport);
|
|
||||||
buffer += buildInventoryXML();
|
|
||||||
|
|
||||||
// End_Modules
|
// End_Modules
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@ import java.io.InputStreamReader;
|
|||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
class tentacle_client {
|
class tentacle_client {
|
||||||
|
|
||||||
// Return 0 when success, -1 when error
|
// Return 0 when success, -1 when error
|
||||||
@ -109,7 +111,7 @@ class tentacle_client {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
getError("Could not get the file");
|
getError("Could not get the file");
|
||||||
}
|
}
|
||||||
|
Log.v("MARK",data);
|
||||||
getInfo("*** Start of transference ***\n",verbose);
|
getInfo("*** Start of transference ***\n",verbose);
|
||||||
// Send the file name and length
|
// Send the file name and length
|
||||||
try {
|
try {
|
||||||
@ -126,10 +128,11 @@ class tentacle_client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getInfo("Server -> Client: " + serverResponse + "\n", verbose);
|
getInfo("Server -> Client: " + serverResponse + "\n", verbose);
|
||||||
if (serverResponse.equals("SEND OK")) {
|
if (serverResponse != null && serverResponse.equals("SEND OK")) {
|
||||||
try {
|
try {
|
||||||
getInfo("Client -> Server: [file data]\n", verbose);
|
getInfo("Client -> Server: [file data]\n", verbose);
|
||||||
serverOutput.writeBytes(data);
|
serverOutput.write(data.getBytes());
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
getError("Could not write on server");
|
getError("Could not write on server");
|
||||||
}
|
}
|
||||||
@ -140,7 +143,7 @@ class tentacle_client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getInfo("Server -> Client: " + serverResponse + "\n", verbose);
|
getInfo("Server -> Client: " + serverResponse + "\n", verbose);
|
||||||
if (serverResponse.equals("SEND OK")) {
|
if (serverResponse != null && serverResponse.equals("SEND OK")) {
|
||||||
try {
|
try {
|
||||||
send = "QUIT\n";
|
send = "QUIT\n";
|
||||||
getInfo("Client -> Server: " + send, verbose);
|
getInfo("Client -> Server: " + send, verbose);
|
||||||
@ -181,6 +184,7 @@ class tentacle_client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void log (String msg) {
|
private void log (String msg) {
|
||||||
|
|
||||||
//Context context = getApplicationContext();
|
//Context context = getApplicationContext();
|
||||||
//int duration = Toast.LENGTH_SHORT;
|
//int duration = Toast.LENGTH_SHORT;
|
||||||
|
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
package pandroid.agent;
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
|
||||||
|
public class StartMyServiceAtBootReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
|
||||||
|
//Core.restartAgentListener(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user