-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from Countly/push-fixes
Push Security: Added white list package and class names
- Loading branch information
Showing
9 changed files
with
215 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
sdk/src/main/java/ly/count/android/sdk/messaging/CountlyConfigPush.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package ly.count.android.sdk.messaging; | ||
|
||
import android.app.Application; | ||
import androidx.annotation.NonNull; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
import ly.count.android.sdk.Countly; | ||
|
||
public class CountlyConfigPush { | ||
Application application; | ||
Countly.CountlyMessagingMode mode; | ||
Countly.CountlyMessagingProvider provider; | ||
Set<String> allowedIntentClassNames = new HashSet<>(); | ||
Set<String> allowedIntentPackageNames = new HashSet<>(); | ||
|
||
public CountlyConfigPush(final Application application, Countly.CountlyMessagingMode mode) { | ||
this.application = application; | ||
this.mode = mode; | ||
} | ||
|
||
/** | ||
* set preferred push provider | ||
* | ||
* @param provider | ||
* @return Returns the same push config object for convenient linking | ||
*/ | ||
public synchronized CountlyConfigPush setProvider(Countly.CountlyMessagingProvider provider) { | ||
this.provider = provider; | ||
return this; | ||
} | ||
|
||
/** | ||
* set allowed intent class names | ||
* | ||
* @param allowedIntentClassNames | ||
* @return Returns the same push config object for convenient linking | ||
*/ | ||
|
||
public synchronized CountlyConfigPush setAllowedIntentClassNames(@NonNull List<String> allowedIntentClassNames) { | ||
this.allowedIntentClassNames = new HashSet<>(allowedIntentClassNames); | ||
return this; | ||
} | ||
|
||
/** | ||
* set allowed intent package names | ||
* | ||
* @param allowedIntentPackageNames | ||
* @return Returns the same push config object for convenient linking | ||
*/ | ||
public synchronized CountlyConfigPush setAllowedIntentPackageNames(@NonNull List<String> allowedIntentPackageNames) { | ||
this.allowedIntentPackageNames = new HashSet<>(allowedIntentPackageNames); | ||
return this; | ||
} | ||
} |
Oops, something went wrong.