Merge Signal 4.41.0
@ -182,6 +182,21 @@
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
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"
|
||||
android:targetActivity="org.thoughtcrime.securesms.ConversationListActivity"
|
||||
android:exported="true">
|
||||
@ -323,6 +338,12 @@
|
||||
android:label="@string/AndroidManifest__linked_devices"
|
||||
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"
|
||||
android:label="@string/AndroidManifest__log_submit"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
@ -598,6 +619,14 @@
|
||||
android:authorities="network.loki.securesms.database.attachment"
|
||||
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">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||
|
38
build.gradle
@ -181,6 +181,16 @@ dependencies {
|
||||
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 {
|
||||
flavorDimensions "none"
|
||||
compileSdkVersion 28
|
||||
@ -192,8 +202,8 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
versionCode 6
|
||||
versionName "1.0.0"
|
||||
versionCode canonicalVersionCode * postFixSize
|
||||
versionName canonicalVersionName
|
||||
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 28
|
||||
@ -214,9 +224,10 @@ android {
|
||||
buildConfigField "String", "MRENCLAVE", "\"cd6cfc342937b23b1bdd3bbf9721aa5615ac9ff50a75c5527d441cd3276826c9\""
|
||||
buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"BXu6QIKVz5MA8gstzfOgRQGqyLqOwNKHL6INkv3IHWMF\""
|
||||
buildConfigField "String[]", "LANGUAGES", "new String[]{\"" + autoResConfig().collect { s -> s.replace('-r', '_') }.join('", "') + '"}'
|
||||
buildConfigField "int", "CANONICAL_VERSION_CODE", "$canonicalVersionCode"
|
||||
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a', 'x86'
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||
}
|
||||
|
||||
resConfigs autoResConfig()
|
||||
@ -225,7 +236,7 @@ android {
|
||||
abi {
|
||||
enable true
|
||||
reset()
|
||||
include 'armeabi-v7a', 'x86'
|
||||
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||
universalApk true
|
||||
}
|
||||
}
|
||||
@ -295,8 +306,14 @@ android {
|
||||
}
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
variant.outputs.all {
|
||||
outputFileName = outputFileName.replace(".apk", "-${variant.versionName}.apk")
|
||||
variant.outputs.each { output ->
|
||||
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 {
|
||||
abortOnError false
|
||||
abortOnError true
|
||||
baseline file("lint-baseline.xml")
|
||||
}
|
||||
|
||||
testOptions {
|
||||
@ -345,8 +363,8 @@ def assembleWebsiteDescriptor = { variant, file ->
|
||||
String apkName = file.getName()
|
||||
|
||||
String descriptor = "{" +
|
||||
"\"versionCode\" : $project.android.defaultConfig.versionCode," +
|
||||
"\"versionName\" : \"$project.android.defaultConfig.versionName\"," +
|
||||
"\"versionCode\" : $canonicalVersionCode," +
|
||||
"\"versionName\" : \"$canonicalVersionName\"," +
|
||||
"\"sha256sum\" : \"$digest\"," +
|
||||
"\"url\" : \"$url/$apkName\"" +
|
||||
"}"
|
||||
@ -427,5 +445,5 @@ static def autoResConfig() {
|
||||
task qa {
|
||||
group 'Verification'
|
||||
description 'Quality Assurance. Run before pushing.'
|
||||
dependsOn ':testPlayReleaseUnitTest', ':assemblePlayDebug'
|
||||
dependsOn ':testPlayReleaseUnitTest', ':lintPlayRelease', ':assemblePlayDebug'
|
||||
}
|
||||
|
@ -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>
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
implementation-class=org.whispersystems.witness.WitnessPlugin
|
55
lint-baseline.xml
Normal 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)

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)`

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<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=" <intent-filter>"
|
||||
errorLine2=" ^">
|
||||
<location
|
||||
file="AndroidManifest.xml"
|
||||
line="368"
|
||||
column="9"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="AppLinkUrlError"
|
||||
message="Missing URL"
|
||||
errorLine1=" <intent-filter>"
|
||||
errorLine2=" ^">
|
||||
<location
|
||||
file="AndroidManifest.xml"
|
||||
line="381"
|
||||
column="9"/>
|
||||
</issue>
|
||||
|
||||
</issues>
|
@ -34,6 +34,11 @@ message Attachment {
|
||||
optional uint32 length = 3;
|
||||
}
|
||||
|
||||
message Sticker {
|
||||
optional uint64 rowId = 1;
|
||||
optional uint32 length = 2;
|
||||
}
|
||||
|
||||
message Avatar {
|
||||
optional string name = 1;
|
||||
optional uint32 length = 2;
|
||||
@ -56,4 +61,5 @@ message BackupFrame {
|
||||
optional DatabaseVersion version = 5;
|
||||
optional bool end = 6;
|
||||
optional Avatar avatar = 7;
|
||||
optional Sticker sticker = 8;
|
||||
}
|
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 599 B |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 499 B |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 654 B |
Before Width: | Height: | Size: 627 B |
Before Width: | Height: | Size: 586 B |
Before Width: | Height: | Size: 654 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 745 B |
Before Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 589 B |
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 386 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 492 B |
Before Width: | Height: | Size: 479 B |
Before Width: | Height: | Size: 451 B |
Before Width: | Height: | Size: 492 B |
Before Width: | Height: | Size: 753 B |
Before Width: | Height: | Size: 731 B |
Before Width: | Height: | Size: 730 B |
Before Width: | Height: | Size: 753 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 809 B |
Before Width: | Height: | Size: 847 B |
Before Width: | Height: | Size: 849 B |
Before Width: | Height: | Size: 809 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 806 B |
Before Width: | Height: | Size: 776 B |
Before Width: | Height: | Size: 785 B |
Before Width: | Height: | Size: 806 B |
Before Width: | Height: | Size: 458 B |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 388 B |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 773 B |
Before Width: | Height: | Size: 795 B |
Before Width: | Height: | Size: 794 B |
Before Width: | Height: | Size: 773 B |
Before Width: | Height: | Size: 694 B |
17
res/drawable-v21/sticker_button_dark.xml
Normal 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>
|
17
res/drawable-v21/sticker_button_light.xml
Normal 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>
|
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 808 B |
Before Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 680 B |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 685 B |