13

I built an Android app that is somehow taking over or overriding the Lyft driver app. Basically, whenever a user has my Android app downloaded, it somehow takes over her Lyft app. She will not get any ride requests from Lyft (even during the middle of a super busy time). Then, when she deletes my app, it works perfectly again. She immediately gets rides again. It is the weirdest thing I have ever seen. And this is not just coincidental, when she goes to kill her apps, it literally shows my app logo taking over the Lyft driver app. Photo Attached Notice how originally it has the Lyft logo. Then, when my app is installed, it has my logo for the Lyft app (my logo is just the default Android logo). She can even kill my app, and her Lyft and also Uber driver app do not work! The only way to fix it is to completely uninstall my app and restart her phone. Then, everything works perfectly. One important element is I do track the location all the time. I'm just not really sure where even to start with this bug, so any ideas are helpful. Thanks! The user is using a Galaxy Note 10+ with Android 10. None of our other Android users have told us about this problem. It seems to be a unique case for this phone.

Here are all my manifest and intents:

    <?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.danieljones.nomad_drivers">

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/>

    <application
        android:requestLegacyExternalStorage="true"
        android:name=".parse.Parse"
        android:allowBackup="true"
        android:fullBackupContent="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".checkIn.CheckInActivity"
            android:label="@string/title_activity_check_in"/>
        <activity android:name=".insurance.analysis_activity.ZendriveAnalysisActivity" />
        <activity android:name=".fare.breakdowns.FareBreakdownActivity" />
        <activity
            android:name=".navigation.HomeNavigationActivity"
            android:label="@string/title_activity_home_navigation"
            android:screenOrientation="portrait"/>
        <activity android:name=".welcome.LoginActivity" />
        <activity android:name=".welcome.special_code.CodeActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".new_rides.ride_detail.NewRideDetailActivity" />
        <activity android:name=".rides_lists.ride_detail.RideDetailActivity" />
        <activity android:name=".personal_rides.ride_detail.PersonalRideDetailActivity" />
        <activity android:name=".review_list.ReviewActivity"/>
        <activity android:name=".user_profile.driver_card.EditProfileActivity" />
        <activity android:name=".user_profile.edit_form.EditProfileFormActivity"/>
        <receiver android:name=".insurance.zendrive.MyZendriveBroadcastReceiver" />
        <activity android:name=".archived_rides.ride_detail.ArchivedRideDetailActivity" />
        <service
            android:name="com.parse.fcm.ParseFirebaseMessagingService"
            android:permission="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT"/>
            </intent-filter>
        </service>
        <receiver
            android:name=".push_notifications.ParseCustomBroadcastReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="com.parse.push.intent.RECEIVE" />
                <action android:name="com.parse.push.intent.DELETE" />
                <action android:name="com.parse.push.intent.OPEN" />
            </intent-filter>
        </receiver>
    </application>
Marian Paździoch
  • 8,813
  • 10
  • 58
  • 103
Daniel Jones
  • 1,032
  • 10
  • 18
  • 3
    Start by including in the question your manifest and all intent filters. – Morrison Chang Feb 28 '20 at 21:26
  • Okay, I added the manifest. – Daniel Jones Feb 28 '20 at 21:41
  • 1) What versions of Android / devices is this occurring 2) Are you doing anything special programmatically with `Context.registerReceiver()` or `PackageManager`. See: [How to create/disable intent-filter by programmable way?](https://stackoverflow.com/q/14142101/295004) – Morrison Chang Feb 28 '20 at 21:59
  • 10
    Your customer might prefer for you to crop their name out... – Tenfour04 Feb 28 '20 at 22:02
  • whats your application id? is your app installed via Play Store? is Lyft app installed via Play Store? does it happen even without touching your app, or only after you manually enter your app from launcher? the icon is wrong also for launcher, app list in settings, any other place or just in recent app list? start with filling a bug to google issue tracker and Galaxy Note 10+ with Android 10 manufacturer. – Marian Paździoch Mar 02 '20 at 21:19
  • Are you able to reproduce the issue on your own phone? – Quinn Mar 02 '20 at 21:36
  • application id = com.danieljones.nomad_drivers Both apps (the lyft and my app) are installed via the Google Play store. What do you mean by manually enter your app from launcher (sorry, I'm normally an iPhone user, so don't know all the Android lingo). I only know about the logo being wrong for the photo above. I don't know yet about the settings or other areas of the app. – Daniel Jones Mar 02 '20 at 22:54
  • @MorrisonChang It does not seem like I am doing anything weird with Context.registerReceiver(). I searched my whole project and could not find that line of code. The only time I use the PackageManager is to read if a Permission is available. – Daniel Jones Mar 02 '20 at 23:02
  • 2
    some suggestions: 1. Ask her to install your App. Restart the device and then start using Uber/Lyft without opening your App and see it if that works 2. Device might have some kind of malware/virus. Ask her to do a factory reset and then perform the task. – Sahil Manchanda Mar 03 '20 at 03:39
  • Did you try seeing what happens if you uninstall uber/lyft but leave your app? – figbar Mar 05 '20 at 22:47
  • Change the logo of your app to something else. Default logo is sometimes shown like this on my phone as well, and it's not the same version, nor has any of mentioned apps installed. Not even any app with logo like this. It might not be showing your logo, but rather just the default logo. – Primož Ivančič Mar 07 '20 at 20:44
  • Very interesting case. Upvoted. – Nezih Yılmaz Mar 08 '20 at 15:36
  • Try this, create a new class and have it extend `Application` (If you already have one, just make sure it is under your package structure). Next, change the `name` element in your `application` tag to `com.danieljones.nomad_drivers.THE_CLASS_HERE_THAT_EXTENDS_APPLICATION` and see if that resolves your issue. – PGMacDesign Mar 09 '20 at 16:33
  • Probable non-tech solution: Ask your user to go to the App Info when your app is installed. From there, have your user go to "Set as default" and tap on "Clear defaults". From there, have your user screenshot this to ensure you're not accidentally capturing any of the Lyft supported web addresses. Tech solution: You need to post your merged AndroidManifest (clear any secret keys, obviously) and post that. There might be a library you are using that is causing it to capture an intent or category that is used by the Lyft driver app. – Pablo Baxter Mar 09 '20 at 23:24

1 Answers1

2

I believe your issue is related to your defined name element in your Manifest.xml, specifically, the one underneath the application tag.

You have yours defined as: .parse.parse, which seems rather odd to me. Looking at this link from the parse platform, I think that's what you are declaring as your app's name.

This name element, though it may seem unimportant, is actually where your application is generating the Application level Context from, or in this case, where the external Intents are being discovered.

It's highly likely that the system cannot distinguish which one to pull and it is therefore pulling yours over Lyft when it can.

To resolve this, just declare your own class that extends the Application class somewhere in your project like this:

public class MyApplication extends Application {

    private static MyApplication sInstance;

    @Override
    public void onCreate() {
        super.onCreate();
        sInstance = this;
    }

    /**
     * Get an instance of the application. 
     *
     * @return {@link MyApplication}
     */
    public static synchronized MyApplication getInstance() {
        if (sInstance == null) {
            sInstance = new MyApplication();
        }
        return sInstance;
    }

    /**
     * Get context
     *
     * @return Context
     */
    public static synchronized Context getContext() {
        return getInstance().getApplicationContext();
    }
}

Then just update your Manifest to look like this:

 <application
        .
        android:name=".MyApplication"
        .
        .
        .>
...

And it should function properly.

If you are still having troubles, update your question with more info and we can diagnose it further.

ich5003
  • 838
  • 1
  • 9
  • 24
PGMacDesign
  • 6,092
  • 8
  • 41
  • 78
  • The android app instance can and should only be created by android os.. what is that getinstance suppose to do there? Besides you should never statically hard reference your application.. it confuses android system when it wants to clear unused apps from their runtime – TacB0sS Mar 10 '20 at 00:22
  • Also, if app name starts with a .something it searches for the app class under `${packageName}.something` so that too should not be the reason – TacB0sS Mar 10 '20 at 00:24
  • Here is some reference material if you are curious as to the various purposes of this approach. https://github.com/codepath/android_guides/wiki/Understanding-the-Android-Application-Class – PGMacDesign Mar 10 '20 at 00:56
  • The link doesnt describe your approach.. I will bet my career that the `new MyApplication()` is never ever called, unless you run on a messed up custom rom. Also no where there they hold a static reference to the application – TacB0sS Mar 10 '20 at 06:41