Skip to content

Commit

Permalink
chore: Remove Embedded Social (#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
acrown-msft authored Feb 24, 2021
1 parent 16c6935 commit 0d99235
Show file tree
Hide file tree
Showing 42 changed files with 52 additions and 1,393 deletions.
13 changes: 0 additions & 13 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,6 @@ Add the following to `onebusaway-android/gradle.properties`:

...where `XXXXXX` is your API key. Note that the suffix of `_oba` can be changed to configure API keys for other build flavors.

### Configuration the Embedded Social SDK API key (Optional)

If you want the Embedded Social features to show up within the OneBusAway app, you'll need to add an Embedded Social API key.

To do this, you'll need these lines in `gradle.properties` in the `onebusaway-android` folder:

```
EmbeddedSocialApiKey_oba=xxxxxx
EmbeddedSocialTelemetryKey_oba=xxxxxx
```

This step is optional if you're just looking to build and test the project for development purposes - if you don't include the keys in the config file, the social features will be hidden.

### Release builds

To build a release build, you need to create a `gradle.properties` file that points to a `secure.properties` file, and a `secure.properties` file that points to your keystore and alias.
Expand Down
1 change: 0 additions & 1 deletion PERMISSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ In order to support certain features in OneBusAway, we need to request various p
* **View network connections** - Used to create more descriptive error messages if there is a problem with loading stops or arrivals (e.g., do you have airplane mode on?)
* **Install shortcuts** - Used to create icons on your home screen for a specific stop, so you can tap on that stop icon from your home screen and immediately see arrivals
* **Control vibration** - Used to vibrate your phone when a reminder is triggered
* **Find accounts on the device** - Used to make sure that if the user removes a Google account from the device that they are logged out of the social features (Embedded Social) of OneBusAway.

44 changes: 0 additions & 44 deletions onebusaway-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ repositories {
// CUTR Releases
url "https://github.com/CUTR-at-USF/cutr-mvn-repo/raw/master/snapshots"
}
maven {
// for EmbeddedSocial SDK
url "http://dl.bintray.com/acrowntest/ES_SDK"
metadataSources {
mavenPom()
artifact()
}
}
mavenCentral()
}

Expand Down Expand Up @@ -108,8 +100,6 @@ android {
manifestPlaceholders = [databaseAuthority: "com.joulespersecond.oba"]
buildConfigField "int", "ARRIVAL_INFO_STYLE", "0" // Defined in BuildFlavorConstants
buildConfigField "boolean", "USE_FIXED_REGION", "false" // Supports multi-region
buildConfigField "String", "EMBEDDED_SOCIAL_API_KEY", "\"" + getEmbeddedSocialKey("ApiKey", name) + "\""
buildConfigField "String", "EMBEDDED_SOCIAL_TELEMETRY_KEY", "\"" + getEmbeddedSocialKey("TelemetryKey", name) + "\""
buildConfigField "boolean", "USE_PELIAS_GEOCODING", "true"
buildConfigField "String", "PELIAS_API_KEY", "\"" + getPeliasKey(name) + "\""
// Below fields need to be defined so flavor builds, but will not be used by app
Expand All @@ -125,7 +115,6 @@ android {
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_OBA_DISCOVERY_APIS", "true"
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_OBA_REALTIME_APIS", "true"
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_SIRI_REALTIME_APIS", "false"
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_EMBEDDEDSOCIAL", "false"
buildConfigField "String", "FIXED_REGION_TWITTER_URL", "null"
buildConfigField "String", "FIXED_REGION_STOP_INFO_URL", "null"
buildConfigField "String", "FIXED_REGION_OPEN311_JURISDICTION_ID", "null"
Expand Down Expand Up @@ -157,8 +146,6 @@ android {
manifestPlaceholders = [databaseAuthority: applicationId.toString() + '.provider']
buildConfigField "int", "ARRIVAL_INFO_STYLE", "0" // Defined in BuildFlavorConstants
buildConfigField "boolean", "USE_FIXED_REGION", "false" // Supports multi-region
buildConfigField "String", "EMBEDDED_SOCIAL_API_KEY", "\"" + getEmbeddedSocialKey("ApiKey", name) + "\""
buildConfigField "String", "EMBEDDED_SOCIAL_TELEMETRY_KEY", "\"" + getEmbeddedSocialKey("TelemetryKey", name) + "\""
buildConfigField "boolean", "USE_PELIAS_GEOCODING", "true"
buildConfigField "String", "PELIAS_API_KEY", "\"" + getPeliasKey(name) + "\""
// Below fields need to be defined so flavor builds, but will not be used by app
Expand All @@ -174,7 +161,6 @@ android {
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_OBA_DISCOVERY_APIS", "true"
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_OBA_REALTIME_APIS", "true"
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_SIRI_REALTIME_APIS", "false"
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_EMBEDDEDSOCIAL", "false"
buildConfigField "String", "FIXED_REGION_TWITTER_URL", "null"
buildConfigField "String", "FIXED_REGION_STOP_INFO_URL", "null"
buildConfigField "String", "FIXED_REGION_OPEN311_JURISDICTION_ID", "null"
Expand All @@ -197,8 +183,6 @@ android {
manifestPlaceholders = [databaseAuthority: applicationId.toString() + '.provider']
buildConfigField "int", "ARRIVAL_INFO_STYLE", "1" // Defined in BuildFlavorConstants
buildConfigField "boolean", "USE_FIXED_REGION", "true" // Does not support multi-region
buildConfigField "String", "EMBEDDED_SOCIAL_API_KEY", "\"" + getEmbeddedSocialKey("ApiKey", name) + "\""
buildConfigField "String", "EMBEDDED_SOCIAL_TELEMETRY_KEY", "\"" + getEmbeddedSocialKey("TelemetryKey", name) + "\""
buildConfigField "boolean", "USE_PELIAS_GEOCODING", "true"
buildConfigField "String", "PELIAS_API_KEY", "\"" + getPeliasKey(name) + "\""
// Fixed region info that the app will use
Expand All @@ -215,7 +199,6 @@ android {
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_OBA_DISCOVERY_APIS", "true"
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_OBA_REALTIME_APIS", "true"
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_SIRI_REALTIME_APIS", "false"
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_EMBEDDEDSOCIAL", "false"
buildConfigField "String", "FIXED_REGION_TWITTER_URL",
"\"http://mobile.twitter.com/OBA_tampa\""
buildConfigField "String", "FIXED_REGION_STOP_INFO_URL", "null"
Expand All @@ -241,8 +224,6 @@ android {
manifestPlaceholders = [databaseAuthority: applicationId.toString() + '.provider']
buildConfigField "int", "ARRIVAL_INFO_STYLE", "1" // Defined in BuildFlavorConstants
buildConfigField "boolean", "USE_FIXED_REGION", "true" // Does not support multi-region
buildConfigField "String", "EMBEDDED_SOCIAL_API_KEY", "\"" + getEmbeddedSocialKey("ApiKey", name) + "\""
buildConfigField "String", "EMBEDDED_SOCIAL_TELEMETRY_KEY", "\"" + getEmbeddedSocialKey("TelemetryKey", name) + "\""
buildConfigField "boolean", "USE_PELIAS_GEOCODING", "false"
buildConfigField "String", "PELIAS_API_KEY", "\"" + getPeliasKey(name) + "\""
// Fixed region info that the app will use
Expand All @@ -259,7 +240,6 @@ android {
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_OBA_DISCOVERY_APIS", "true"
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_OBA_REALTIME_APIS", "true"
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_SIRI_REALTIME_APIS", "false"
buildConfigField "boolean", "FIXED_REGION_SUPPORTS_EMBEDDEDSOCIAL", "false"
buildConfigField "String", "FIXED_REGION_TWITTER_URL",
"\"https://twitter.com/YRTViva\""
buildConfigField "String", "FIXED_REGION_STOP_INFO_URL", "null"
Expand Down Expand Up @@ -302,9 +282,7 @@ android {
// http://stackoverflow.com/questions/20673625/gradle-0-7-0-duplicate-files-during-packaging-of-apk
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}

lintOptions {
Expand Down Expand Up @@ -385,17 +363,6 @@ android {
useLibrary 'android.test.mock'
}

/**
* Returns the Embedded Social key (e.g. "ApiKey" or "TelemetryKey") from gradle.properties for the given product flavor (e.g., "oba"), or returns the empty string if the key is not found
*/
def getEmbeddedSocialKey(keyType, productFlavor) {
def keyName = "EmbeddedSocial" + keyType + "_" + productFlavor
if (project.hasProperty(keyName)) {
return project.property(keyName)
} else {
return ""
}
}
/**
* Gets the Pelias geocoding API key for the given product flavor
* @param productFlavor the product flavor being built
Expand Down Expand Up @@ -434,15 +401,6 @@ task copyMapsApiV2Classes {

preBuild.dependsOn copyMapsApiV2Classes

tasks.whenTaskAdded { theTask ->
// Make sure that OBA release builds always have an Embedded Social API key (#907)
def runningTask = project.gradle.startParameter.taskNames

if ((runningTask.toString().toLowerCase().matches("(.*)oba(.*)release(.*)") || runningTask.toString().toLowerCase().contains("assemblerelease") ) && !project.hasProperty('EmbeddedSocialApiKey_oba')) {
throw new InvalidUserDataException("gradle.properties must contain an EmbeddedSocialApiKey_oba API key for oba release builds")
}
}

// Exclude all classes from dependencies that conflict with Android platform classes (#849)
configurations {
all {
Expand Down Expand Up @@ -492,8 +450,6 @@ dependencies {
googleImplementation 'com.google.android.libraries.places:places-compat:1.1.0'
// Amazon Maps (only for Amazon flavor)
amazonImplementation 'com.amazon.android:amazon-maps-api:2.0'
// Embedded Social SDK
implementation('com.acrowntest.ES_SDK:sdk:0.7.6')
// Autocomplete text views with clear button for trip planning
implementation 'com.google.android.material:material:1.1.0'
// Required to support multidex for minSdkVersion <= 20
Expand Down
50 changes: 0 additions & 50 deletions onebusaway-android/proguard-project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,57 +61,7 @@
# Keep Open311 library (needed for unit tests)
-keep class edu.usf.cutr.open311client.** { *; }

-keep class com.microsoft.embeddedsocial.** { *; }

# annotations
-dontwarn javax.annotation.**

-dontwarn sun.misc.Unsafe

# for joda DateTime
-dontwarn org.joda.convert.**
-dontwarn org.joda.time.**
-keep class org.joda.time.** { *; }
-keep interface org.joda.time.** { *;}

# for picasso
-dontwarn com.squareup.okhttp.**

-dontwarn okhttp3.**
-dontwarn okio.**

-dontwarn retrofit2.**

-dontwarn uk.co.senab.photoview.**

-keep interface java.lang.Method { *; }
-keep class org.codehaus.mojo.** { *; }

# for parcelables for reflection
-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
public static final *** NULL;
}

# prevent renaming of Parcelable/SafeParcelable classes
-keep class com.google.android.gms.common.internal.ReflectedParcelable
-keepnames class * implements com.google.android.gms.common.internal.ReflectedParcelable
-keepclassmembers class * implements android.os.Parcelable {
public static final *** CREATOR;
}

# for Google auth scopes
-keep class com.google.android.gms.common.api.Scope

# for android LifecyleOwner
-keep class android.arch.** { *; }

# for AndroidSlidingUpPanel and compiling with API 28 (see https://github.com/OneBusAway/onebusaway-android/issues/944#issuecomment-446340531)
-dontwarn com.sothree.**
-keep class com.sothree.**
-keep interface com.sothree.**

# for TabLayout in EmbeddedSocial SDK and compiling with API 28 (see https://github.com/OneBusAway/onebusaway-android/issues/944#issuecomment-446345133)
-dontwarn com.microsoft.embeddedsocial.sdk.ui.TabbedDrawerHandler

# for EmbeddedSocial SDK
-dontwarn com.microsoft.rest.Validator
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ public static void assertOK(ObaResponse response) {

@Before
public void before() {
// Workaround for #940 - when Embedded Social no longer runs services in the background the
// call to setUpSocial() can be removed here in favor of early init in Application (see #957)
Application.get().setUpSocial();

// The theme needs to be set when using "attr/?" elements - see #279
getTargetContext().setTheme(R.style.Theme_OneBusAway);

Expand Down

This file was deleted.

Loading

0 comments on commit 0d99235

Please sign in to comment.