Skip to content

Commit e5fd24b

Browse files
committed
Make naming great again
When we build APKs in PRs it's also a GITHUB_APK...
1 parent 8dc3427 commit e5fd24b

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

app/src/main/java/org/schabi/newpipe/CheckForNewAppVersion.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ public CheckForNewAppVersion() {
4646
private static final boolean DEBUG = MainActivity.DEBUG;
4747
private static final String TAG = CheckForNewAppVersion.class.getSimpleName();
4848

49-
private static final String GITHUB_APK_SHA1
49+
// Public key of the certificate that is used in NewPipe release versions
50+
private static final String RELEASE_CERT_PUBLIC_KEY_SHA1
5051
= "B0:2E:90:7C:1C:D6:FC:57:C3:35:F0:88:D0:8F:50:5F:94:E4:D2:15";
5152
private static final String NEWPIPE_API_URL = "https://newpipe.net/api/data.json";
5253

@@ -156,8 +157,8 @@ private static void compareAppVersionAndShowNotification(@NonNull final Applicat
156157
}
157158
}
158159

159-
public static boolean isGithubApk(@NonNull final App app) {
160-
return getCertificateSHA1Fingerprint(app).equals(GITHUB_APK_SHA1);
160+
public static boolean isReleaseApk(@NonNull final App app) {
161+
return getCertificateSHA1Fingerprint(app).equals(RELEASE_CERT_PUBLIC_KEY_SHA1);
161162
}
162163

163164
private void checkNewVersion() throws IOException, ReCaptchaException {
@@ -167,7 +168,7 @@ private void checkNewVersion() throws IOException, ReCaptchaException {
167168
final NewVersionManager manager = new NewVersionManager();
168169

169170
// Check if the current apk is a github one or not.
170-
if (!isGithubApk(app)) {
171+
if (!isReleaseApk(app)) {
171172
return;
172173
}
173174

app/src/main/java/org/schabi/newpipe/settings/MainSettingsFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class MainSettingsFragment extends BasePreferenceFragment {
1616
public void onCreatePreferences(final Bundle savedInstanceState, final String rootKey) {
1717
addPreferencesFromResource(R.xml.main_settings);
1818

19-
if (!CheckForNewAppVersion.isGithubApk(App.getApp())) {
19+
if (!CheckForNewAppVersion.isReleaseApk(App.getApp())) {
2020
final Preference update
2121
= findPreference(getString(R.string.update_pref_screen_key));
2222
getPreferenceScreen().removePreference(update);

0 commit comments

Comments
 (0)