Skip to content

Commit

Permalink
Release 9.7.1 (#521)
Browse files Browse the repository at this point in the history
* Mark all activities as exported=false

* Catch ClassCastException for subtype lookup

* Release 9.7.1

* Use HTTPS not HTTP for store URLs
  • Loading branch information
rlepinski authored Mar 14, 2019
1 parent 3c79bde commit 95030d8
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 39 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ Android ChangeLog

[Migration Guides](https://github.com/urbanairship/android-library/tree/master/documentation/migration)

Version 9.7.1 - March 14, 2019
==============================

Fixed a security issue within Urban Airship SDK, that could allow trusted URL redirects in certain
edge cases. All applications that are using Urban Airship SDK 9.0.0 - 9.7.0 should update as soon as
possible. For more details, please email security@urbanairship.com.

Version 9.7.0 - January 22, 2019
================================
Minor release that allows listing for Urban Airship log messages.
Expand Down
2 changes: 1 addition & 1 deletion airship.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Airship Version - major.minor.patch
version = 9.7.0
version = 9.7.1

# Airship Version Qualifier beta, release, etc...
#versionQualifier = beta
Expand Down
46 changes: 31 additions & 15 deletions urbanairship-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,49 @@

<application>

<activity android:name="com.urbanairship.iam.html.HtmlActivity" android:theme="@style/UrbanAirship.InAppHtml.Activity"/>
<activity android:name="com.urbanairship.iam.fullscreen.FullScreenActivity" android:theme="@style/UrbanAirship.InAppFullscreen.Activity"/>
<activity android:name="com.urbanairship.iam.modal.ModalActivity" android:theme="@style/UrbanAirship.InAppModal.Activity"/>
<activity android:name="com.urbanairship.iam.html.HtmlActivity"
android:theme="@style/UrbanAirship.InAppHtml.Activity"
android:exported="false" />

<activity android:name="com.urbanairship.CoreActivity" android:theme="@android:style/Theme.NoDisplay" />
<activity android:name="com.urbanairship.iam.fullscreen.FullScreenActivity"
android:theme="@style/UrbanAirship.InAppFullscreen.Activity"
android:exported="false" />

<activity android:name="com.urbanairship.iam.modal.ModalActivity"
android:theme="@style/UrbanAirship.InAppModal.Activity"
android:exported="false" />

<activity android:name="com.urbanairship.messagecenter.MessageActivity" />
<activity android:name="com.urbanairship.messagecenter.MessageCenterActivity" android:label="@string/ua_message_center_title" />
<activity android:name="com.urbanairship.CoreActivity"
android:theme="@android:style/Theme.NoDisplay"
android:exported="false" />

<activity android:name="com.urbanairship.util.HelperActivity" android:theme="@style/UrbanAirship.HelperActivity">
<activity android:name="com.urbanairship.messagecenter.MessageActivity"
android:exported="false" />

<activity android:name="com.urbanairship.messagecenter.MessageCenterActivity"
android:label="@string/ua_message_center_title"
android:exported="false" />

<activity android:name="com.urbanairship.util.HelperActivity"
android:theme="@style/UrbanAirship.HelperActivity"
android:exported="false" >
<meta-data
android:name="com.urbanairship.push.iam.EXCLUDE_FROM_AUTO_SHOW"
android:value="true" />
</activity>

<activity android:name="com.urbanairship.google.PlayServicesErrorActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar">
<activity android:name="com.urbanairship.google.PlayServicesErrorActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:exported="false" >
<meta-data
android:name="com.urbanairship.push.iam.EXCLUDE_FROM_AUTO_SHOW"
android:value="true" />
</activity>

<activity
android:name="com.urbanairship.actions.RateAppActivity"
android:theme="@style/UrbanAirship.RateAppActivity">
android:theme="@style/UrbanAirship.RateAppActivity"
android:exported="false">

<meta-data
android:name="com.urbanairship.push.iam.EXCLUDE_FROM_AUTO_SHOW"
Expand All @@ -49,8 +67,8 @@

<activity
android:name="com.urbanairship.actions.LandingPageActivity"
android:exported="false"
android:theme="@style/UrbanAirship.LandingPageActivity">
android:theme="@style/UrbanAirship.LandingPageActivity"
android:exported="false" >

<meta-data
android:name="com.urbanairship.action.LANDING_PAGE_VIEW"
Expand All @@ -72,19 +90,17 @@

</activity>

<activity android:name="com.urbanairship.ChannelCaptureActivity"/>

<activity android:name="com.urbanairship.ChannelCaptureActivity"
android:exported="false"/>

<service android:name="com.urbanairship.job.AirshipService" />
<service android:name="com.urbanairship.actions.ActionService" />
<service android:name="com.urbanairship.location.LocationService" android:label="Segments Service" />
<service android:name="com.urbanairship.push.PushService" />


<service android:name="com.urbanairship.job.AndroidJobService"
android:permission="android.permission.BIND_JOB_SERVICE" />


<receiver android:name="com.urbanairship.CoreReceiver"
android:exported="false">
<intent-filter android:priority="-999">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public class RateAppAction extends Action {
private static final String MARKET_PLAY_URL = "market://details?id=";

/**
* HTTP URL to the Google Play store. Used instead of the market URl if the play store is not available.
* HTTPS URL to the Google Play store. Used instead of the market URl if the play store is not available.
*/
private static final String HTTP_PLAY_URL = "http://play.google.com/store/apps/details?id=";
private static final String HTTPS_PLAY_URL = "https://play.google.com/store/apps/details?id=";

/**
* URL to the Amazon store.
Expand Down Expand Up @@ -172,7 +172,7 @@ private Uri getAppStoreUri() {
if (PlayServicesUtils.isGooglePlayStoreAvailable(UAirship.getApplicationContext())) {
return Uri.parse(MARKET_PLAY_URL + packageName);
} else {
return Uri.parse(HTTP_PLAY_URL + packageName);
return Uri.parse(HTTPS_PLAY_URL + packageName);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.support.annotation.RestrictTo;
import android.telephony.TelephonyManager;

import com.urbanairship.Logger;
import com.urbanairship.UAirship;
import com.urbanairship.json.JsonMap;
import com.urbanairship.push.PushManager;
Expand Down Expand Up @@ -50,7 +51,7 @@ public abstract class Event {
static final String PACKAGE_VERSION_KEY = "package_version";
static final String LAST_METADATA_KEY = "last_metadata";

@IntDef({LOW_PRIORITY, NORMAL_PRIORITY, HIGH_PRIORITY})
@IntDef({ LOW_PRIORITY, NORMAL_PRIORITY, HIGH_PRIORITY })
@Retention(RetentionPolicy.SOURCE)
public @interface Priority {}

Expand All @@ -69,7 +70,6 @@ public abstract class Event {
*/
public static final int HIGH_PRIORITY = 2;


/**
* Constructor for Event.
*
Expand Down Expand Up @@ -118,14 +118,14 @@ public String createEventPayload(String sessionId) {

// Copy the event data and add the session id
data = JsonMap.newBuilder()
.putAll(data)
.put(SESSION_ID_KEY, sessionId)
.build();
.putAll(data)
.put(SESSION_ID_KEY, sessionId)
.build();

object.put(TYPE_KEY, getType())
.put(EVENT_ID_KEY, eventId)
.put(TIME_KEY, time)
.put(DATA_KEY, data);
.put(EVENT_ID_KEY, eventId)
.put(TIME_KEY, time)
.put(DATA_KEY, data);

return object.build().toString();
}
Expand Down Expand Up @@ -214,18 +214,23 @@ public String getConnectionType() {
* @return The connection subtype as a String.
*/
public String getConnectionSubType() {

//determine network connectivity state
//each of these may return null if there is no connectivity, and this may change at any moment
//keep a reference, then do a null check before accessing
ConnectivityManager cm = (ConnectivityManager) UAirship.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm != null) {
NetworkInfo ni = cm.getActiveNetworkInfo();
if (ni != null) {
return ni.getSubtypeName();
try {
//determine network connectivity state
//each of these may return null if there is no connectivity, and this may change at any moment
//keep a reference, then do a null check before accessing
ConnectivityManager cm = (ConnectivityManager) UAirship.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm != null) {
NetworkInfo ni = cm.getActiveNetworkInfo();
if (ni != null) {
return ni.getSubtypeName();
}
}
return "";
} catch (ClassCastException e) {
// https://github.com/urbanairship/android-library/issues/115
Logger.error("Connection subtype lookup failed", e);
return "";
}
return "";
}

/**
Expand Down Expand Up @@ -266,11 +271,10 @@ public boolean isValid() {
return true;
}


/**
* Helper method to convert milliseconds to a seconds string containing a double.
* @param milliseconds Milliseconds to convert.
*
* @param milliseconds Milliseconds to convert.
* @return Seconds as a string containing a double.
* @hide
*/
Expand All @@ -281,10 +285,12 @@ public static String millisecondsToSecondsString(long milliseconds) {

/**
* The event's send priority.
*
* @return The event's send priority.
*/
@Priority
public int getPriority() {
return NORMAL_PRIORITY;
}

}

0 comments on commit 95030d8

Please sign in to comment.