Skip to content

Commit

Permalink
Merge branch 'release/1.0.0+2'
Browse files Browse the repository at this point in the history
  • Loading branch information
vincekruger committed Dec 14, 2019
2 parents b41a478 + fe94204 commit 3a5030f
Show file tree
Hide file tree
Showing 21 changed files with 241 additions and 153 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.idea
.pub
pubspec.lock
local.properties


# Miscellaneous
Expand All @@ -17,6 +18,7 @@ pubspec.lock
.buildlog/
.history
.svn/
.vscode/

# IntelliJ related
*.iml
Expand Down Expand Up @@ -78,3 +80,5 @@ flutter_export_environment.sh
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
/example/.flutter-plugins-dependencies
/example/ios/Flutter/flutter_export_environment.sh
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.0+2

Upgraded the WhatsApp Stickers Extentions for Android

## 1.0.0

Bumped this straight to version 1.0.0
Expand Down
8 changes: 5 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.android.tools.build:gradle:3.5.2'
}
}

Expand All @@ -30,7 +30,8 @@ android {

defaultConfig {
minSdkVersion 16
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
targetSdkVersion 28
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField("String", "STICKER_PACK_FILE", "\"sticker_packs.json\"")
}
lintOptions {
Expand All @@ -39,7 +40,8 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'com.facebook.fresco:fresco:2.0.0'
implementation 'com.facebook.fresco:webpsupport:2.0.0'
implementation 'com.facebook.fresco:animated-webp:2.0.0'
Expand Down
20 changes: 19 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
org.gradle.jvmargs=-Xmx1536M
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

android.enableJetifier=true
android.useAndroidX=true
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class ContentFileParser {

private static final int LIMIT_EMOJI_COUNT = 2;
private static final int LIMIT_EMOJI_COUNT = 3;

@NonNull
static List<StickerPack> parseStickerPacks(@NonNull InputStream contentsInputStream) throws IOException, IllegalStateException {
Expand Down Expand Up @@ -75,6 +75,8 @@ private static StickerPack readStickerPack(@NonNull JsonReader reader) throws IO
String publisherWebsite = null;
String privacyPolicyWebsite = null;
String licenseAgreementWebsite = null;
String imageDataVersion = "";
boolean avoidCache = false;
List<Sticker> stickerList = null;
while (reader.hasNext()) {
String key = reader.nextName();
Expand Down Expand Up @@ -106,6 +108,12 @@ private static StickerPack readStickerPack(@NonNull JsonReader reader) throws IO
case "stickers":
stickerList = readStickers(reader);
break;
case "image_data_version":
imageDataVersion = reader.nextString();
break;
case "avoid_cache":
avoidCache = reader.nextBoolean();
break;
default:
reader.skipValue();
}
Expand All @@ -128,8 +136,11 @@ private static StickerPack readStickerPack(@NonNull JsonReader reader) throws IO
if (identifier.contains("..") || identifier.contains("/")) {
throw new IllegalStateException("identifier should not contain .. or / to prevent directory traversal");
}
if (TextUtils.isEmpty(imageDataVersion)) {
throw new IllegalStateException("image_data_version should not be empty");
}
reader.endObject();
final StickerPack stickerPack = new StickerPack(identifier, name, publisher, trayImageFile, publisherEmail, publisherWebsite, privacyPolicyWebsite, licenseAgreementWebsite);
final StickerPack stickerPack = new StickerPack(identifier, name, publisher, trayImageFile, publisherEmail, publisherWebsite, privacyPolicyWebsite, licenseAgreementWebsite, imageDataVersion, avoidCache);
stickerPack.setStickers(stickerList);
return stickerPack;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import java.util.List;

class Sticker implements Parcelable {
String imageFileName;
List<String> emojis;
final String imageFileName;
final List<String> emojis;
long size;

Sticker(String imageFileName, List<String> emojis) {
Expand Down
Loading

0 comments on commit 3a5030f

Please sign in to comment.