Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Licensing service #2069

Merged
merged 24 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4770884
Licensing service
fynngodau Sep 26, 2023
4485f34
Replace hardcoded auth token with auth token fetched via account
fynngodau Oct 1, 2023
78c9404
Notify is user not signed in to any Google account
fynngodau Oct 3, 2023
305d30e
Don't provide most negative results in V2 licensing
fynngodau Oct 3, 2023
a18c534
Improve license notification icon & sound
fynngodau Oct 3, 2023
b88aace
Query licenses from multiple Google accounts in a row
fynngodau Oct 4, 2023
ac265d8
Dismiss all notifications if user wants to sign in
fynngodau Oct 4, 2023
141843f
Always request `android.permission.GET_ACCOUNTS`
fynngodau Oct 4, 2023
884050c
Target JVM 1.8 instead of 17 in fakestore
fynngodau Oct 4, 2023
a46daa3
Require permission to check license
fynngodau Oct 12, 2023
fff18c7
Apply review
fynngodau Oct 26, 2023
8934281
Check preference from within Licensing service
fynngodau Oct 24, 2023
4fe9bb9
Load device profile data for licensing user agent
fynngodau Nov 11, 2023
b65aaee
Apply review
fynngodau Dec 9, 2023
e84bdce
Use Google androidId for Licensing
jonathanklee Dec 19, 2023
30feaa2
Check preference from within Licensing service
fynngodau Oct 24, 2023
9fbaf2e
Fix swapped docstrings
fynngodau Jan 11, 2024
224f822
Fix Ignore on notification not working
fynngodau Jan 11, 2024
da7bb3d
Enable multidex
fynngodau Jan 11, 2024
92e38d1
Check for `POST_NOTIFICATIONS` permission
fynngodau Jan 22, 2024
46e8aac
Use big text style so that the text is displayed fully
Jan 17, 2024
1632e54
Disable `GetLocales` lint
fynngodau Jan 22, 2024
d4f0b56
Enable postprocessing in vending-app
fynngodau Jan 29, 2024
137a521
Revert "Enable multidex"
fynngodau Jan 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void run() {
ignoreIntent.putExtra(INTENT_KEY_IGNORE_PACKAGE_NAME, callerPackageName);
ignoreIntent.putExtra(INTENT_KEY_NOTIFICATION_ID, callerUid);
PendingIntent ignorePendingIntent = PendingIntent.getBroadcast(
context, callerUid * 2 + 1, ignoreIntent, PendingIntent.FLAG_IMMUTABLE
context, callerUid * 2 + 1, ignoreIntent, PendingIntent.FLAG_MUTABLE
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not one bit of an idea why, in my emulator tests, the INTENT_KEY_IGNORE_PACKAGE_NAME extra doesn't reach the receiver when FLAG_IMMUTABLE is set.

);

Notification notification = new NotificationCompat.Builder(context, CHANNEL_ID)
Expand Down Expand Up @@ -128,6 +128,11 @@ public void onReceive(Context context, Intent intent) {
);

String newIgnorePackage = intent.getStringExtra(INTENT_KEY_IGNORE_PACKAGE_NAME);
if (newIgnorePackage == null) {
Log.e(TAG, "Received no ignore package; can't add to ignore list.");
return;
}

Log.d(TAG, "Adding package " + newIgnorePackage + " to ignore list");

ignoreList.add(newIgnorePackage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,15 @@ private void checkLicenseV2(String packageName, PackageManager packageManager,
}

private void handleNoAccounts(String packageName, PackageManager packageManager) {
notificationRunnable.callerPackageName = packageName;
try {
Log.e(TAG, "not checking license, as user is not signed in");
PackageInfo packageInfo = packageManager.getPackageInfo(packageName, 0);
notificationRunnable.callerUid = packageInfo.applicationInfo.uid;
notificationRunnable.callerAppName = packageManager.getApplicationLabel(packageInfo.applicationInfo);
if (notificationRunnable.callerAppName == null) {
notificationRunnable.callerAppName = packageName;
}
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "ignored license request, but package name " + packageName + " was not known!");
notificationRunnable.callerAppName = packageName;
Expand Down
Loading