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

Commit cac235e

Browse files
committed
Add ReferrerService
1 parent a23fbfc commit cac235e

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

fake-store/src/main/AndroidManifest.xml

+9
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,21 @@
3636
</intent-filter>
3737
</service>
3838

39+
<service
40+
android:name="com.google.android.finsky.externalreferrer.GetInstallReferrerService"
41+
android:exported="true">
42+
<intent-filter>
43+
<action android:name="com.google.android.finsky.BIND_GET_INSTALL_REFERRER_SERVICE" />
44+
</intent-filter>
45+
</service>
46+
3947
<activity
4048
android:name="org.microg.vending.ui.MainActivity"
4149
android:theme="@style/Theme.Dialog.NoActionBar"
4250
android:exported="true">
4351
<intent-filter>
4452
<action android:name="android.intent.action.MAIN" />
53+
4554
<category android:name="android.intent.category.DEFAULT" />
4655
<category android:name="android.intent.category.INFO" />
4756
</intent-filter>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2023 microG Project Team
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package com.google.android.finsky.externalreferrer;
7+
8+
interface IGetInstallReferrerService {
9+
Bundle getInstallReferrer(in Bundle request);
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2023 microG Project Team
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package com.google.android.finsky.externalreferrer;
7+
8+
import android.app.Service;
9+
import android.content.Intent;
10+
import android.os.Bundle;
11+
import android.os.IBinder;
12+
import android.os.RemoteException;
13+
14+
public class GetInstallReferrerService extends Service {
15+
private static final String TAG = "FakeReferrerService";
16+
17+
private final IGetInstallReferrerService.Stub service = new IGetInstallReferrerService.Stub() {
18+
// https://developer.android.com/google/play/installreferrer/igetinstallreferrerservice
19+
@Override
20+
public Bundle getInstallReferrer(Bundle request) throws RemoteException {
21+
String packageName = request.getString("package_name");
22+
Bundle result = new Bundle();
23+
result.putString("install_referrer", "https://play.google.com/store/apps/details?utm_source=google-play&utm_medium=organic&id="+packageName);
24+
result.putLong("referrer_click_timestamp_seconds", 0);
25+
result.putLong("referrer_click_timestamp_server_seconds", 0);
26+
result.putLong("install_begin_timestamp_seconds", 0);
27+
result.putLong("install_begin_timestamp_server_seconds", 0);
28+
result.putString("install_version", null);
29+
result.putBoolean("google_play_instant", false);
30+
return result;
31+
}
32+
};
33+
34+
@Override
35+
public IBinder onBind(Intent intent) {
36+
return service.asBinder();
37+
}
38+
}

0 commit comments

Comments
 (0)