kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add the "My Daily Life" sticker pack by Plastic Thing.
rodzic
3fca46de92
commit
89b1243885
|
@ -54,6 +54,7 @@ import org.thoughtcrime.securesms.migrations.RegistrationPinV2MigrationJob;
|
|||
import org.thoughtcrime.securesms.migrations.StickerAdditionMigrationJob;
|
||||
import org.thoughtcrime.securesms.migrations.StickerDayByDayMigrationJob;
|
||||
import org.thoughtcrime.securesms.migrations.StickerLaunchMigrationJob;
|
||||
import org.thoughtcrime.securesms.migrations.StickerMyDailyLifeMigrationJob;
|
||||
import org.thoughtcrime.securesms.migrations.StorageCapabilityMigrationJob;
|
||||
import org.thoughtcrime.securesms.migrations.StorageServiceMigrationJob;
|
||||
import org.thoughtcrime.securesms.migrations.TrimByLengthSettingsMigrationJob;
|
||||
|
@ -190,6 +191,7 @@ public final class JobManagerFactories {
|
|||
put(StickerLaunchMigrationJob.KEY, new StickerLaunchMigrationJob.Factory());
|
||||
put(StickerAdditionMigrationJob.KEY, new StickerAdditionMigrationJob.Factory());
|
||||
put(StickerDayByDayMigrationJob.KEY, new StickerDayByDayMigrationJob.Factory());
|
||||
put(StickerMyDailyLifeMigrationJob.KEY, new StickerMyDailyLifeMigrationJob.Factory());
|
||||
put(StorageCapabilityMigrationJob.KEY, new StorageCapabilityMigrationJob.Factory());
|
||||
put(StorageServiceMigrationJob.KEY, new StorageServiceMigrationJob.Factory());
|
||||
put(TrimByLengthSettingsMigrationJob.KEY, new TrimByLengthSettingsMigrationJob.Factory());
|
||||
|
|
|
@ -81,9 +81,10 @@ public class ApplicationMigrations {
|
|||
static final int LOG_CLEANUP = 39;
|
||||
static final int ATTACHMENT_CLEANUP_2 = 40;
|
||||
static final int ANNOUNCEMENT_GROUP_CAPABILITY = 41;
|
||||
static final int STICKER_MY_DAILY_LIFE = 42;
|
||||
}
|
||||
|
||||
public static final int CURRENT_VERSION = 41;
|
||||
public static final int CURRENT_VERSION = 42;
|
||||
|
||||
/**
|
||||
* This *must* be called after the {@link JobManager} has been instantiated, but *before* the call
|
||||
|
@ -357,6 +358,10 @@ public class ApplicationMigrations {
|
|||
jobs.put(Version.ANNOUNCEMENT_GROUP_CAPABILITY, new AttributesMigrationJob());
|
||||
}
|
||||
|
||||
if (lastSeenVersion < Version.STICKER_MY_DAILY_LIFE) {
|
||||
jobs.put(Version.STICKER_MY_DAILY_LIFE, new StickerMyDailyLifeMigrationJob());
|
||||
}
|
||||
|
||||
return jobs;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package org.thoughtcrime.securesms.migrations;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.jobmanager.Data;
|
||||
import org.thoughtcrime.securesms.jobmanager.Job;
|
||||
import org.thoughtcrime.securesms.jobs.StickerPackDownloadJob;
|
||||
import org.thoughtcrime.securesms.stickers.BlessedPacks;
|
||||
|
||||
/**
|
||||
* Installs Piece of Cake blessed pack.
|
||||
*/
|
||||
public class StickerMyDailyLifeMigrationJob extends MigrationJob {
|
||||
|
||||
public static final String KEY = "StickerMyDailyLifeMigrationJob";
|
||||
|
||||
StickerMyDailyLifeMigrationJob() {
|
||||
this(new Parameters.Builder().build());
|
||||
}
|
||||
|
||||
private StickerMyDailyLifeMigrationJob(@NonNull Parameters parameters) {
|
||||
super(parameters);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUiBlocking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull String getFactoryKey() {
|
||||
return KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performMigration() {
|
||||
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.MY_DAILY_LIFE.getPackId(), BlessedPacks.MY_DAILY_LIFE.getPackKey(), false));
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean shouldRetry(@NonNull Exception e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class Factory implements Job.Factory<StickerMyDailyLifeMigrationJob> {
|
||||
@Override
|
||||
public @NonNull StickerMyDailyLifeMigrationJob create(@NonNull Parameters parameters, @NonNull Data data) {
|
||||
return new StickerMyDailyLifeMigrationJob(parameters);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,11 +15,12 @@ import java.util.Set;
|
|||
*/
|
||||
public final class BlessedPacks {
|
||||
|
||||
public static final Pack ZOZO = new Pack("fb535407d2f6497ec074df8b9c51dd1d", "17e971c134035622781d2ee249e6473b774583750b68c11bb82b7509c68b6dfd");
|
||||
public static final Pack BANDIT = new Pack("9acc9e8aba563d26a4994e69263e3b25", "5a6dff3948c28efb9b7aaf93ecc375c69fc316e78077ed26867a14d10a0f6a12");
|
||||
public static final Pack SWOON_HANDS = new Pack("e61fa0867031597467ccc036cc65d403", "13ae7b1a7407318280e9b38c1261ded38e0e7138b9f964a6ccbb73e40f737a9b");
|
||||
public static final Pack SWOON_FACES = new Pack("cca32f5b905208b7d0f1e17f23fdc185", "8bf8e95f7a45bdeafe0c8f5b002ef01ab95b8f1b5baac4019ccd6b6be0b1837a");
|
||||
public static final Pack DAY_BY_DAY = new Pack("cfc50156556893ef9838069d3890fe49", "5f5beab7d382443cb00a1e48eb95297b6b8cadfd0631e5d0d9dc949e6999ff4b");
|
||||
public static final Pack ZOZO = new Pack("fb535407d2f6497ec074df8b9c51dd1d", "17e971c134035622781d2ee249e6473b774583750b68c11bb82b7509c68b6dfd");
|
||||
public static final Pack BANDIT = new Pack("9acc9e8aba563d26a4994e69263e3b25", "5a6dff3948c28efb9b7aaf93ecc375c69fc316e78077ed26867a14d10a0f6a12");
|
||||
public static final Pack SWOON_HANDS = new Pack("e61fa0867031597467ccc036cc65d403", "13ae7b1a7407318280e9b38c1261ded38e0e7138b9f964a6ccbb73e40f737a9b");
|
||||
public static final Pack SWOON_FACES = new Pack("cca32f5b905208b7d0f1e17f23fdc185", "8bf8e95f7a45bdeafe0c8f5b002ef01ab95b8f1b5baac4019ccd6b6be0b1837a");
|
||||
public static final Pack DAY_BY_DAY = new Pack("cfc50156556893ef9838069d3890fe49", "5f5beab7d382443cb00a1e48eb95297b6b8cadfd0631e5d0d9dc949e6999ff4b");
|
||||
public static final Pack MY_DAILY_LIFE = new Pack("ccc89a05dc077856b57351e90697976c", "45730e60f09d5566115223744537a6b7d9ea99ceeacb77a1fbd6801b9607fbcf");
|
||||
|
||||
private static final Set<String> BLESSED_PACK_IDS = new HashSet<String>() {{
|
||||
add(ZOZO.getPackId());
|
||||
|
@ -27,6 +28,7 @@ public final class BlessedPacks {
|
|||
add(SWOON_HANDS.getPackId());
|
||||
add(SWOON_FACES.getPackId());
|
||||
add(DAY_BY_DAY.getPackId());
|
||||
add(MY_DAILY_LIFE.getPackId());
|
||||
}};
|
||||
|
||||
public static boolean contains(@NonNull String packId) {
|
||||
|
|
Ładowanie…
Reference in New Issue