Permalink
Browse files

First public commit. Code still needs a lot of cleaning!

  • Loading branch information...
Carlos Yaconi H
Carlos Yaconi H committed Jun 7, 2011
0 parents commit 44cf306005da784a69a2e2728ca3a331acb1f94d
Showing with 9,577 additions and 0 deletions.
  1. +33 −0 .project
  2. +134 −0 AndroidManifest.xml
  3. 0 README
  4. BIN assets/fonts/large9.ttf
  5. +14 −0 default.properties
  6. BIN res/drawable-hdpi/ic_stat_notify_exclamation.png
  7. BIN res/drawable-ldpi/ic_stat_notify_exclamation.png
  8. BIN res/drawable-mdpi/ic_stat_notify_exclamation.png
  9. BIN res/drawable/alert_dialog_icon.png
  10. BIN res/drawable/bg_lock.png
  11. +7 −0 res/drawable/border.xml
  12. BIN res/drawable/error.png
  13. +9 −0 res/drawable/gradient_line.xml
  14. BIN res/drawable/ic_stat_notify_exclamation25.png
  15. BIN res/drawable/info.png
  16. BIN res/drawable/logo.png
  17. BIN res/drawable/prey_status_bar_icon.png
  18. +107 −0 res/layout/add_device_to_account.xml
  19. +95 −0 res/layout/agreement.xml
  20. +24 −0 res/layout/check_password.xml
  21. +105 −0 res/layout/check_password2.xml
  22. +105 −0 res/layout/create_account.xml
  23. +15 −0 res/layout/plain.xml
  24. +54 −0 res/layout/set_password.xml
  25. +48 −0 res/layout/show_location_sent.xml
  26. +91 −0 res/layout/sms_destination.xml
  27. +81 −0 res/layout/sms_destination2.xml
  28. BIN res/raw/siren.mp3
  29. +208 −0 res/values-es/strings.xml
  30. +182 −0 res/values-it/strings.xml
  31. +181 −0 res/values-zh-rCN/strings.xml
  32. +181 −0 res/values-zh-rTW/strings.xml
  33. +219 −0 res/values/strings.xml
  34. +8 −0 res/values/styles.xml
  35. +187 −0 res/xml/preferences.xml
  36. +8 −0 res/xml/security_policies.xml
  37. +121 −0 src/com/prey/ContactsAutoCompleteCursorAdapter.java
  38. +322 −0 src/com/prey/CustomLocationManager.java
  39. +24 −0 src/com/prey/NoMoreDevicesAllowedException.java
  40. +87 −0 src/com/prey/PreyAccountData.java
  41. +419 −0 src/com/prey/PreyConfig.java
  42. +50 −0 src/com/prey/PreyController.java
  43. +23 −0 src/com/prey/PreyException.java
  44. +23 −0 src/com/prey/PreyLogger.java
  45. +46 −0 src/com/prey/PushMessage.java
  46. +94 −0 src/com/prey/ReflectionsUtils.java
  47. +147 −0 src/com/prey/actions/ActionsRunnner.java
  48. +80 −0 src/com/prey/actions/CallLogsNotifierAction.java
  49. +106 −0 src/com/prey/actions/HttpDataService.java
  50. +64 −0 src/com/prey/actions/LockAction.java
  51. +67 −0 src/com/prey/actions/Mp3PlayerAction.java
  52. +52 −0 src/com/prey/actions/PopUpAlertAction.java
  53. +83 −0 src/com/prey/actions/PreyAction.java
  54. +32 −0 src/com/prey/actions/PreyExecutionWaitNotify.java
  55. +52 −0 src/com/prey/actions/ReportActionResponse.java
  56. +47 −0 src/com/prey/actions/RingtonePlayerAction.java
  57. +102 −0 src/com/prey/actions/location/LocationNotifierAction.java
  58. +71 −0 src/com/prey/actions/location/PreyLocation.java
  59. +25 −0 src/com/prey/actions/location/PreyLocationManager.java
  60. +112 −0 src/com/prey/actions/observer/ActionJob.java
  61. +26 −0 src/com/prey/actions/observer/ActionResult.java
  62. +89 −0 src/com/prey/actions/observer/ActionsController.java
  63. +126 −0 src/com/prey/actions/observer/JobsGroup.java
  64. +70 −0 src/com/prey/actions/observer/JobsQueue.java
  65. +61 −0 src/com/prey/actions/parser/ResponseParser.java
  66. +127 −0 src/com/prey/actions/parser/ResponsesXMLHandler.java
  67. +142 −0 src/com/prey/activities/AddDeviceToAccountActivity.java
  68. +148 −0 src/com/prey/activities/AgreementDialogActivity.java
  69. +191 −0 src/com/prey/activities/CheckPasswordActivity.java
  70. +129 −0 src/com/prey/activities/CreateAccountActivity.java
  71. +46 −0 src/com/prey/activities/PopUpAlertActivity.java
  72. +44 −0 src/com/prey/activities/PreyConfigurationActivity.java
  73. +116 −0 src/com/prey/activities/SendConfirmationSMSActivity.java
  74. +20 −0 src/com/prey/activities/SetupActivity.java
  75. +230 −0 src/com/prey/activities/WelcomeActivity.java
  76. +12 −0 src/com/prey/backwardcompatibility/AboveCupcakeSupport.java
  77. +31 −0 src/com/prey/backwardcompatibility/CupcakeSupport.java
  78. +61 −0 src/com/prey/backwardcompatibility/FroyoSupport.java
  79. +1,754 −0 src/com/prey/net/Base64.java
  80. +82 −0 src/com/prey/net/PreyHttpResponse.java
  81. +225 −0 src/com/prey/net/PreyRestHttpClient.java
  82. +416 −0 src/com/prey/net/PreyWebServices.java
  83. +39 −0 src/com/prey/preferences/ChangeActivationPhrasePreferences.java
  84. +39 −0 src/com/prey/preferences/ChangeDeactivationPhrasePreferences.java
  85. +99 −0 src/com/prey/preferences/ChangePasswordPreferences.java
  86. +84 −0 src/com/prey/preferences/DetachDevicePreferences.java
  87. +57 −0 src/com/prey/preferences/DeviceAdminPreference.java
  88. +38 −0 src/com/prey/preferences/GoToControlPanelDialogPreference.java
  89. +29 −0 src/com/prey/preferences/StartPreyPreference.java
  90. +60 −0 src/com/prey/preferences/StopPreyPreference.java
  91. +26 −0 src/com/prey/preferences/UpdateSimPreference.java
  92. +68 −0 src/com/prey/receivers/C2DMReceiver.java
  93. +24 −0 src/com/prey/receivers/PreyBootController.java
  94. +54 −0 src/com/prey/receivers/PreyDeviceAdmin.java
  95. +18 −0 src/com/prey/receivers/PreyShutdownReceiver.java
  96. +59 −0 src/com/prey/receivers/SmsReceiver.java
  97. +194 −0 src/com/prey/services/LocationService.java
  98. +100 −0 src/com/prey/services/PreyBootService.java
  99. +64 −0 src/com/prey/services/PreyRunnerService.java
  100. +34 −0 src/com/prey/sms/SMSSupport.java
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>PreyForAndroid</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.prey"
+ android:versionName="0.5"
+ android:versionCode="25">
+
+ <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="8" />
+
+ <supports-screens
+ android:largeScreens="true"
+ android:normalScreens="true"
+ android:smallScreens="true"
+ android:anyDensity="false" />
+
+ <!-- Only this application can receive the messages and registration result -->
+ <permission android:name="com.prey.permission.C2D_MESSAGE" android:protectionLevel="signature" />
+ <uses-permission android:name="com.prey.permission.C2D_MESSAGE" />
+
+ <application android:icon="@drawable/logo" android:label="@string/preyForAndroid_name">
+
+ <!-- Activities -->
+ <activity
+ android:name="com.prey.activities.WelcomeActivity"
+ android:label="@string/preyForAndroid_name"
+ android:configChanges="orientation|keyboardHidden">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+
+ <activity
+ android:name="com.prey.activities.PreyConfigurationActivity"
+ android:configChanges="orientation|keyboardHidden"
+ android:finishOnTaskLaunch="true"
+ />
+
+ <activity android:name="com.prey.activities.PopUpAlertActivity"
+ android:configChanges="orientation|keyboardHidden"
+ android:label="@string/preyForAndroid_name"
+ android:launchMode="singleTask"/>
+ <activity
+ android:name="com.prey.activities.SendConfirmationSMSActivity"
+ android:configChanges="orientation|keyboardHidden"
+ android:noHistory = "true">
+ <intent-filter>
+ <action android:name="com.prey.activities.SEND_SMS_CONF" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity>
+
+ <activity android:name="com.prey.activities.CreateAccountActivity" android:configChanges="orientation|keyboardHidden"/>
+ <activity android:name="com.prey.activities.CheckPasswordActivity" android:configChanges="orientation|keyboardHidden"/>
+ <activity android:name="com.prey.activities.AddDeviceToAccountActivity" android:configChanges="orientation|keyboardHidden"/>
+ <activity android:name="com.prey.activities.AgreementDialogActivity" android:configChanges="orientation|keyboardHidden"/>
+
+
+ <!-- Services -->
+ <service android:name="com.prey.services.LocationService" />
+ <service android:name="com.prey.services.PreyBootService" />
+ <service android:name="com.prey.services.PreyRunnerService" />
+
+
+ <!-- Receivers -->
+ <receiver android:name="com.prey.receivers.SmsReceiver">
+ <intent-filter>
+ <action android:name="android.provider.Telephony.SMS_RECEIVED" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.prey.receivers.PreyBootController"
+ android:enabled="true"
+ android:exported="false"
+ android:label="PreyBootController">
+ <intent-filter>
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.prey.receivers.PreyShutdownReceiver"
+ android:enabled="true"
+ android:exported="false"
+ android:label="PreyShutdownReceiver">
+ <intent-filter>
+ <action android:name="android.intent.action.ACTION_SHUTDOWN" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="com.prey.receivers.PreyDeviceAdmin"
+ android:label="@string/device_admin_label"
+ android:description="@string/device_admin_description"
+ android:permission="android.permission.BIND_DEVICE_ADMIN">
+ <meta-data android:name="android.app.device_admin"
+ android:resource="@xml/security_policies" />
+ <intent-filter>
+ <action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
+ <action android:name="android.app.action.ACTION_PASSWORD_SUCCEEDED" />
+ <action android:name="android.app.action.ACTION_PASSWORD_CHANGED" />
+ </intent-filter>
+ </receiver>
+
+ <!-- Only C2DM servers can send messages for the app. If permission is not set - any other app can generate it -->
+ <receiver android:name="com.prey.receivers.C2DMReceiver" android:permission="com.google.android.c2dm.permission.SEND">
+ <!-- Receive the actual message -->
+ <intent-filter>
+ <action android:name="com.google.android.c2dm.intent.RECEIVE" />
+ <category android:name="com.prey" />
+ </intent-filter>
+ <!-- Receive the registration id -->
+ <intent-filter>
+ <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
+ <category android:name="com.prey" />
+ </intent-filter>
+ </receiver>
+
+ </application>
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+ <uses-permission android:name="android.permission.INTERNET"/>
+ <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+ <uses-permission android:name="android.permission.ACTION_SHUTDOWN" />
+ <uses-permission android:name="android.permission.RECEIVE_SMS"/>
+ <uses-permission android:name="android.permission.READ_CONTACTS"/>
+ <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+ <uses-permission android:name="android.permission.SEND_SMS"/>
+ <uses-permission android:name="android.permission.BIND_DEVICE_ADMIN"/>
+
+ <!-- This app has permission to register and receive message -->
+ <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
+
+
+</manifest>
0 README
No changes.
Binary file not shown.
@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Indicates whether an apk should be generated for each density.
+split.density=false
+# Project target.
+target=Google Inc.:Google APIs:8
+apk-configurations=
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,7 @@
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <stroke android:width="2dp" android:color="#FFFFFF" />
+ <solid android:color="#444646"/>
+ <padding android:left="7dp" android:top="7dp"
+ android:right="7dp" android:bottom="7dp" />
+ <corners android:radius="4dp" />
+</shape>
Binary file not shown.
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+ <gradient
+ android:startColor="#00000000"
+ android:centerColor="#FFFFFFFF"
+ android:endColor="#00000000"
+ android:angle="0" />
+</shape>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:fadingEdge="horizontal|vertical"
+ android:scrollbars="vertical" android:background="@drawable/border"
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent" android:padding="0px" android:layout_margin="10px" android:layout_gravity="center_vertical">
+
+
+ <!-- Data entry layout -->
+ <ScrollView android:id="@+id/ScrollView01" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_margin="0px">
+
+
+
+ <LinearLayout android:layout_height="wrap_content"
+ android:id="@+id/LinearLayoutData"
+ android:orientation="vertical"
+ android:layout_width="fill_parent" android:layout_gravity="top|center_horizontal">
+
+ <!-- Title Layout -->
+ <LinearLayout android:layout_height="wrap_content"
+ android:id="@+id/LinearLayoutTitle" android:layout_width="fill_parent">
+ <ImageView android:id="@+id/ImageView01"
+ android:layout_width="wrap_content" android:layout_height="wrap_content"
+ android:background="@drawable/logo"
+ android:paddingTop="5px" android:layout_marginTop="10px" android:layout_marginLeft="10px"></ImageView>
+ <TextView android:id="@+id/TextView01" android:layout_height="fill_parent"
+ android:layout_width="fill_parent" android:text="@string/set_old_user_dialog_title"
+ android:paddingRight="10px" android:textAppearance="?android:attr/textAppearanceMedium" android:gravity="center_vertical" android:paddingLeft="10px"></TextView>
+ </LinearLayout>
+
+ <View android:id="@+id/divider"
+ android:background="@drawable/gradient_line"
+ android:layout_width="fill_parent"
+ android:layout_height="1dp" android:layout_marginTop="10px" android:layout_marginLeft="15dp" android:layout_marginRight="15dp"/>
+
+
+ <TextView
+ android:id="@+id/email_label"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginLeft="20dip"
+ android:layout_marginRight="20dip"
+ android:text="@string/set_old_user_dialog_email"
+ android:gravity="left"
+ android:textAppearance="?android:attr/textAppearanceMedium" android:paddingTop="10px"/>
+
+ <EditText
+ android:id="@+id/set_old_user_dialog_email_edit"
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:layout_marginLeft="20dip"
+ android:layout_marginRight="20dip"
+ android:scrollHorizontally="true"
+ android:autoText="false"
+ android:capitalize="none"
+ android:gravity="fill_horizontal"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:inputType="textEmailAddress" android:lines="1" android:imeOptions="actionNext|flagNoAccessoryAction|flagNoEnterAction"/>
+
+ <TextView
+ android:id="@+id/password_view"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginLeft="20dip"
+ android:layout_marginRight="20dip"
+ android:text="@string/set_old_user_dialog_password"
+ android:gravity="left"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ <EditText
+ android:id="@+id/set_old_user_dialog_password_edit"
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:scrollHorizontally="true"
+ android:gravity="fill_horizontal"
+ android:textAppearance="?android:attr/textAppearanceMedium" android:lines="1" android:inputType="textPassword" android:imeOptions="actionDone" android:layout_marginLeft="20dip" android:layout_marginBottom="15dip" android:layout_marginRight="20dip"/>
+
+ <!-- Button Layout -->
+ <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" android:layout_marginBottom="15dip" android:layout_marginLeft="20dip" android:layout_marginRight="20dip" android:id="@+id/add_device_info_text" android:text="@string/add_device_info_text"></TextView><LinearLayout android:layout_height="wrap_content"
+ android:id="@+id/LinearLayoutButtons" android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:background="#CCC" android:gravity="center_vertical|center_horizontal|center" android:paddingTop="4px" android:paddingBottom="1px" android:layout_marginLeft="3px" android:layout_marginRight="3px" android:layout_marginBottom="3px">
+ <Button android:text="@string/set_old_user_dialog_create"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" android:layout_gravity="center_horizontal"
+ android:id="@+id/ButtonAddAccount" android:gravity="center_vertical|center_horizontal|center"></Button>
+ </LinearLayout>
+
+
+</LinearLayout>
+ </ScrollView>
+</LinearLayout>
Oops, something went wrong.

0 comments on commit 44cf306

Please sign in to comment.