Merge Signal 4.41.0

This commit is contained in:
Niels Andriesse 2019-08-07 16:48:54 +10:00
commit 1822e87f7c
584 changed files with 9504 additions and 1558 deletions

View File

@ -182,6 +182,21 @@
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize" android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
android:exported="true" /> android:exported="true" />
<activity android:name=".stickers.StickerPackPreviewActivity"
android:theme="@style/TextSecure.LightNoActionBar"
android:launchMode="singleTask"
android:noHistory="true"
android:windowSoftInputMode="stateHidden"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="sgnl"
android:host="addstickers" />
</intent-filter>
</activity>
<activity-alias android:name=".RoutingActivity" <activity-alias android:name=".RoutingActivity"
android:targetActivity="org.thoughtcrime.securesms.ConversationListActivity" android:targetActivity="org.thoughtcrime.securesms.ConversationListActivity"
android:exported="true"> android:exported="true">
@ -323,6 +338,12 @@
android:label="@string/AndroidManifest__linked_devices" android:label="@string/AndroidManifest__linked_devices"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/> android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
<activity android:name="org.thoughtcrime.securesms.stickers.StickerManagementActivity"
android:launchMode="singleTask"
android:theme="@style/TextSecure.LightTheme"
android:windowSoftInputMode="stateUnchanged"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
<activity android:name="org.thoughtcrime.securesms.LogSubmitActivity" <activity android:name="org.thoughtcrime.securesms.LogSubmitActivity"
android:label="@string/AndroidManifest__log_submit" android:label="@string/AndroidManifest__log_submit"
android:windowSoftInputMode="stateHidden" android:windowSoftInputMode="stateHidden"
@ -598,6 +619,14 @@
android:authorities="network.loki.securesms.database.attachment" android:authorities="network.loki.securesms.database.attachment"
android:exported="false" /> android:exported="false" />
<provider android:name="org.thoughtcrime.securesms.database.DatabaseContentProviders$Sticker"
android:authorities="network.loki.securesms.database.sticker"
android:exported="false" />
<provider android:name="org.thoughtcrime.securesms.database.DatabaseContentProviders$StickerPack"
android:authorities="network.loki.securesms.database.stickerpack"
android:exported="false" />
<receiver android:name="org.thoughtcrime.securesms.service.BootReceiver"> <receiver android:name="org.thoughtcrime.securesms.service.BootReceiver">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/> <action android:name="android.intent.action.BOOT_COMPLETED"/>

View File

@ -181,6 +181,16 @@ dependencies {
implementation "com.github.lelloman:android-identicons:$identicon_version" implementation "com.github.lelloman:android-identicons:$identicon_version"
} }
def canonicalVersionCode = 6
def canonicalVersionName = "1.0.0"
def postFixSize = 10
def abiPostFix = ['armeabi-v7a' : 1,
'arm64-v8a' : 2,
'x86' : 3,
'x86_64' : 4,
'universal' : 5]
android { android {
flavorDimensions "none" flavorDimensions "none"
compileSdkVersion 28 compileSdkVersion 28
@ -192,8 +202,8 @@ android {
} }
defaultConfig { defaultConfig {
versionCode 6 versionCode canonicalVersionCode * postFixSize
versionName "1.0.0" versionName canonicalVersionName
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28
@ -214,9 +224,10 @@ android {
buildConfigField "String", "MRENCLAVE", "\"cd6cfc342937b23b1bdd3bbf9721aa5615ac9ff50a75c5527d441cd3276826c9\"" buildConfigField "String", "MRENCLAVE", "\"cd6cfc342937b23b1bdd3bbf9721aa5615ac9ff50a75c5527d441cd3276826c9\""
buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"BXu6QIKVz5MA8gstzfOgRQGqyLqOwNKHL6INkv3IHWMF\"" buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"BXu6QIKVz5MA8gstzfOgRQGqyLqOwNKHL6INkv3IHWMF\""
buildConfigField "String[]", "LANGUAGES", "new String[]{\"" + autoResConfig().collect { s -> s.replace('-r', '_') }.join('", "') + '"}' buildConfigField "String[]", "LANGUAGES", "new String[]{\"" + autoResConfig().collect { s -> s.replace('-r', '_') }.join('", "') + '"}'
buildConfigField "int", "CANONICAL_VERSION_CODE", "$canonicalVersionCode"
ndk { ndk {
abiFilters 'armeabi-v7a', 'x86' abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
} }
resConfigs autoResConfig() resConfigs autoResConfig()
@ -225,7 +236,7 @@ android {
abi { abi {
enable true enable true
reset() reset()
include 'armeabi-v7a', 'x86' include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
universalApk true universalApk true
} }
} }
@ -295,8 +306,14 @@ android {
} }
android.applicationVariants.all { variant -> android.applicationVariants.all { variant ->
variant.outputs.all { variant.outputs.each { output ->
outputFileName = outputFileName.replace(".apk", "-${variant.versionName}.apk") output.outputFileName = output.outputFileName.replace(".apk", "-${variant.versionName}.apk")
def abiName = output.getFilter("ABI") ?: 'universal'
def postFix = abiPostFix.get(abiName, 0)
if (postFix >= postFixSize) throw new AssertionError("postFix is too large")
output.versionCodeOverride = canonicalVersionCode * postFixSize + postFix
} }
} }
@ -323,7 +340,8 @@ android {
} }
lintOptions { lintOptions {
abortOnError false abortOnError true
baseline file("lint-baseline.xml")
} }
testOptions { testOptions {
@ -345,8 +363,8 @@ def assembleWebsiteDescriptor = { variant, file ->
String apkName = file.getName() String apkName = file.getName()
String descriptor = "{" + String descriptor = "{" +
"\"versionCode\" : $project.android.defaultConfig.versionCode," + "\"versionCode\" : $canonicalVersionCode," +
"\"versionName\" : \"$project.android.defaultConfig.versionName\"," + "\"versionName\" : \"$canonicalVersionName\"," +
"\"sha256sum\" : \"$digest\"," + "\"sha256sum\" : \"$digest\"," +
"\"url\" : \"$url/$apkName\"" + "\"url\" : \"$url/$apkName\"" +
"}" "}"
@ -427,5 +445,5 @@ static def autoResConfig() {
task qa { task qa {
group 'Verification' group 'Verification'
description 'Quality Assurance. Run before pushing.' description 'Quality Assurance. Run before pushing.'
dependsOn ':testPlayReleaseUnitTest', ':assemblePlayDebug' dependsOn ':testPlayReleaseUnitTest', ':lintPlayRelease', ':assemblePlayDebug'
} }

View File

@ -0,0 +1,92 @@
package org.whispersystems.witness
import org.gradle.api.InvalidUserDataException
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ResolvedArtifact
import java.security.MessageDigest
class WitnessPluginExtension {
List verify
String configuration
}
class WitnessPlugin implements Plugin<Project> {
static String calculateSha256(file) {
MessageDigest md = MessageDigest.getInstance("SHA-256");
file.eachByte 4096, {bytes, size ->
md.update(bytes, 0, size);
}
return md.digest().collect {String.format "%02x", it}.join();
}
void apply(Project project) {
project.extensions.create("dependencyVerification", WitnessPluginExtension)
project.afterEvaluate {
project.dependencyVerification.verify.each {
assertion ->
List parts = assertion.tokenize(":")
String group = parts.get(0)
String name = parts.get(1)
String hash = parts.get(2)
def artifacts = allArtifacts(project).findAll {
return it.name.equals(name) && it.moduleVersion.id.group.equals(group)
}
if (artifacts.size() > 1) {
throw new InvalidUserDataException("Multiple artifacts found for $group:$name, ${artifacts.size()} found")
}
ResolvedArtifact dependency = artifacts.find()
println "Verifying " + group + ":" + name
if (dependency == null) {
throw new InvalidUserDataException("No dependency for integrity assertion found: " + group + ":" + name)
}
if (!hash.equals(calculateSha256(dependency.file))) {
throw new InvalidUserDataException("Checksum failed for " + assertion)
}
}
}
project.task('calculateChecksums').doLast {
println "dependencyVerification {"
def configurationName = project.dependencyVerification.configuration
if (configurationName != null) {
println " configuration = '$configurationName'"
}
println " verify = ["
allArtifacts(project).each {
dep ->
println " '" + dep.moduleVersion.id.group+ ":" + dep.name + ":" + calculateSha256(dep.file) + "',"
}
println " ]"
println "}"
}
}
private static Set<ResolvedArtifact> allArtifacts(Project project) {
def configurationName = project.dependencyVerification.configuration
project.configurations
.findAll { config -> config.name =~ configurationName }
.collectMany { tryGetArtifacts(it) }
}
private static Set<ResolvedArtifact> tryGetArtifacts(Configuration configuration) {
try {
configuration.resolvedConfiguration.resolvedArtifacts
} catch (Exception ignored) {
[] as Set<ResolvedArtifact>
}
}
}

View File

@ -0,0 +1 @@
implementation-class=org.whispersystems.witness.WitnessPlugin

Binary file not shown.

55
lint-baseline.xml Normal file
View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="5" by="lint 3.3.2" client="gradle" variant="playRelease" version="3.3.2">
<issue
id="LintError"
message="Unexpected failure during lint analysis of JobManager.java (this is a bug in lint or one of the libraries it depends on)&#xA;&#xA;Stack: `NullPointerException:ClsFileImpl.getMirror(ClsFileImpl.java:343)←ClsElementImpl.getMirror(ClsElementImpl.java:159)←ClsElementImpl.getText(ClsElementImpl.java:202)←InferenceSession.argConstraints(InferenceSession.java:1817)←InferenceSession.isFunctionalTypeMoreSpecific(InferenceSession.java:1748)←InferenceSession.isFunctionalTypeMoreSpecificOnExpression(InferenceSession.java:1729)←JavaMethodsConflictResolver.isFunctionalTypeMoreSpecific(JavaMethodsConflictResolver.java:779)←JavaMethodsConflictResolver.isTypeMoreSpecific(JavaMethodsConflictResolver.java:673)`&#xA;&#xA;You can set environment variable `LINT_PRINT_STACKTRACE=true` to dump a full stacktrace to stdout.">
<location
file="src/org/thoughtcrime/securesms/jobmanager/JobManager.java"/>
</issue>
<issue
id="MissingPermission"
message="Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException`"
errorLine1=" List&lt;SubscriptionInfo> list = subscriptionManager.getActiveSubscriptionInfoList();"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/org/thoughtcrime/securesms/util/dualsim/SubscriptionManagerCompat.java"
line="101"
column="35"/>
</issue>
<issue
id="ResourceType"
message="Expected resource of type styleable"
errorLine1=" drawables.getColor(1, 0xff000000);"
errorLine2=" ~">
<location
file="src/org/thoughtcrime/securesms/contacts/ContactSelectionListAdapter.java"
line="187"
column="36"/>
</issue>
<issue
id="AppLinkUrlError"
message="Missing URL"
errorLine1=" &lt;intent-filter>"
errorLine2=" ^">
<location
file="AndroidManifest.xml"
line="368"
column="9"/>
</issue>
<issue
id="AppLinkUrlError"
message="Missing URL"
errorLine1=" &lt;intent-filter>"
errorLine2=" ^">
<location
file="AndroidManifest.xml"
line="381"
column="9"/>
</issue>
</issues>

View File

@ -34,6 +34,11 @@ message Attachment {
optional uint32 length = 3; optional uint32 length = 3;
} }
message Sticker {
optional uint64 rowId = 1;
optional uint32 length = 2;
}
message Avatar { message Avatar {
optional string name = 1; optional string name = 1;
optional uint32 length = 2; optional uint32 length = 2;
@ -56,4 +61,5 @@ message BackupFrame {
optional DatabaseVersion version = 5; optional DatabaseVersion version = 5;
optional bool end = 6; optional bool end = 6;
optional Avatar avatar = 7; optional Avatar avatar = 7;
optional Sticker sticker = 8;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 785 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 773 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 773 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 694 B

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/transparent_white_40">
<item android:id="@+id/mask">
<shape android:shape="oval">
<solid android:color="@color/transparent_black" />
</shape>
</item>
<item>
<shape android:shape="oval" >
<solid android:color="@color/core_grey_75"/>
</shape>
</item>
</ripple>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/transparent_black_40">
<item android:id="@+id/mask">
<shape android:shape="oval">
<solid android:color="@color/transparent_black" />
</shape>
</item>
<item>
<shape android:shape="oval" >
<solid android:color="@color/core_grey_05"/>
</shape>
</item>
</ripple>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 685 B

Some files were not shown because too many files have changed in this diff Show More