Skip to content

Commit 84788f5

Browse files
authored
Merge pull request parse-community#1 from aontas/master
Update master to latest OSS version (1.15.5)
2 parents 9d72c9c + b80f25f commit 84788f5

File tree

81 files changed

+1942
-300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1942
-300
lines changed

Parse/build.gradle

+106-10
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@ import com.android.builder.core.BuilderConstants
22

33
apply plugin: 'com.android.library'
44
apply plugin: 'com.github.kt3k.coveralls'
5+
apply plugin: 'com.jfrog.bintray'
56

67
group = 'com.parse'
7-
version = '1.15.0'
8+
version = '1.15.6-SNAPSHOT'
89

10+
ext {
11+
projDescription = 'A library that gives you access to the powerful Parse cloud platform from your Android app.'
12+
artifact = 'parse-android'
13+
projName = 'Parse-Android'
14+
gitLink = 'https://github.com/parse-community/Parse-SDK-Android'
15+
}
916
buildscript {
1017
repositories {
1118
jcenter()
@@ -129,22 +136,22 @@ uploadArchives {
129136
}
130137

131138
pom.project {
132-
name 'Parse-Android'
133-
artifactId = 'parse-android'
139+
name projName
140+
artifactId = artifact
134141
packaging 'aar'
135-
description 'A library that gives you access to the powerful Parse cloud platform from your Android app.'
136-
url 'https://github.com/ParsePlatform/Parse-SDK-Android'
142+
description projDescription
143+
url gitLink
137144

138145
scm {
139-
connection 'scm:[email protected]:ParsePlatform/Parse-SDK-Android.git'
140-
developerConnection 'scm:[email protected]:ParsePlatform/Parse-SDK-Android.git'
141-
url 'https://github.com/ParsePlatform/Parse-SDK-Android'
146+
connection 'scm:[email protected]:parse-community/Parse-SDK-Android.git'
147+
developerConnection 'scm:[email protected]:parse-community/Parse-SDK-Android.git'
148+
url 'https://github.com/parse-community/Parse-SDK-Android'
142149
}
143150

144151
licenses {
145152
license {
146153
name 'BSD License'
147-
url 'https://github.com/ParsePlatform/Parse-SDK-Android/blob/master/LICENSE'
154+
url 'https://github.com/parse-community/Parse-SDK-Android/blob/master/LICENSE'
148155
distribution 'repo'
149156
}
150157
}
@@ -183,7 +190,7 @@ jacoco {
183190
toolVersion "0.7.1.201405082137"
184191
}
185192

186-
task jacocoTestReport(type:JacocoReport, dependsOn: "testDebugUnitTest") {
193+
task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
187194
group = "Reporting"
188195
description = "Generate Jacoco coverage reports"
189196

@@ -216,3 +223,92 @@ task jacocoTestReport(type:JacocoReport, dependsOn: "testDebugUnitTest") {
216223
coveralls.jacocoReportPath = "${buildDir}/reports/jacoco/jacocoTestReport/jacocoTestReport.xml"
217224

218225
//endregion
226+
227+
// Requires apply plugin: 'com.jfrog.bintray'
228+
229+
bintray {
230+
user = System.getenv('BINTRAY_USER')
231+
key = System.getenv('BINTRAY_API_KEY')
232+
233+
publications = ["MyPublication"]
234+
235+
publish = true
236+
pkg {
237+
repo = 'maven'
238+
name = 'com.parse:parse-android'
239+
userOrg = 'parse'
240+
licenses = ['BSD License']
241+
vcsUrl = 'https://github.com/parse-community/Parse-SDK-Android'
242+
version {
243+
name = project.version
244+
desc = projDescription
245+
released = new Date()
246+
vcsTag = project.version
247+
248+
// Sonatype username/passwrod must be set for this operation to happen
249+
mavenCentralSync {
250+
sync = true
251+
user = ossrhUsername
252+
password = ossrhPassword
253+
close = '1' // release automatically
254+
}
255+
}
256+
}
257+
}
258+
259+
def pomConfig = {
260+
licenses {
261+
license {
262+
name 'BSD License'
263+
url 'https://github.com/parse-community/Parse-SDK-Android/blob/master/LICENSE'
264+
distribution 'repo'
265+
}
266+
}
267+
268+
scm {
269+
url gitLink
270+
}
271+
272+
developers {
273+
developer {
274+
id 'parse'
275+
name 'Parse'
276+
}
277+
}
278+
}
279+
280+
// Create the publication with the pom configuration:
281+
apply plugin: 'maven-publish'
282+
283+
publishing {
284+
publications {
285+
MyPublication(MavenPublication) {
286+
groupId group
287+
// We have to specify it here because otherwise Bintray's plugin will assume the artifact's name is Parse
288+
artifactId artifact
289+
artifacts = [androidSourcesJar, bundleRelease]
290+
version version
291+
pom.withXml {
292+
def root = asNode()
293+
root.appendNode('description', projDescription)
294+
root.appendNode('name', projName)
295+
root.appendNode('url', gitLink)
296+
root.children().last() + pomConfig
297+
298+
// maven-publish workaround to include dependencies
299+
def dependenciesNode = asNode().appendNode('dependencies')
300+
301+
//Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
302+
configurations.compile.allDependencies.each {
303+
def dependencyNode = dependenciesNode.appendNode('dependency')
304+
dependencyNode.appendNode('groupId', it.group)
305+
dependencyNode.appendNode('artifactId', it.name)
306+
dependencyNode.appendNode('version', it.version)
307+
}
308+
309+
}
310+
}
311+
}
312+
}
313+
314+
// End of Bintray plugin

Parse/release-proguard.pro

+1-23
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
1-
# Add project specific ProGuard rules here.
2-
# By default, the flags in this file are appended to flags specified
3-
# in /usr/local/opt/android-sdk/tools/proguard/proguard-android.txt
4-
# You can edit the include path and order by changing the proguardFiles
5-
# directive in build.gradle.
6-
#
7-
# For more details, see
8-
# http://developer.android.com/guide/developing/tools/proguard.html
9-
10-
# Add any project specific keep options here:
11-
12-
# If your project uses WebView with JS, uncomment the following
13-
# and specify the fully qualified class name to the JavaScript interface
14-
# class:
15-
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16-
# public *;
17-
#}
18-
19-
# Keep source file names, line numbers, and Parse class/method names for easier debugging
20-
-keepattributes SourceFile,LineNumberTable
211
-keepnames class com.parse.** { *; }
222

233
# Required for Parse
244
-keepattributes *Annotation*
255
-keepattributes Signature
26-
-dontwarn android.net.SSLCertificateSocketFactory
27-
-dontwarn android.app.Notification
28-
-dontwarn com.squareup.**
6+
# https://github.com/square/okio#proguard
297
-dontwarn okio.**

Parse/src/main/java/com/parse/ConfigCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ public interface ConfigCallback extends ParseCallback2<ParseConfig, ParseExcepti
4040
* The exception raised by the fetch, or {@code null} if it succeeded.
4141
*/
4242
@Override
43-
public void done(ParseConfig config, ParseException e);
43+
void done(ParseConfig config, ParseException e);
4444
}

Parse/src/main/java/com/parse/CountCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ public interface CountCallback {
4444
* @param e
4545
* The exception raised by the count, or null if it succeeded.
4646
*/
47-
public void done(int count, ParseException e);
47+
void done(int count, ParseException e);
4848
}

Parse/src/main/java/com/parse/DeleteCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ public interface DeleteCallback extends ParseCallback1<ParseException> {
4040
* The exception raised by the delete, or {@code null} if it succeeded.
4141
*/
4242
@Override
43-
public void done(ParseException e);
43+
void done(ParseException e);
4444
}

Parse/src/main/java/com/parse/FindCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ public interface FindCallback<T extends ParseObject> extends ParseCallback2<List
4545
* The exception raised by the save, or null if it succeeded.
4646
*/
4747
@Override
48-
public void done(List<T> objects, ParseException e);
48+
void done(List<T> objects, ParseException e);
4949
}

Parse/src/main/java/com/parse/FunctionCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ public interface FunctionCallback<T> extends ParseCallback2<T, ParseException> {
4545
* The exception raised by the cloud call, or {@code null} if it succeeded.
4646
*/
4747
@Override
48-
public void done(T object, ParseException e);
48+
void done(T object, ParseException e);
4949
}

Parse/src/main/java/com/parse/GcmBroadcastReceiver.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
import android.content.BroadcastReceiver;
1212
import android.content.Context;
1313
import android.content.Intent;
14+
import android.support.annotation.CallSuper;
1415

1516
/**
1617
* @exclude
1718
*/
1819
public class GcmBroadcastReceiver extends BroadcastReceiver {
1920
@Override
20-
public final void onReceive(Context context, Intent intent) {
21+
@CallSuper
22+
public void onReceive(Context context, Intent intent) {
2123
ServiceUtils.runWakefulIntentInService(context, intent, PushService.class);
2224
}
2325
}

Parse/src/main/java/com/parse/GetCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ public interface GetCallback<T extends ParseObject> extends ParseCallback2<T, Pa
4343
* The exception raised by the fetch, or {@code null} if it succeeded.
4444
*/
4545
@Override
46-
public void done(T object, ParseException e);
46+
void done(T object, ParseException e);
4747
}

Parse/src/main/java/com/parse/GetDataCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ public interface GetDataCallback extends ParseCallback2<byte[], ParseException>
3535
* The exception raised by the fetch, or {@code null} if it succeeded.
3636
*/
3737
@Override
38-
public void done(byte[] data, ParseException e);
38+
void done(byte[] data, ParseException e);
3939
}
4040

Parse/src/main/java/com/parse/GetDataStreamCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ public interface GetDataStreamCallback extends ParseCallback2<InputStream, Parse
3737
* The exception raised by the fetch, or {@code null} if it succeeded.
3838
*/
3939
@Override
40-
public void done(InputStream input, ParseException e);
40+
void done(InputStream input, ParseException e);
4141
}

Parse/src/main/java/com/parse/GetFileCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ public interface GetFileCallback extends ParseCallback2<File, ParseException> {
3737
* The exception raised by the fetch, or {@code null} if it succeeded.
3838
*/
3939
@Override
40-
public void done(File file, ParseException e);
40+
void done(File file, ParseException e);
4141
}

Parse/src/main/java/com/parse/LocationCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ public interface LocationCallback extends ParseCallback2<ParseGeoPoint, ParseExc
4444
* The exception raised by the location fetch, or {@code null} if it succeeded.
4545
*/
4646
@Override
47-
public void done(ParseGeoPoint geoPoint, ParseException e);
47+
void done(ParseGeoPoint geoPoint, ParseException e);
4848
}

Parse/src/main/java/com/parse/LocationNotifier.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
/* package */ static Task<Location> getCurrentLocationAsync(Context context,
6161
long timeout, Criteria criteria) {
6262
final TaskCompletionSource<Location> tcs = new TaskCompletionSource<>();
63-
final Capture<ScheduledFuture<?>> timeoutFuture = new Capture<ScheduledFuture<?>>();
63+
final Capture<ScheduledFuture<?>> timeoutFuture = new Capture<>();
6464
final LocationManager manager =
6565
(LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
6666
final LocationListener listener = new LocationListener() {

Parse/src/main/java/com/parse/LockSet.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
import java.util.concurrent.locks.Lock;
1717

1818
/** package */ class LockSet {
19-
private static WeakHashMap<Lock, Long> stableIds = new WeakHashMap<Lock, Long>();
19+
private static final WeakHashMap<Lock, Long> stableIds = new WeakHashMap<>();
2020
private static long nextStableId = 0L;
2121

2222
private final Set<Lock> locks;
2323

2424
public LockSet(Collection<Lock> locks) {
25-
this.locks = new TreeSet<Lock>(new Comparator<Lock>() {
25+
this.locks = new TreeSet<>(new Comparator<Lock>() {
2626
@Override
2727
public int compare(Lock lhs, Lock rhs) {
2828
Long lhsId = getStableId(lhs);

Parse/src/main/java/com/parse/LogInCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ public interface LogInCallback extends ParseCallback2<ParseUser, ParseException>
4343
* The exception raised by the login, or {@code null} if it succeeded.
4444
*/
4545
@Override
46-
public void done(ParseUser user, ParseException e);
46+
void done(ParseUser user, ParseException e);
4747
}

Parse/src/main/java/com/parse/LogOutCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ public interface LogOutCallback extends ParseCallback1<ParseException> {
3939
* The exception raised by the log out, or {@code null} if it succeeded.
4040
*/
4141
@Override
42-
public void done(ParseException e);
42+
void done(ParseException e);
4343
}

Parse/src/main/java/com/parse/ManifestInfo.java

+14-16
Original file line numberDiff line numberDiff line change
@@ -416,34 +416,32 @@ private static boolean hasGrantedPermissions(Context context, String... permissi
416416
return true;
417417
}
418418

419-
private static boolean checkResolveInfo(Class<? extends BroadcastReceiver> clazz, List<ResolveInfo> infoList) {
419+
private static boolean checkResolveInfo(Class<? extends BroadcastReceiver> clazz, List<ResolveInfo> infoList, String permission) {
420420
for (ResolveInfo info : infoList) {
421-
if (info.activityInfo != null && clazz.getCanonicalName().equals(info.activityInfo.name)) {
422-
return true;
421+
if (info.activityInfo != null) {
422+
final Class resolveInfoClass;
423+
try {
424+
resolveInfoClass = Class.forName(info.activityInfo.name);
425+
} catch (ClassNotFoundException e) {
426+
break;
427+
}
428+
if (clazz.isAssignableFrom(resolveInfoClass) && (permission == null || permission.equals(info.activityInfo.permission))) {
429+
return true;
430+
}
423431
}
424432
}
425433

426434
return false;
427435
}
428436

429-
private static boolean checkReceiver(Class<? extends BroadcastReceiver> clazz, String permission, Intent[] intents) {
430-
ActivityInfo receiver = getReceiverInfo(clazz);
431-
432-
if (receiver == null) {
433-
return false;
434-
}
435-
436-
if (permission != null && !permission.equals(receiver.permission)) {
437-
return false;
438-
}
439-
437+
private static boolean checkReceiver(Class<? extends BroadcastReceiver> clazz, String permission, Intent[] intents) {
440438
for (Intent intent : intents) {
441439
List<ResolveInfo> receivers = getPackageManager().queryBroadcastReceivers(intent, 0);
442440
if (receivers.isEmpty()) {
443441
return false;
444442
}
445443

446-
if (!checkResolveInfo(clazz, receivers)) {
444+
if (!checkResolveInfo(clazz, receivers, permission)) {
447445
return false;
448446
}
449447
}
@@ -463,7 +461,7 @@ private static boolean hasAnyGcmSpecificDeclaration() {
463461
}
464462

465463
private static boolean isGooglePlayServicesAvailable() {
466-
return Build.VERSION.SDK_INT >= 8 && getPackageInfo("com.google.android.gsf") != null;
464+
return getPackageInfo("com.google.android.gsf") != null;
467465
}
468466

469467
private static ManifestCheckResult gcmSupportLevel() {

Parse/src/main/java/com/parse/NotificationCompat.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -314,15 +314,15 @@ public Builder setStyle(Style style) {
314314
*/
315315
@Deprecated
316316
public Notification getNotification() {
317-
return (Notification) IMPL.build(this);
317+
return IMPL.build(this);
318318
}
319319

320320
/**
321321
* Combine all of the options that have been set and return a new {@link Notification}
322322
* object.
323323
*/
324324
public Notification build() {
325-
return (Notification) IMPL.build(this);
325+
return IMPL.build(this);
326326
}
327327

328328
protected static CharSequence limitCharSequenceLength(CharSequence cs) {

0 commit comments

Comments
 (0)