mirror of
https://github.com/NekoX-Dev/NekoX.git
synced 2024-12-14 08:29:49 +01:00
Fix build with f-droid
This commit is contained in:
parent
cd182b1b07
commit
28301ad426
@ -1,6 +1,7 @@
|
||||
package tw.nekomimi.nekogram;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.IntentSender;
|
||||
import android.text.TextUtils;
|
||||
import android.view.WindowManager;
|
||||
@ -15,6 +16,7 @@ import com.google.android.play.core.install.InstallStateUpdatedListener;
|
||||
import com.google.android.play.core.install.model.AppUpdateType;
|
||||
import com.google.android.play.core.install.model.InstallStatus;
|
||||
import com.google.android.play.core.install.model.UpdateAvailability;
|
||||
import com.google.android.play.core.missingsplits.MissingSplitsManagerFactory;
|
||||
import com.google.firebase.iid.FirebaseInstanceId;
|
||||
|
||||
import org.telegram.messenger.ApplicationLoader;
|
||||
@ -49,6 +51,12 @@ public class GcmImpl implements ExternalGcm.Interface {
|
||||
return hasPlayServices;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkSplit(Context ctx) {
|
||||
//noinspection deprecation
|
||||
return MissingSplitsManagerFactory.create(ctx).disableAppIfMissingRequiredSplits();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initPlayServices() {
|
||||
Utilities.stageQueue.postRunnable(() -> {
|
||||
|
@ -32,8 +32,6 @@ import android.util.Log;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
import androidx.multidex.MultiDex;
|
||||
|
||||
import com.google.android.play.core.missingsplits.MissingSplitsManagerFactory;
|
||||
|
||||
import org.telegram.tgnet.ConnectionsManager;
|
||||
import org.telegram.tgnet.TLRPC;
|
||||
import org.telegram.ui.ActionBar.Theme;
|
||||
@ -340,8 +338,7 @@ public class ApplicationLoader extends Application {
|
||||
} catch (Throwable ignore) {
|
||||
}
|
||||
|
||||
//noinspection deprecation
|
||||
if (BuildVars.isPlay && MissingSplitsManagerFactory.create(this).disableAppIfMissingRequiredSplits()) {
|
||||
if (BuildVars.isPlay && ExternalGcm.checkSplit(this)) {
|
||||
return; // Skip app initialization.
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,15 @@
|
||||
package tw.nekomimi.nekogram;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
import org.telegram.messenger.FileLog;
|
||||
|
||||
public class ExternalGcm {
|
||||
|
||||
interface Interface {
|
||||
boolean checkSplit(Context ctx);
|
||||
|
||||
boolean checkPlayServices();
|
||||
|
||||
void initPlayServices();
|
||||
@ -18,6 +21,11 @@ public class ExternalGcm {
|
||||
|
||||
static class NoImpl implements Interface {
|
||||
|
||||
@Override
|
||||
public boolean checkSplit(Context ctx) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayServices() {
|
||||
return false;
|
||||
@ -50,6 +58,10 @@ public class ExternalGcm {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean checkSplit(Context ctx) {
|
||||
return impl.checkSplit(ctx);
|
||||
}
|
||||
|
||||
public static void initPlayServices() {
|
||||
impl.initPlayServices();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user