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. Added the choice between passphrase protection and the Android screenlock. Added more conversation colors and a theme. Added a choice for the backup location.
  • Loading branch information
johanw666 committed Apr 29, 2019
1 parent ba46a9d commit 6fa6257
Show file tree
Hide file tree
Showing 88 changed files with 2,687 additions and 68 deletions.
13 changes: 12 additions & 1 deletion AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,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 @@ -260,9 +261,11 @@
android:launchMode="singleTask"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<!-- JW: added the windowSoftInputMode=stateAlwaysVisible flag here to show a keyboard on open -->
<activity android:name=".PassphrasePromptActivity"
android:launchMode="singleTask"
android:theme="@style/TextSecure.LightIntroTheme"
android:windowSoftInputMode="stateAlwaysVisible"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

<activity android:name=".NewConversationActivity"
Expand Down Expand Up @@ -435,6 +438,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
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,17 @@ android {

defaultConfig {
versionCode 477
versionName "4.38.3"
versionName "4.38.3.0-JW"

minSdkVersion 19
targetSdkVersion 26
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_CONTACT_DISCOVERY_URL", "\"https://api.directory.signal.org\""
Expand Down Expand Up @@ -487,13 +488,15 @@ task signProductionWebsiteRelease {
}

tasks.whenTaskAdded { task ->
/* JW: Disable extra apk signing steps, Android Studio does the signing already
if (task.name.equals("assemblePlayRelease")) {
task.finalizedBy signProductionPlayRelease
}
if (task.name.equals("assembleWebsiteRelease")) {
task.finalizedBy signProductionWebsiteRelease
}
*/
}

def getLastCommitTimestamp() {
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.
16 changes: 16 additions & 0 deletions res/drawable/compose_background_oled.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<stroke
android:width="1dp"
android:color="@color/core_grey_75" />

<solid
android:color="@color/black" />

<corners
android:radius="20dp" />

</shape>
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>
19 changes: 19 additions & 0 deletions res/layout/registration_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,25 @@
app:cpb_selectorIdle="@drawable/progress_button_state"
app:cpb_textIdle="@string/registration_activity__restore_backup" />

<!-- JW: import encrypted backup -->
<!-- JW: this doesn't work yet so we make the button invisible for now. Remove the visibility tag to activate -->
<com.dd.CircularProgressButton
android:id="@+id/restore_encrypted_backup_button"
app:cpb_textIdle="@string/registration_activity__restore_encrypted_backup"
app:cpb_selectorIdle="@drawable/progress_button_state"
app:cpb_colorIndicator="@color/white"
app:cpb_colorProgress="@color/textsecure_primary"
app:cpb_cornerRadius="50dp"
android:background="@color/signal_primary"
android:textColor="@color/white"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="20dp"
android:visibility="gone"
android:layout_gravity="center_horizontal"/>

<Button
android:id="@+id/skip_restore_button"
android:layout_width="wrap_content"
Expand Down
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
Loading

0 comments on commit 6fa6257

Please sign in to comment.