Upgrade for Android 14+

This commit is contained in:
Thomas 2023-12-12 15:47:15 +01:00
parent 4c911705ab
commit 4a07e7c5b8
31 changed files with 156 additions and 89 deletions

View file

@ -8,11 +8,11 @@ plugins {
} }
def flavor def flavor
android { android {
compileSdk 33 compileSdk 34
defaultConfig { defaultConfig {
minSdk 21 minSdk 21
targetSdk 33 targetSdk 34
versionCode 500 versionCode 500
versionName "3.24.1" versionName "3.24.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -30,8 +30,8 @@ android {
} }
compileOptions { compileOptions {
coreLibraryDesugaringEnabled true coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_17
} }
productFlavors { productFlavors {
fdroid { fdroid {
@ -47,10 +47,6 @@ android {
flavor = "playstore" flavor = "playstore"
} }
} }
lintOptions {
checkReleaseBuilds false
abortOnError false
}
buildFeatures { buildFeatures {
viewBinding true viewBinding true
} }
@ -91,6 +87,11 @@ android {
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx' exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
} }
} }
namespace 'app.fedilab.android'
lint {
abortOnError false
checkReleaseBuilds false
}
} }
allprojects { allprojects {
repositories { repositories {
@ -102,7 +103,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0' implementation 'com.google.android.material:material:1.10.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
@ -111,7 +112,7 @@ dependencies {
implementation 'com.squareup.retrofit2:converter-gson:2.9.0' implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:converter-simplexml:2.9.0' implementation 'com.squareup.retrofit2:converter-simplexml:2.9.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.preference:preference:1.2.0' implementation 'androidx.preference:preference:1.2.1'
implementation "org.conscrypt:conscrypt-android:2.5.2" implementation "org.conscrypt:conscrypt-android:2.5.2"
implementation 'com.vanniktech:emoji-one:0.6.0' implementation 'com.vanniktech:emoji-one:0.6.0'
implementation 'com.github.GrenderG:Toasty:1.5.2' implementation 'com.github.GrenderG:Toasty:1.5.2'
@ -138,18 +139,18 @@ dependencies {
annotationProcessor "com.github.bumptech.glide:compiler:4.12.0" annotationProcessor "com.github.bumptech.glide:compiler:4.12.0"
implementation 'jp.wasabeef:glide-transformations:4.3.0' implementation 'jp.wasabeef:glide-transformations:4.3.0'
implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.23.0' implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.23.0'
implementation 'com.google.android.exoplayer:exoplayer:2.18.4' implementation 'com.google.android.exoplayer:exoplayer:2.19.1'
implementation "androidx.viewpager2:viewpager2:1.0.0" implementation "androidx.viewpager2:viewpager2:1.0.0"
implementation 'com.github.piasy:rxandroidaudio:1.7.0' implementation 'com.github.piasy:rxandroidaudio:1.7.0'
implementation 'com.github.piasy:AudioProcessor:1.7.0' implementation 'com.github.piasy:AudioProcessor:1.7.0'
implementation "androidx.work:work-runtime:2.7.1" implementation "androidx.work:work-runtime:2.9.0"
implementation 'app.futured.hauler:hauler:5.0.0' implementation 'app.futured.hauler:hauler:5.0.0'
implementation "com.github.chrisbanes:PhotoView:2.3.0" implementation "com.github.chrisbanes:PhotoView:2.3.0"
implementation "ch.acra:acra-mail:5.9.6" implementation "ch.acra:acra-mail:5.9.6"
implementation "ch.acra:acra-limiter:5.9.3" implementation "ch.acra:acra-limiter:5.9.3"
implementation "ch.acra:acra-dialog:5.9.6" implementation "ch.acra:acra-dialog:5.9.6"
implementation "com.madgag.spongycastle:bctls-jdk15on:1.58.0.0" implementation "com.madgag.spongycastle:bctls-jdk15on:1.58.0.0"
implementation 'com.github.UnifiedPush:android-connector:2.1.1' implementation 'com.github.UnifiedPush:android-connector:2.2.0'
// implementation 'com.github.UnifiedPush:android-foss_embedded_fcm_distributor:1.0.0-beta1' // implementation 'com.github.UnifiedPush:android-foss_embedded_fcm_distributor:1.0.0-beta1'
playstoreImplementation('com.github.UnifiedPush:android-embedded_fcm_distributor:2.2.0') { playstoreImplementation('com.github.UnifiedPush:android-embedded_fcm_distributor:2.2.0') {
exclude group: 'com.google.firebase', module: 'firebase-core' exclude group: 'com.google.firebase', module: 'firebase-core'
@ -159,29 +160,29 @@ dependencies {
implementation 'com.burhanrashid52:photoeditor:1.5.1' implementation 'com.burhanrashid52:photoeditor:1.5.1'
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'androidx.lifecycle:lifecycle-livedata:2.5.1' implementation 'androidx.lifecycle:lifecycle-livedata:2.6.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.5.1' implementation 'androidx.lifecycle:lifecycle-viewmodel:2.6.2'
implementation 'androidx.navigation:navigation-fragment:2.5.3' implementation 'androidx.navigation:navigation-fragment:2.7.5'
implementation 'androidx.navigation:navigation-ui:2.5.3' implementation 'androidx.navigation:navigation-ui:2.7.5'
testImplementation 'junit:junit:' testImplementation 'junit:junit:'
androidTestImplementation 'androidx.test.ext:junit:1.1.4' androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1' // debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
implementation 'com.r0adkll:slidableactivity:2.1.0' implementation 'com.r0adkll:slidableactivity:2.1.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0' implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation "androidx.fragment:fragment:1.5.5" implementation "androidx.fragment:fragment:1.6.2"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.browser:browser:1.5.0' implementation 'androidx.browser:browser:1.7.0'
implementation 'androidx.documentfile:documentfile:1.0.1' implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'com.github.amoskorir:avatarimagegenerator:1.5.0' implementation 'com.github.amoskorir:avatarimagegenerator:1.5.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0' implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
implementation 'com.google.android.exoplayer:extension-mediasession:2.18.4' implementation 'com.google.android.exoplayer:extension-mediasession:2.19.1'
implementation "com.github.mabbas007:TagsEditText:1.0.5" implementation "com.github.mabbas007:TagsEditText:1.0.5"
implementation "net.gotev:uploadservice:4.7.0" implementation "net.gotev:uploadservice:4.9.2"
implementation "net.gotev:uploadservice-okhttp:4.7.0" implementation "net.gotev:uploadservice-okhttp:4.9.2"
implementation 'androidx.media:media:1.6.0' implementation 'androidx.media:media:1.7.0'
implementation 'com.github.mancj:MaterialSearchBar:0.8.5' implementation 'com.github.mancj:MaterialSearchBar:0.8.5'
implementation 'com.github.vkay94:DoubleTapPlayerView:1.0.0' implementation 'com.github.vkay94:DoubleTapPlayerView:1.0.0'
@ -197,10 +198,10 @@ dependencies {
//************ CAST **************/// //************ CAST **************///
//---> Google libs (google_full) //---> Google libs (google_full)
playstoreImplementation "com.google.android.gms:play-services-cast-tv:19.0.1" playstoreImplementation "com.google.android.gms:play-services-cast-tv:21.0.1"
playstoreImplementation "com.google.android.gms:play-services-cast:21.0.1" playstoreImplementation "com.google.android.gms:play-services-cast:21.4.0"
playstoreImplementation "androidx.mediarouter:mediarouter:1.3.0" playstoreImplementation "androidx.mediarouter:mediarouter:1.6.0"
playstoreImplementation 'com.google.android.gms:play-services-cast-framework:21.0.1' playstoreImplementation 'com.google.android.gms:play-services-cast-framework:21.4.0'
//----> Other flavors //----> Other flavors

View file

@ -19,6 +19,7 @@ import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
@ -147,7 +148,11 @@ public abstract class PeertubeBaseMainActivity extends BaseActivity implements C
} }
} }
}; };
LocalBroadcastManager.getInstance(PeertubeBaseMainActivity.this).registerReceiver(manage_chromecast, new IntentFilter(Helper.RECEIVE_CAST_SETTINGS)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
registerReceiver(manage_chromecast, new IntentFilter(Helper.RECEIVE_CAST_SETTINGS), Context.RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(manage_chromecast, new IntentFilter(Helper.RECEIVE_CAST_SETTINGS));
}
} }
@Override @Override
@ -189,8 +194,7 @@ public abstract class PeertubeBaseMainActivity extends BaseActivity implements C
super.onDestroy(); super.onDestroy();
ChromeCasts.unregisterListener(this); ChromeCasts.unregisterListener(this);
if (manage_chromecast != null) { if (manage_chromecast != null) {
LocalBroadcastManager.getInstance(PeertubeBaseMainActivity.this).unregisterReceiver(manage_chromecast); unregisterReceiver(manage_chromecast);
new Thread(() -> { new Thread(() -> {
if (chromeCasts != null && chromeCasts.size() > 0) { if (chromeCasts != null && chromeCasts.size() > 0) {
for (ChromeCast cast : chromeCasts) { for (ChromeCast cast : chromeCasts) {

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools">
package="app.fedilab.android">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
@ -13,6 +12,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-feature <uses-feature
android:name="android.hardware.camera" android:name="android.hardware.camera"
@ -576,6 +576,7 @@
<service <service
android:name=".peertube.services.RetrieveInfoService" android:name=".peertube.services.RetrieveInfoService"
android:foregroundServiceType="dataSync"
android:exported="false" /> android:exported="false" />

View file

@ -1063,6 +1063,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
mamageNewIntent(BaseMainActivity.this, intent); mamageNewIntent(BaseMainActivity.this, intent);
} }
@SuppressLint("UnspecifiedRegisterReceiverFlag")
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -1074,7 +1075,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
finish(); finish();
return; return;
} else { } else {
BaseMainActivity.currentToken = sharedpreferences.getString(Helper.PREF_USER_TOKEN, null); BaseMainActivity.currentToken = sharedpreferences.getString(PREF_USER_TOKEN, null);
} }
String software = sharedpreferences.getString(PREF_USER_SOFTWARE, null); String software = sharedpreferences.getString(PREF_USER_SOFTWARE, null);
@ -1528,10 +1529,13 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
binding.toolbarSearch.setOnSearchClickListener(v -> binding.tabLayout.setVisibility(View.VISIBLE)); binding.toolbarSearch.setOnSearchClickListener(v -> binding.tabLayout.setVisibility(View.VISIBLE));
//For receiving data from other activities //For receiving data from other activities
LocalBroadcastManager.getInstance(BaseMainActivity.this).registerReceiver(broadcast_data, new IntentFilter(Helper.BROADCAST_DATA)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
LocalBroadcastManager.getInstance(BaseMainActivity.this) registerReceiver(broadcast_data, new IntentFilter(Helper.BROADCAST_DATA), Context.RECEIVER_NOT_EXPORTED);
.registerReceiver(broadcast_error_message, registerReceiver(broadcast_error_message, new IntentFilter(Helper.INTENT_COMPOSE_ERROR_MESSAGE), Context.RECEIVER_NOT_EXPORTED);
new IntentFilter(Helper.INTENT_COMPOSE_ERROR_MESSAGE)); } else {
registerReceiver(broadcast_data, new IntentFilter(Helper.BROADCAST_DATA));
registerReceiver(broadcast_error_message, new IntentFilter(Helper.INTENT_COMPOSE_ERROR_MESSAGE));
}
if (emojis == null || !emojis.containsKey(BaseMainActivity.currentInstance) || emojis.get(BaseMainActivity.currentInstance) == null) { if (emojis == null || !emojis.containsKey(BaseMainActivity.currentInstance) || emojis.get(BaseMainActivity.currentInstance) == null) {
new Thread(() -> { new Thread(() -> {
try { try {
@ -1859,9 +1863,10 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
@Override @Override
protected void onDestroy() { protected void onDestroy() {
LocalBroadcastManager.getInstance(BaseMainActivity.this).unregisterReceiver(broadcast_data);
LocalBroadcastManager.getInstance(BaseMainActivity.this) unregisterReceiver(broadcast_data);
.unregisterReceiver(broadcast_error_message); unregisterReceiver(broadcast_error_message);
if (networkStateReceiver != null) { if (networkStateReceiver != null) {
try { try {
unregisterReceiver(networkStateReceiver); unregisterReceiver(networkStateReceiver);

View file

@ -204,8 +204,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
if (timer != null) { if (timer != null) {
timer.cancel(); timer.cancel();
} }
LocalBroadcastManager.getInstance(this) unregisterReceiver(imageReceiver);
.unregisterReceiver(imageReceiver);
} }
@ -214,6 +213,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
if (binding.recyclerView.getVisibility() == View.VISIBLE) { if (binding.recyclerView.getVisibility() == View.VISIBLE) {
storeDraftWarning(); storeDraftWarning();
} }
super.onBackPressed();
} }
private void storeDraftWarning() { private void storeDraftWarning() {
@ -734,10 +734,11 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
} }
} }
MastodonHelper.loadPPMastodon(binding.profilePicture, account.mastodon_account); MastodonHelper.loadPPMastodon(binding.profilePicture, account.mastodon_account);
LocalBroadcastManager.getInstance(this) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
.registerReceiver(imageReceiver, registerReceiver(imageReceiver, new IntentFilter(Helper.INTENT_SEND_MODIFIED_IMAGE), android.content.Context.RECEIVER_NOT_EXPORTED);
new IntentFilter(Helper.INTENT_SEND_MODIFIED_IMAGE)); } else {
registerReceiver(imageReceiver, new IntentFilter(Helper.INTENT_SEND_MODIFIED_IMAGE));
}
if (timer != null) { if (timer != null) {
timer.scheduleAtFixedRate(new TimerTask() { timer.scheduleAtFixedRate(new TimerTask() {
@Override @Override

View file

@ -140,7 +140,11 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
binding.mediaViewpager.setAdapter(mPagerAdapter); binding.mediaViewpager.setAdapter(mPagerAdapter);
binding.mediaViewpager.setSaveEnabled(false); binding.mediaViewpager.setSaveEnabled(false);
binding.mediaViewpager.setCurrentItem(mediaPosition - 1); binding.mediaViewpager.setCurrentItem(mediaPosition - 1);
registerReceiver(onDownloadComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
registerReceiver(onDownloadComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE), android.content.Context.RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(onDownloadComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
}
String description = attachments.get(mediaPosition - 1).description; String description = attachments.get(mediaPosition - 1).description;
handler = new Handler(); handler = new Handler();
if (attachments.get(mediaPosition - 1).status != null) { if (attachments.get(mediaPosition - 1).status != null) {

View file

@ -17,6 +17,7 @@ package app.fedilab.android.mastodon.activities;
import static app.fedilab.android.BaseMainActivity.currentAccount; import static app.fedilab.android.BaseMainActivity.currentAccount;
import android.app.DownloadManager;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.ClipData; import android.content.ClipData;
import android.content.ClipboardManager; import android.content.ClipboardManager;
@ -27,6 +28,7 @@ import android.content.SharedPreferences;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.graphics.drawable.Animatable; import android.graphics.drawable.Animatable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.text.SpannableString; import android.text.SpannableString;
import android.text.Spanned; import android.text.Spanned;
@ -204,7 +206,13 @@ public class ProfileActivity extends BaseActivity {
} }
//Check if account is homeMuted //Check if account is homeMuted
accountsVM.isMuted(currentAccount, account).observe(this, result -> homeMuted = result != null && result); accountsVM.isMuted(currentAccount, account).observe(this, result -> homeMuted = result != null && result);
LocalBroadcastManager.getInstance(ProfileActivity.this).registerReceiver(broadcast_data, new IntentFilter(Helper.BROADCAST_DATA)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
registerReceiver(broadcast_data, new IntentFilter(Helper.BROADCAST_DATA), android.content.Context.RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(broadcast_data, new IntentFilter(Helper.BROADCAST_DATA));
}
} }
@ -1266,7 +1274,7 @@ public class ProfileActivity extends BaseActivity {
scheduledExecutorService.shutdownNow(); scheduledExecutorService.shutdownNow();
scheduledExecutorService = null; scheduledExecutorService = null;
} }
LocalBroadcastManager.getInstance(ProfileActivity.this).unregisterReceiver(broadcast_data); unregisterReceiver(broadcast_data);
super.onDestroy(); super.onDestroy();
} }

View file

@ -22,6 +22,7 @@ import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
@ -83,7 +84,13 @@ public class AdminActionActivity extends BaseBarActivity {
binding = ActivityAdminActionsBinding.inflate(getLayoutInflater()); binding = ActivityAdminActionsBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot()); setContentView(binding.getRoot());
LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, new IntentFilter(Helper.BROADCAST_DATA));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
registerReceiver(mReceiver, new IntentFilter(Helper.BROADCAST_DATA), android.content.Context.RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(mReceiver, new IntentFilter(Helper.BROADCAST_DATA));
}
if (getSupportActionBar() != null) { if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} }
@ -318,7 +325,7 @@ public class AdminActionActivity extends BaseBarActivity {
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
if (mReceiver != null) { if (mReceiver != null) {
LocalBroadcastManager.getInstance(this).unregisterReceiver(mReceiver); unregisterReceiver(mReceiver);
} }
} }

View file

@ -20,6 +20,7 @@ import static app.fedilab.android.mastodon.activities.ContextActivity.expand;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -195,7 +196,12 @@ public class FragmentMastodonContext extends Fragment {
statusesVM.getContext(user_instance, user_token, focusedStatus.id) statusesVM.getContext(user_instance, user_token, focusedStatus.id)
.observe(getViewLifecycleOwner(), this::initializeContextView); .observe(getViewLifecycleOwner(), this::initializeContextView);
} }
LocalBroadcastManager.getInstance(requireActivity()).registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
requireActivity().registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION), android.content.Context.RECEIVER_NOT_EXPORTED);
} else {
requireActivity().registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION));
}
return binding.getRoot(); return binding.getRoot();
} }
@ -292,7 +298,7 @@ public class FragmentMastodonContext extends Fragment {
@Override @Override
public void onDestroyView() { public void onDestroyView() {
LocalBroadcastManager.getInstance(requireActivity()).unregisterReceiver(receive_action); requireActivity().unregisterReceiver(receive_action);
super.onDestroyView(); super.onDestroyView();
} }

View file

@ -207,8 +207,11 @@ public class FragmentMastodonDirectMessage extends Fragment {
statusCompose.text = binding.text.getText().toString(); statusCompose.text = binding.text.getText().toString();
onSubmit(prepareDraft(statusCompose, MainActivity.currentInstance, MainActivity.currentUserID)); onSubmit(prepareDraft(statusCompose, MainActivity.currentInstance, MainActivity.currentUserID));
}); });
LocalBroadcastManager.getInstance(requireActivity()).registerReceiver(broadcast_data, new IntentFilter(Helper.BROADCAST_DATA)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
requireActivity().registerReceiver(broadcast_data, new IntentFilter(Helper.BROADCAST_DATA), android.content.Context.RECEIVER_NOT_EXPORTED);
} else {
requireActivity().registerReceiver(broadcast_data, new IntentFilter(Helper.BROADCAST_DATA));
}
binding.text.setKeyBoardInputCallbackListener((inputContentInfo, flags, opts) -> { binding.text.setKeyBoardInputCallbackListener((inputContentInfo, flags, opts) -> {
if (inputContentInfo != null) { if (inputContentInfo != null) {
Uri uri = inputContentInfo.getContentUri(); Uri uri = inputContentInfo.getContentUri();
@ -273,7 +276,7 @@ public class FragmentMastodonDirectMessage extends Fragment {
@Override @Override
public void onDestroyView() { public void onDestroyView() {
LocalBroadcastManager.getInstance(requireActivity()).unregisterReceiver(broadcast_data); requireActivity().unregisterReceiver(broadcast_data);
super.onDestroyView(); super.onDestroyView();
} }

View file

@ -19,6 +19,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -205,8 +206,13 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
} }
aggregateNotification = false; aggregateNotification = false;
LocalBroadcastManager.getInstance(requireActivity()).registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
LocalBroadcastManager.getInstance(requireActivity()).registerReceiver(receive_refresh, new IntentFilter(Helper.RECEIVE_REFRESH_NOTIFICATIONS_ACTION)); requireActivity().registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION), android.content.Context.RECEIVER_NOT_EXPORTED);
requireActivity().registerReceiver(receive_refresh, new IntentFilter(Helper.RECEIVE_REFRESH_NOTIFICATIONS_ACTION), android.content.Context.RECEIVER_NOT_EXPORTED);
} else {
requireActivity().registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION));
requireActivity().registerReceiver(receive_refresh, new IntentFilter(Helper.RECEIVE_REFRESH_NOTIFICATIONS_ACTION));
}
return root; return root;
} }
@ -673,8 +679,8 @@ public class FragmentMastodonNotification extends Fragment implements Notificati
@Override @Override
public void onDestroyView() { public void onDestroyView() {
LocalBroadcastManager.getInstance(requireActivity()).unregisterReceiver(receive_action); requireActivity().unregisterReceiver(receive_action);
LocalBroadcastManager.getInstance(requireActivity()).unregisterReceiver(receive_refresh); requireActivity().unregisterReceiver(receive_refresh);
if (isAdded()) { if (isAdded()) {
storeMarker(); storeMarker();
} }

View file

@ -23,6 +23,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
@ -453,7 +454,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
} }
LocalBroadcastManager.getInstance(requireActivity()).registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
requireActivity().registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION), android.content.Context.RECEIVER_NOT_EXPORTED);
} else {
requireActivity().registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_STATUS_ACTION));
}
binding = FragmentPaginationBinding.inflate(inflater, container, false); binding = FragmentPaginationBinding.inflate(inflater, container, false);
return binding.getRoot(); return binding.getRoot();
} }
@ -836,7 +841,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
storeMarker(); storeMarker();
} }
try { try {
LocalBroadcastManager.getInstance(requireActivity()).unregisterReceiver(receive_action); requireActivity().unregisterReceiver(receive_action);
} catch (Exception ignored) { } catch (Exception ignored) {
} }
super.onDestroyView(); super.onDestroyView();

View file

@ -1591,12 +1591,16 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
} }
} }
}; };
getApplicationContext().registerReceiver(mPowerKeyReceiver, theFilter); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
registerReceiver(mPowerKeyReceiver, theFilter, android.content.Context.RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(mPowerKeyReceiver, theFilter);
}
} }
private void unregisterReceiver() { private void unregisterReceiver() {
if (mPowerKeyReceiver != null) { if (mPowerKeyReceiver != null) {
getApplicationContext().unregisterReceiver(mPowerKeyReceiver); unregisterReceiver(mPowerKeyReceiver);
mPowerKeyReceiver = null; mPowerKeyReceiver = null;
} }
} }

View file

@ -152,7 +152,7 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
if (!keepRemote) { if (!keepRemote) {
typeOfConnection = TypeOfConnection.NORMAL; typeOfConnection = TypeOfConnection.NORMAL;
} }
LocalBroadcastManager.getInstance(PeertubeMainActivity.this).unregisterReceiver(broadcast_data); unregisterReceiver(broadcast_data);
} }
@SuppressLint("ApplySharedPref") @SuppressLint("ApplySharedPref")
@ -162,9 +162,13 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
binding = super.binding; binding = super.binding;
LocalBroadcastManager.getInstance(PeertubeMainActivity.this).registerReceiver(
broadcast_data, new IntentFilter(app.fedilab.android.mastodon.helper.Helper.BROADCAST_DATA) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
); registerReceiver(broadcast_data, new IntentFilter(app.fedilab.android.mastodon.helper.Helper.BROADCAST_DATA), android.content.Context.RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(broadcast_data, new IntentFilter(app.fedilab.android.mastodon.helper.Helper.BROADCAST_DATA));
}
Intent intentActvity = getIntent(); Intent intentActvity = getIntent();
if (intentActvity != null) { if (intentActvity != null) {
Bundle extras = intentActvity.getExtras(); Bundle extras = intentActvity.getExtras();

View file

@ -51,7 +51,11 @@ public class RetrieveInfoService extends Service implements NetworkStateReceiver
super.onCreate(); super.onCreate();
networkStateReceiver = new NetworkStateReceiver(); networkStateReceiver = new NetworkStateReceiver();
networkStateReceiver.addListener(this); networkStateReceiver.addListener(this);
registerReceiver(networkStateReceiver, new IntentFilter(android.net.ConnectivityManager.CONNECTIVITY_ACTION)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
registerReceiver(networkStateReceiver, new IntentFilter(android.net.ConnectivityManager.CONNECTIVITY_ACTION), android.content.Context.RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(networkStateReceiver, new IntentFilter(android.net.ConnectivityManager.CONNECTIVITY_ACTION));
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID,
getString(R.string.notification_channel_name), getString(R.string.notification_channel_name),

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.fedilab.android"> >
<application android:name=".MainApplication"> <application android:name=".MainApplication">

View file

@ -18,6 +18,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
namespace 'com.smarteist.autoimageslider'
} }

View file

@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.smarteist.autoimageslider"> >
<application <application
android:allowBackup="true" android:allowBackup="true"

View file

@ -6,10 +6,10 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.3.1' classpath 'com.android.tools.build:gradle:8.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.7.5"
classpath 'com.google.gms:google-services:4.3.10' classpath 'com.google.gms:google-services:4.4.0'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
} }

View file

@ -17,6 +17,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
namespace 'com.jaredrummler.android.colorpicker'
} }

View file

@ -1 +1 @@
<manifest package="com.jaredrummler.android.colorpicker" /> <manifest />

View file

@ -16,4 +16,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# https://developer.android.com/topic/libraries/support-library/androidx-rn # https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX # Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false

View file

@ -1,6 +1,6 @@
#Wed Nov 03 09:29:30 CET 2021 #Wed Nov 03 09:29:30 CET 2021
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View file

@ -6,8 +6,6 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 8 minSdkVersion 8
targetSdkVersion 33 targetSdkVersion 33
versionCode 2
versionName "0.2"
} }
buildTypes { buildTypes {
release { release {
@ -15,6 +13,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
namespace 'de.timfreiheit.mathjax.android'
} }
dependencies { dependencies {

View file

@ -1,4 +1,4 @@
<manifest package="de.timfreiheit.mathjax.android"> <manifest>
<application /> <application />

View file

@ -23,6 +23,7 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
namespace 'com.github.stom79.mytransl'
} }
dependencies { dependencies {

View file

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="com.github.stom79.mytransl">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
</manifest> </manifest>

View file

@ -13,6 +13,7 @@ android {
minifyEnabled false minifyEnabled false
} }
} }
namespace 'com.kobakei.ratethisapp'
} }
dependencies { dependencies {

View file

@ -1,3 +1,3 @@
<manifest package="com.kobakei.ratethisapp"> <manifest>
</manifest> </manifest>

View file

@ -8,8 +8,6 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 33 targetSdkVersion 33
versionCode 3
versionName "1.0.12"
} }
buildTypes { buildTypes {
release { release {
@ -17,7 +15,8 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
lintOptions { namespace 'com.varunest.sparkbutton'
lint {
abortOnError false abortOnError false
} }
} }

View file

@ -1,4 +1,4 @@
<manifest package="com.varunest.sparkbutton"> <manifest>
<application /> <application />
</manifest> </manifest>