Skip to content

Commit f107fdb

Browse files
committed
Link self-check failures to documentation
1 parent 046c00b commit f107fdb

3 files changed

Lines changed: 46 additions & 4 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (C) 2026 microG Project Team
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.microg.tools.selfcheck;
18+
19+
import android.content.Intent;
20+
import android.net.Uri;
21+
import android.util.Log;
22+
23+
import androidx.fragment.app.Fragment;
24+
25+
class DocumentationResolver implements SelfCheckGroup.CheckResolver {
26+
private static final String TAG = "SelfCheck";
27+
private static final String WIKI_BASE_URL = "https://github.com/microg/GmsCore/wiki/";
28+
29+
private final String page;
30+
31+
DocumentationResolver(String page) {
32+
this.page = page;
33+
}
34+
35+
@Override
36+
public void tryResolve(Fragment fragment) {
37+
try {
38+
fragment.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(WIKI_BASE_URL + page)));
39+
} catch (Exception e) {
40+
Log.w(TAG, e);
41+
}
42+
}
43+
}

play-services-core/src/main/java/org/microg/tools/selfcheck/InstalledPackagesChecks.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ private boolean addPackageInstalledResult(Context context, ResultCollector colle
8282
packageExists = false;
8383
}
8484
collector.addResult(context.getString(R.string.self_check_name_app_installed, nicePackageName), packageExists ? Positive : Negative,
85-
context.getString(R.string.self_check_resolution_app_installed, nicePackageName));
85+
context.getString(R.string.self_check_resolution_app_installed, nicePackageName),
86+
new DocumentationResolver("Installation"));
8687
return packageExists;
8788
}
8889
}

play-services-core/src/main/java/org/microg/tools/selfcheck/RomSpoofSignatureChecks.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import android.content.pm.PackageManager;
2121

2222
import androidx.core.content.ContextCompat;
23-
import androidx.fragment.app.Fragment;
2423

2524
import com.google.android.gms.R;
2625

@@ -31,7 +30,6 @@
3130
import static org.microg.gms.common.Constants.GMS_PACKAGE_SIGNATURE_SHA1;
3231
import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Negative;
3332
import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Positive;
34-
import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Unknown;
3533

3634
public class RomSpoofSignatureChecks implements SelfCheckGroup {
3735

@@ -72,7 +70,7 @@ private boolean addSystemSpoofsSignature(Context context, ResultCollector collec
7270
context.getString(R.string.self_check_name_system_spoofs),
7371
spoofsSignature ? Positive : Negative,
7472
context.getString(R.string.self_check_resolution_system_spoofs),
75-
fragment -> fragment.requestPermissions(new String[]{FAKE_SIGNATURE_PERMISSION}, 0)
73+
new DocumentationResolver("Signature-Spoofing")
7674
);
7775
}
7876
return spoofsSignature;

0 commit comments

Comments
 (0)