diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 53f1c12266..d415492c83 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -30,6 +30,13 @@
+
+
+
+
+
+
-
+
+
+
+
+
+
@@ -158,6 +174,14 @@
+
+
+
+
+
+
+
+
diff --git a/assets/whisper.store b/assets/whisper.store
new file mode 100644
index 0000000000..664ca9563c
Binary files /dev/null and b/assets/whisper.store differ
diff --git a/libs/gcm.jar b/libs/gcm.jar
new file mode 100644
index 0000000000..ac109a830e
Binary files /dev/null and b/libs/gcm.jar differ
diff --git a/libs/libphonenumber-5.3.jar b/libs/libphonenumber-5.3.jar
new file mode 100644
index 0000000000..7be725cc63
Binary files /dev/null and b/libs/libphonenumber-5.3.jar differ
diff --git a/libs/thoughtcrimegson-2.1.jar b/libs/thoughtcrimegson-2.1.jar
new file mode 100644
index 0000000000..8406d51d03
Binary files /dev/null and b/libs/thoughtcrimegson-2.1.jar differ
diff --git a/res/drawable-hdpi/alert.png b/res/drawable-hdpi/alert.png
new file mode 100644
index 0000000000..05012c9741
Binary files /dev/null and b/res/drawable-hdpi/alert.png differ
diff --git a/res/drawable-hdpi/check.png b/res/drawable-hdpi/check.png
new file mode 100644
index 0000000000..58bf972171
Binary files /dev/null and b/res/drawable-hdpi/check.png differ
diff --git a/res/drawable-hdpi/ic_menu_search_holo_light.png b/res/drawable-hdpi/ic_menu_search_holo_light.png
new file mode 100644
index 0000000000..1cb61faf49
Binary files /dev/null and b/res/drawable-hdpi/ic_menu_search_holo_light.png differ
diff --git a/res/drawable-mdpi/alert.png b/res/drawable-mdpi/alert.png
new file mode 100644
index 0000000000..dd647adda8
Binary files /dev/null and b/res/drawable-mdpi/alert.png differ
diff --git a/res/drawable-mdpi/check.png b/res/drawable-mdpi/check.png
new file mode 100644
index 0000000000..cf5fab3adf
Binary files /dev/null and b/res/drawable-mdpi/check.png differ
diff --git a/res/drawable-mdpi/ic_menu_search_holo_light.png b/res/drawable-mdpi/ic_menu_search_holo_light.png
new file mode 100644
index 0000000000..2369d03f33
Binary files /dev/null and b/res/drawable-mdpi/ic_menu_search_holo_light.png differ
diff --git a/res/drawable-xhdpi/alert.png b/res/drawable-xhdpi/alert.png
new file mode 100644
index 0000000000..7e8f1ee27d
Binary files /dev/null and b/res/drawable-xhdpi/alert.png differ
diff --git a/res/drawable-xhdpi/check.png b/res/drawable-xhdpi/check.png
new file mode 100644
index 0000000000..b8915716e0
Binary files /dev/null and b/res/drawable-xhdpi/check.png differ
diff --git a/res/drawable-xhdpi/ic_menu_search_holo_light.png b/res/drawable-xhdpi/ic_menu_search_holo_light.png
new file mode 100644
index 0000000000..578cb24eb0
Binary files /dev/null and b/res/drawable-xhdpi/ic_menu_search_holo_light.png differ
diff --git a/res/drawable/background_pane.9.png b/res/drawable/background_pane.9.png
new file mode 100644
index 0000000000..218ebaada9
Binary files /dev/null and b/res/drawable/background_pane.9.png differ
diff --git a/res/layout/country_list_item.xml b/res/layout/country_list_item.xml
new file mode 100644
index 0000000000..d4ed941c1d
--- /dev/null
+++ b/res/layout/country_list_item.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/country_selection.xml b/res/layout/country_selection.xml
new file mode 100644
index 0000000000..212333686d
--- /dev/null
+++ b/res/layout/country_selection.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/country_selection_fragment.xml b/res/layout/country_selection_fragment.xml
new file mode 100644
index 0000000000..998d36ed99
--- /dev/null
+++ b/res/layout/country_selection_fragment.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/registration_activity.xml b/res/layout/registration_activity.xml
new file mode 100644
index 0000000000..466b710842
--- /dev/null
+++ b/res/layout/registration_activity.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/registration_progress_activity.xml b/res/layout/registration_progress_activity.xml
new file mode 100644
index 0000000000..3cf4797711
--- /dev/null
+++ b/res/layout/registration_progress_activity.xml
@@ -0,0 +1,517 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java b/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java
index 2b224043d3..9e8d25f0f4 100644
--- a/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java
+++ b/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java
@@ -90,6 +90,11 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredSherlockPr
public static final String THREAD_TRIM_LENGTH = "pref_trim_length";
public static final String THREAD_TRIM_NOW = "pref_trim_now";
+ public static final String LOCAL_NUMBER_PREF = "pref_local_number";
+ public static final String VERIFYING_STATE_PREF = "pref_verifying";
+ public static final String REGISTERED_GCM_PREF = "pref_gcm_registered";
+ public static final String GCM_PASSWORD_PREF = "pref_gcm_password";
+
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
diff --git a/src/org/thoughtcrime/securesms/CountrySelectionActivity.java b/src/org/thoughtcrime/securesms/CountrySelectionActivity.java
new file mode 100644
index 0000000000..30b945e3a0
--- /dev/null
+++ b/src/org/thoughtcrime/securesms/CountrySelectionActivity.java
@@ -0,0 +1,29 @@
+package org.thoughtcrime.securesms;
+
+
+import android.content.Intent;
+import android.os.Bundle;
+
+import com.actionbarsherlock.app.SherlockFragmentActivity;
+
+public class CountrySelectionActivity extends SherlockFragmentActivity
+ implements CountrySelectionFragment.CountrySelectedListener
+
+{
+
+ @Override
+ public void onCreate(Bundle bundle) {
+ super.onCreate(bundle);
+ this.setContentView(R.layout.country_selection);
+ }
+
+ @Override
+ public void countrySelected(String countryName, int countryCode) {
+ Intent result = getIntent();
+ result.putExtra("country_name", countryName);
+ result.putExtra("country_code", countryCode);
+
+ this.setResult(RESULT_OK, result);
+ this.finish();
+ }
+}
diff --git a/src/org/thoughtcrime/securesms/CountrySelectionFragment.java b/src/org/thoughtcrime/securesms/CountrySelectionFragment.java
new file mode 100644
index 0000000000..87d2441de5
--- /dev/null
+++ b/src/org/thoughtcrime/securesms/CountrySelectionFragment.java
@@ -0,0 +1,100 @@
+package org.thoughtcrime.securesms;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.v4.app.LoaderManager;
+import android.support.v4.content.Loader;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.EditText;
+import android.widget.ListView;
+import android.widget.SimpleAdapter;
+
+import com.actionbarsherlock.app.SherlockListFragment;
+
+import org.thoughtcrime.securesms.database.loaders.CountryListLoader;
+
+import java.util.ArrayList;
+import java.util.Map;
+
+public class CountrySelectionFragment extends SherlockListFragment implements LoaderManager.LoaderCallbacks>> {
+
+ private EditText countryFilter;
+ private CountrySelectedListener listener;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
+ return inflater.inflate(R.layout.country_selection_fragment, container, false);
+ }
+
+ @Override
+ public void onActivityCreated(Bundle bundle) {
+ super.onActivityCreated(bundle);
+ this.countryFilter = (EditText)getView().findViewById(R.id.country_search);
+ this.countryFilter.addTextChangedListener(new FilterWatcher());
+ getLoaderManager().initLoader(0, null, this).forceLoad();
+ }
+
+ @Override
+ public void onAttach(Activity activity) {
+ super.onAttach(activity);
+ this.listener = (CountrySelectedListener)activity;
+ }
+
+ @Override
+ public void onListItemClick(ListView listView, View view, int position, long id) {
+ Map item = (Map)this.getListAdapter().getItem(position);
+ if (this.listener != null) {
+ this.listener.countrySelected(item.get("country_name"),
+ Integer.parseInt(item.get("country_code").substring(1)));
+ }
+ }
+
+ @Override
+ public Loader>> onCreateLoader(int arg0, Bundle arg1) {
+ return new CountryListLoader(getActivity());
+ }
+
+ @Override
+ public void onLoadFinished(Loader>> loader,
+ ArrayList