Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
Add ReferrerService
Browse files Browse the repository at this point in the history
  • Loading branch information
mar-v-in committed Sep 14, 2023
1 parent a23fbfc commit cac235e
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fake-store/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,21 @@
</intent-filter>
</service>

<service
android:name="com.google.android.finsky.externalreferrer.GetInstallReferrerService"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.finsky.BIND_GET_INSTALL_REFERRER_SERVICE" />
</intent-filter>
</service>

<activity
android:name="org.microg.vending.ui.MainActivity"
android:theme="@style/Theme.Dialog.NoActionBar"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.INFO" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.finsky.externalreferrer;

interface IGetInstallReferrerService {
Bundle getInstallReferrer(in Bundle request);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.finsky.externalreferrer;

import android.app.Service;
import android.content.Intent;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;

public class GetInstallReferrerService extends Service {
private static final String TAG = "FakeReferrerService";

private final IGetInstallReferrerService.Stub service = new IGetInstallReferrerService.Stub() {
// https://developer.android.com/google/play/installreferrer/igetinstallreferrerservice
@Override
public Bundle getInstallReferrer(Bundle request) throws RemoteException {
String packageName = request.getString("package_name");
Bundle result = new Bundle();
result.putString("install_referrer", "https://play.google.com/store/apps/details?utm_source=google-play&utm_medium=organic&id="+packageName);
result.putLong("referrer_click_timestamp_seconds", 0);
result.putLong("referrer_click_timestamp_server_seconds", 0);
result.putLong("install_begin_timestamp_seconds", 0);
result.putLong("install_begin_timestamp_server_seconds", 0);
result.putString("install_version", null);
result.putBoolean("google_play_instant", false);
return result;
}
};

@Override
public IBinder onBind(Intent intent) {
return service.asBinder();
}
}

0 comments on commit cac235e

Please sign in to comment.