Skip to content

Commit

Permalink
Added encrypted and plaintext backup / restore. Re-added import SMS d…
Browse files Browse the repository at this point in the history
…atabase. Removed apk expire.
  • Loading branch information
johanw666 committed Aug 23, 2018
1 parent c5309ce commit c7c00af
Show file tree
Hide file tree
Showing 70 changed files with 2,097 additions and 7 deletions.
11 changes: 10 additions & 1 deletion AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@
android:theme="@style/TextSecure.LightTheme"
android:largeHeap="true">

<!-- JW: Change Google API key because this key is bound to the apk signing key -->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCSx9xea86GwDKGznCAULE9Y5a8b-TfN9U"/>
android:value="AIzaSyCj8CBpc88qzpvHtL4zYs0MMeNScGup7SY"/>

<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Expand Down Expand Up @@ -422,6 +423,14 @@
android:exported="true"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<!-- JW: Add activity used in plaintext backup import / export -->
<activity android:name=".ImportExportActivity"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<!-- JW: Add activity used in encrypted backup import -->
<activity android:name=".ExitActivity"
android:theme="@android:style/Theme.NoDisplay" />

<service android:enabled="true" android:name="org.thoughtcrime.securesms.service.WebRtcCallService"/>
<service android:enabled="true" android:name=".service.ApplicationMigrationService"/>
<service android:enabled="true" android:exported="false" android:name=".service.KeyCachingService"/>
Expand Down
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,17 @@ android {

defaultConfig {
versionCode 398
versionName "4.25.4"
versionName "4.25.4.1-JW"

minSdkVersion 14
targetSdkVersion 25
multiDexEnabled true

vectorDrawables.useSupportLibrary = true
project.ext.set("archivesBaseName", "Signal");
project.ext.set("archivesBaseName", "Signal-Android"); /* JW: change basename */

buildConfigField "long", "BUILD_TIMESTAMP", getLastCommitTimestamp() + "L"
/* JW: change back to old code that works without having Git in the path, timestamp is not used anyway */
buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L"
buildConfigField "String", "SIGNAL_URL", "\"https://textsecure-service.whispersystems.org\""
buildConfigField "String", "SIGNAL_CDN_URL", "\"https://cdn.signal.org\""
buildConfigField "String", "SIGNAL_SERVICE_STATUS_URL", "\"uptime.signal.org\""
Expand Down Expand Up @@ -369,6 +370,7 @@ android {

lintOptions {
abortOnError false
disable "ResourceType" /* JW: Add option to disable error in ContactSelectionListAdapter.java line 128 */
}
}

Expand Down
Binary file added res/drawable-xxxhdpi/ic_lock_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
264 changes: 264 additions & 0 deletions res/layout/import_export_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:gravity="center_vertical">

<LinearLayout android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:gravity="center_vertical"
android:text="@string/ImportExportActivity_import"
android:textSize="14sp"
android:fontFamily="sans-serif-medium"
android:textColor="@color/signal_primary_dark"/>

<LinearLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">

<LinearLayout android:id="@+id/import_sms"
android:clickable="true"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:gravity="center_vertical"
android:background="?selectableItemBackground">

<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginRight="32dp"
android:layout_marginEnd="32dp"
android:src="@drawable/ic_message_white_24dp"
android:tint="?attr/pref_icon_tint"/>

<LinearLayout android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp">

<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
style="@style/Registration.Description"
android:text="@string/import_fragment__import_system_sms_database"/>

<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/import_fragment__import_the_database_from_the_default_system"/>

</LinearLayout>
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"/>

<LinearLayout android:id="@+id/import_plaintext_backup"
android:clickable="true"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:gravity="center_vertical"
android:background="?selectableItemBackground">

<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginRight="32dip"
android:layout_marginEnd="32dip"
android:src="@drawable/ic_content_copy_white_24dp"
android:tint="?attr/pref_icon_tint"/>

<LinearLayout android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp">

<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
style="@style/Registration.Description"
android:text="@string/import_fragment__import_plaintext_backup"/>

<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/import_fragment__import_a_plaintext_backup_file"/>
</LinearLayout>
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"/>

<LinearLayout android:id="@+id/import_encrypted_backup"
android:clickable="true"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:gravity="center_vertical"
android:background="?selectableItemBackground">

<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginRight="32dip"
android:layout_marginEnd="32dip"
android:src="@drawable/ic_lock_white_24dp"
android:tint="?attr/pref_icon_tint"/>

<LinearLayout android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp">

<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
style="@style/Registration.Description"
android:text="@string/import_fragment__restore_encrypted_backup"/>

<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/import_fragment__restore_a_previously_exported_encrypted_signal_backup"/>
</LinearLayout>
</LinearLayout>

</LinearLayout>

<include layout="@layout/preference_divider"/>

<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:gravity="center_vertical"
android:text="@string/ImportExportActivity_export"
android:textSize="14sp"
android:fontFamily="sans-serif-medium"
android:textColor="@color/signal_primary_dark"/>

<LinearLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">

<LinearLayout android:id="@+id/export_plaintext_backup"
android:clickable="true"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:gravity="center_vertical"
android:background="?selectableItemBackground">

<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginRight="32dp"
android:layout_marginEnd="32dp"
android:src="@drawable/ic_content_copy_white_24dp"
android:tint="?attr/pref_icon_tint"/>

<LinearLayout android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp">

<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
style="@style/Registration.Description"
android:text="@string/export_fragment__export_plaintext_backup"/>

<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/export_fragment__export_a_plaintext_backup_compatible_with"/>
</LinearLayout>
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"/>

<LinearLayout android:id="@+id/export_encrypted_backup"
android:clickable="true"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:gravity="center_vertical"
android:background="?selectableItemBackground">

<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginRight="32dp"
android:layout_marginEnd="32dp"
android:src="@drawable/ic_lock_white_24dp"
android:tint="?attr/pref_icon_tint"/>

<LinearLayout android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp">

<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
style="@style/Registration.Description"
android:text="@string/export_fragment__export_encrypted_backup"/>

<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/export_fragment__export_an_encrypted_backup_to_the_sd_card"/>
</LinearLayout>
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"/>

</LinearLayout>
</LinearLayout>
</ScrollView>
3 changes: 3 additions & 0 deletions res/menu/text_secure_normal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<item android:title="@string/text_secure_normal__invite_friends"
android:id="@+id/menu_invite" />

<item android:title="@string/arrays__import_export_orig"
android:id="@+id/menu_import_export" />

<item android:title="@string/text_secure_normal__menu_settings"
android:id="@+id/menu_settings" />

Expand Down
23 changes: 23 additions & 0 deletions res/values-ar/strings1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<!--arrays.xml-->
<string name="arrays__import_export_orig">استيراد / تصدير</string>
<!--ImportFragment-->
<string name="ImportFragment_restore_encrypted_backup">استعادة نسخة احتياطية مشفرة؟</string>
<string name="ImportFragment_restoring_an_encrypted_backup_will_completely_replace_your_existing_keys">
استرجاع نسخة احتياطية مشفرة يؤدي إلى استبدال المفاتيح حالية والإعدادات والرسائل. المعلومات الحالية في سيجنال والغير موجودة في النسخة الاحتياطية سوف تفقد.</string>
<string name="ImportFragment_restore">استعادة</string>
<string name="ImportFragment_restoring">الاستعادة جارٍ...</string>
<string name="ImportFragment_restoring_encrypted_backup">استعادة النسخ الاحتياطية المشفرة جارٍ..</string>
<string name="ImportFragment_no_encrypted_backup_found">لم يتم العثور على نسخة احتياطية مشفرة!</string>
<string name="ImportFragment_restore_complete">تمت الاستعادة!</string>
<!--ExportFragment-->
<string name="ExportFragment_export_to_sd_card">تصديرإلى كرت الذاكرة؟</string>
<string name="ExportFragment_this_will_export_your_encrypted_keys_settings_and_messages">هذه الخاصية تصدر مفاتيحك المشفرة و إعداداتك و رسائلك لكرت الذاكرة.</string>
<string name="ExportFragment_exporting_keys_settings_and_messages">جاري تصدير مفاتيحك المشفرة و إعداداتك و رسائلك</string>
<!--database_upgrade_activity-->
<string name="export_fragment__export_encrypted_backup">استعادة النسخ الاحتياطية المشفرة</string>
<string name="export_fragment__export_an_encrypted_backup_to_the_sd_card">تصدير نسخة احتياطية غير مشفرة لكرت الذاكرة...</string>
<string name="import_fragment__restore_encrypted_backup">استعادة نسخة احتياطية مشفرة</string>
<string name="import_fragment__restore_a_previously_exported_encrypted_signal_backup"> استعادة نسخة احتياطية مشفرة من سيجنال.</string>
</resources>
5 changes: 5 additions & 0 deletions res/values-be/strings1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<!--arrays.xml-->
<string name="arrays__import_export_orig">Імпарт / экспарт</string>
</resources>
Loading

0 comments on commit c7c00af

Please sign in to comment.