Skip to content

Commit

Permalink
Merge branch 'maintenance' into origin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlaster committed Jun 9, 2020
2 parents e505570 + c0a7276 commit aba0d0b
Show file tree
Hide file tree
Showing 635 changed files with 4,438 additions and 2,695 deletions.
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ addons:
- git
- ruby

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.m2/
# before_cache:
# - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
# - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
# cache:
# directories:
# - $HOME/.gradle/caches/
# - $HOME/.gradle/wrapper/
# - $HOME/.m2/

before_install:
- ./travis/scripts/decode_private_configs.sh
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/twidere/localized.svg)](https://crowdin.com/project/twidere)
[<img a src="https://c5.patreon.com/external/logo/become_a_patron_button.png" width="100" herf="https://www.patreon.com/bePatron?u=36020799"/>](https://www.patreon.com/bePatron?u=36020799)

Material Design ready and feature rich Twitter/Mastodon/StatusNet/Fanfou app for Android 4.4+. Enjoy Fediverse now!
Material Design ready and feature rich Twitter/Mastodon/StatusNet/Fanfou app for Android 4.1+. Enjoy Fediverse now!

Twidere-Android is maintained by community and supporter including [Dimension](https://dimension.im/).

Expand Down
58 changes: 11 additions & 47 deletions 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.6.3'
classpath 'com.android.tools.build:gradle:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -17,13 +17,13 @@ buildscript {
allprojects {
ext {
projectGroupId = 'org.mariotaku.twidere'
projectVersionCode = 512
projectVersionName = '4.1.3'
projectVersionCode = 513
projectVersionName = '4.1.4'

globalCompileSdkVersion = 29
globalBuildToolsVersion = "29.0.3"

globalMinSdkVersion = 19
globalMinSdkVersion = 16
globalTargetSdkVersion = 29
}

Expand All @@ -39,54 +39,18 @@ subprojects {
buildscript {
ext {
kotlinVersion = '1.3.72'
pluginVersions = [
AndroidSvgDrawable: '3.0.0',
PlayServices : '4.3.3',
]
libVersions = [
sharedVersions = [
Kotlin : "${kotlinVersion}",
SupportTest : '1.0.0',
MariotakuCommons : '0.9.20',
RestFu : '0.9.60',
ObjectCursor : '0.9.21',
PlayServices : '17.0.0',
MapsUtils : '0.6.2',
DropboxCoreSdk : '3.1.3',
GoogleDriveApi : 'v3-rev193-1.25.0',
Exoplayer : '2.11.4',
Toro : '2.1.0',

LoganSquare : '1.3.7',
IABv3 : '1.1.0',
Mime4J : '0.7.2',
OkHttp : '3.8.1',
Stetho : '1.5.0',
OSMDroid : '5.6.5',
LeakCanary : '2.1',
TwitterText : '1.14.7',
MediaViewerLibrary : '0.9.23',
MultiValueSwitch : '0.9.8',
PickNCrop : '0.9.27',
AndroidGIFDrawable : '1.2.6',
KPreferences : '0.9.7',
Kovenant : '3.3.0',
Jackson : '2.7.4',
ParcelablePlease : '1.0.2',
Chameleon : '0.9.28',
UniqR : '0.9.4',
SQLiteQB : '0.9.15',
Glide : '4.11.0',
GlideOkHttp3 : '4.11.0',
GlideTransformations : '4.1.0',
AndroidImageCropper : '2.4.6',

ExportablePreferences: '0.9.7',
ACRA : '4.9.2',
AbstractTask : '0.9.5',
Dagger : '2.11',
StethoBeanShellREPL : '0.1',
MessageBubbleView : '3.5',
MariotakuCommons : '0.9.20',
ObjectCursor : '0.9.21',
RestFu : '0.9.60',
]

}

}

}
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
org.gradle.jvmargs=-Xmx3584m
#https://github.com/TwidereProject/Twidere-Android/issues/963
android.enableAapt2=false
# android.enableAapt2=false
android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=true
android.jetifier.blacklist=android-4.1.1.4.jar
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 2 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand Down Expand Up @@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
1 change: 1 addition & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ set CMD_LINE_ARGS=%*

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

Expand Down
6 changes: 2 additions & 4 deletions travis/configs/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
# limitations under the License.
#
org.gradle.jvmargs=-Xmx3584m
org.gradle.parallel=false
kotlin.incremental=false
kotlin.compiler.execution.strategy=in-process
android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=true
android.jetifier.blacklist=android-4.1.1.4.jar
39 changes: 23 additions & 16 deletions twidere.component.common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
}
}

Expand All @@ -58,12 +58,19 @@ android {
versionCode projectVersionCode
versionName projectVersionName
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

compileOptions {
encoding = 'UTF-8'
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
Expand All @@ -72,23 +79,23 @@ dependencies {


/** Third-party dependencies **/
implementation "com.bluelinelabs:logansquare:${libVersions['LoganSquare']}"
annotationProcessor "com.bluelinelabs:logansquare-compiler:${libVersions['LoganSquare']}"
implementation "com.fasterxml.jackson.core:jackson-core:2.7.4"
implementation "com.hannesdorfmann.parcelableplease:annotation:${libVersions['ParcelablePlease']}"
annotationProcessor "com.hannesdorfmann.parcelableplease:processor:${libVersions['ParcelablePlease']}"
implementation "com.bluelinelabs:logansquare:${sharedVersions['LoganSquare']}"
annotationProcessor "com.bluelinelabs:logansquare-compiler:${sharedVersions['LoganSquare']}"
implementation "com.fasterxml.jackson.core:jackson-core:${sharedVersions['Jackson']}"
implementation "com.hannesdorfmann.parcelableplease:annotation:${sharedVersions['ParcelablePlease']}"
annotationProcessor "com.hannesdorfmann.parcelableplease:processor:${sharedVersions['ParcelablePlease']}"


/** Custom dependencies **/
implementation "com.github.mariotaku.RestFu:library:${libVersions['RestFu']}"
implementation "com.github.mariotaku.RestFu:oauth:${libVersions['RestFu']}"
implementation "com.github.mariotaku.RestFu:oauth2:${libVersions['RestFu']}"
implementation "com.github.mariotaku.ObjectCursor:core:${libVersions['ObjectCursor']}"
annotationProcessor "com.github.mariotaku.ObjectCursor:processor:${libVersions['ObjectCursor']}"
implementation "com.github.mariotaku.ExportablePreferences:core:${libVersions['ExportablePreferences']}"
annotationProcessor "com.github.mariotaku.ExportablePreferences:processor:${libVersions['ExportablePreferences']}"
implementation "com.github.mariotaku.CommonsLibrary:objectcursor:${libVersions['MariotakuCommons']}"
implementation "com.github.mariotaku.CommonsLibrary:logansquare:${libVersions['MariotakuCommons']}"
implementation "com.github.mariotaku.ExportablePreferences:core:${sharedVersions['ExportablePreferences']}"
annotationProcessor "com.github.mariotaku.ExportablePreferences:processor:${sharedVersions['ExportablePreferences']}"
implementation "com.github.mariotaku.CommonsLibrary:logansquare:${sharedVersions['MariotakuCommons']}"
implementation "com.github.mariotaku.CommonsLibrary:objectcursor:${sharedVersions['MariotakuCommons']}"
implementation "com.github.mariotaku.ObjectCursor:core:${sharedVersions['ObjectCursor']}"
annotationProcessor "com.github.mariotaku.ObjectCursor:processor:${sharedVersions['ObjectCursor']}"
implementation "com.github.mariotaku.RestFu:library:${sharedVersions['RestFu']}"
implementation "com.github.mariotaku.RestFu:oauth:${sharedVersions['RestFu']}"
implementation "com.github.mariotaku.RestFu:oauth2:${sharedVersions['RestFu']}"
}

install {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public int getRetryAfter() {
try {
final String retryAfterStr = httpResponse.getHeader("Retry-After");
if (retryAfterStr != null) {
retryAfter = Integer.valueOf(retryAfterStr);
retryAfter = Integer.parseInt(retryAfterStr);
}
} catch (final NumberFormatException ignore) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@

package org.mariotaku.microblog.library.mastodon.model;

import androidx.annotation.Nullable;

import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import com.hannesdorfmann.parcelableplease.annotation.ParcelableThisPlease;

/**
* {@see https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#attachment}
Expand Down Expand Up @@ -59,6 +62,9 @@ public class Attachment {
@JsonField(name = "text_url")
String textUrl;

@JsonField(name = "meta")
MetaInfo meta;

public String getId() {
return id;
}
Expand All @@ -83,6 +89,51 @@ public String getTextUrl() {
return textUrl;
}

public MetaInfo getMeta() {
return meta;
}

@JsonObject
public static class MetaInfo {

@ParcelableThisPlease
@JsonField(name = "focus")
@Nullable
public FocusInfo focus;
@ParcelableThisPlease
@JsonField(name = "original")
@Nullable
public MetaDataInfo original;
@ParcelableThisPlease
@JsonField(name = "small")
@Nullable
public MetaDataInfo small;

@JsonObject
public static class FocusInfo {
@ParcelableThisPlease
@JsonField(name = "x")
public float x;
@ParcelableThisPlease
@JsonField(name = "y")
public float y;
}

@JsonObject
public static class MetaDataInfo {
@ParcelableThisPlease
@JsonField(name = "width")
public long width;
@ParcelableThisPlease
@JsonField(name = "height")
public long height;
@ParcelableThisPlease
@JsonField(name = "aspect")
public float aspect;
}


}
@Override
public String toString() {
return "Attachment{" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public Object get(@NonNull String key) {
@Override
public String[] keys() {
final Set<String> keySet = map.keySet();
return keySet.toArray(new String[keySet.size()]);
return keySet.toArray(new String[0]);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
@Keep
public class IDs$$JsonObjectMapper extends JsonMapper<IDs> {

@SuppressWarnings("TryWithIdenticalCatches")
@Override
public IDs parse(JsonParser jsonParser) throws IOException {
IDs instance = new IDs();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,8 @@ public ResponseList<T> parse(JsonParser jsonParser) throws IOException {

@Override
public void parseField(ResponseList<T> instance, String fieldName, JsonParser jsonParser) throws IOException {
switch (fieldName) {
case "results": {
instance.addAll(m84ClassJsonMapper.parseList(jsonParser));
break;
}
if ("results".equals(fieldName)) {
instance.addAll(m84ClassJsonMapper.parseList(jsonParser));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public Index[] parse(JsonParser jsonParser) throws IOException {
index.end = jsonParser.nextIntValue(-1);
list.add(index);
}
return list.toArray(new Index[list.size()]);
return list.toArray(new Index[0]);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,9 @@ public static int toAccessLevel(final HttpResponse res) {
accessLevel = TwitterResponse.AccessLevel.READ_WRITE;
break;
case 25:
// “read-write-directmessages” (Read, Write, & Direct
// Message)
accessLevel = TwitterResponse.AccessLevel.READ_WRITE_DIRECTMESSAGES;
break;
case 26:
// “read-write-privatemessages” (Read, Write, & Direct
// “read-write-directmessages” (Read, Write, & Direct
// Message)
accessLevel = TwitterResponse.AccessLevel.READ_WRITE_DIRECTMESSAGES;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public interface TwidereConstants extends SharedPreferenceConstants, IntentConst
String ETAG_MASTODON_APPS_PREFERENCES_NAME = "mastodon_apps";
String ACCOUNT_PREFERENCES_NAME_PREFIX = "account_preferences_";

String TWITTER_CONSUMER_KEY = "wmtrtTaVOjUnH5pWQp4LDI5Qs";
String TWITTER_CONSUMER_SECRET = "E9Q9u2yK0COJae2tLcNEdY75OPA3bxqJiGZQztraHaQUtoI2cu";
String TWITTER_CONSUMER_KEY = "MUUBibXUognm6e9vbzrUIqPkt";
String TWITTER_CONSUMER_SECRET = "l2uWAgQkoHvDfM2PrRFx2WN4h7QIUIktmxyeTAqRo6TkGCtNKy";

String YANDEX_KEY = "trnsl.1.1.20200513T065609Z.8e72845b632aa04f.fe1297e42c152de9e8773e1bc71162b1e498e2a8";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,5 @@

// Contains all flags
int ALL = 0xFFFFFFFF;
@SuppressWarnings("PointlessBitwiseExpression")
int DEFAULT = ALL & ~(TARGET_NAME | TARGET_DESCRIPTION);
}
Loading

0 comments on commit aba0d0b

Please sign in to comment.