Skip to content

Commit

Permalink
Merge pull request #104 from woheller69/master
Browse files Browse the repository at this point in the history
Update to SDK34 / Android 14
Monochrome icon support
F-Droid Fastlane
  • Loading branch information
woheller69 authored Sep 16, 2024
2 parents 3fde888 + b93025c commit 6e7c13a
Show file tree
Hide file tree
Showing 35 changed files with 726 additions and 168 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Gradle
gradle.properties
.gradle
/build
/CalendarImportExport/build
Expand Down
21 changes: 7 additions & 14 deletions CalendarImportExport/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,23 @@ apply plugin: 'com.android.application'

android {

compileSdkVersion 29
buildToolsVersion '30.0.2'
compileSdk 34

defaultConfig {
minSdkVersion 14
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 29 // retain pre-Android 11 storage model at the moment
versionCode 62
versionName "2.7.5"
minSdk 14
targetSdk 34
versionCode 63
versionName "2.8.0"
}

dependencies {
implementation 'com.android.support:support-v4:28.0.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'org.mnode.ical4j:ical4j:1.0.8'
implementation 'backport-util-concurrent:backport-util-concurrent:3.1'
implementation 'commons-codec:commons-codec:1.10'
implementation 'commons-codec:commons-codec:1.15'
implementation 'commons-lang:commons-lang:2.6'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}

/* exclude duplicate files in our included libs */
packagingOptions {
exclude 'META-INF/LICENSE.txt'
Expand Down
8 changes: 6 additions & 2 deletions CalendarImportExport/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.INTERNET" />

<application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.sufficientlysecure.ical.ui;

import static android.provider.Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION;
import java.io.File;
import java.io.InputStream;
import java.io.IOException;
Expand All @@ -28,6 +29,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.UUID;

import net.fortuna.ical4j.data.CalendarBuilder;
Expand All @@ -38,6 +40,7 @@
import org.apache.commons.codec.binary.Base64;

import org.sufficientlysecure.ical.AndroidCalendar;
import org.sufficientlysecure.ical.BuildConfig;
import org.sufficientlysecure.ical.ProcessVEvent;
import org.sufficientlysecure.ical.SaveCalendar;
import org.sufficientlysecure.ical.Settings;
Expand All @@ -49,7 +52,6 @@
import android.Manifest;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
Expand All @@ -61,9 +63,9 @@
import android.os.Bundle;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentActivity;
import android.support.v4.content.ContextCompat;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.FragmentActivity;
import androidx.core.content.ContextCompat;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.Menu;
Expand All @@ -85,13 +87,7 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen
public static final String EXTRA_CALENDAR_ID = "calendarId";

private static final int MY_PERMISSIONS_REQUEST = 1;
private static final String[] MY_PERMISSIONS = new String[] {
Manifest.permission.GET_ACCOUNTS,
Manifest.permission.READ_CALENDAR,
Manifest.permission.WRITE_CALENDAR,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
};
private static String[] MY_PERMISSIONS;

private Settings mSettings;

Expand Down Expand Up @@ -135,6 +131,27 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

if (Build.VERSION.SDK_INT <= 29){
MY_PERMISSIONS = new String[] {
Manifest.permission.GET_ACCOUNTS,
Manifest.permission.READ_CALENDAR,
Manifest.permission.WRITE_CALENDAR,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
};
} else {
MY_PERMISSIONS = new String[] {
Manifest.permission.GET_ACCOUNTS,
Manifest.permission.READ_CALENDAR,
Manifest.permission.WRITE_CALENDAR
};
if (!Environment.isExternalStorageManager()) {
Intent intent = new Intent(ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, Uri.parse("package:" + BuildConfig.APPLICATION_ID));
startActivity(intent);
}
}


setContentView(R.layout.main);
mIntentCalendarId = NO_CALENDAR;
mInitialCreated = true;
Expand All @@ -144,7 +161,7 @@ protected void onCreate(Bundle savedInstanceState) {
mCalendarUpdateReciever = new BroadcastReceiver() {
public void onReceive(final Context context, final Intent intent) {
Log.d(TAG, "Received broadcast: " + intent.getAction());
if (intent.getAction() == mCalendarUpdateFilter.getAction(0))
if (Objects.equals(intent.getAction(), mCalendarUpdateFilter.getAction(0)))
onExternalCalendarChanged();
}
};
Expand Down Expand Up @@ -182,6 +199,7 @@ private boolean hasPermissions() {
public void onRequestPermissionsResult(int requestCode,
String permissions[],
int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode) {
case MY_PERMISSIONS_REQUEST: {
boolean allGranted = false;
Expand Down Expand Up @@ -424,7 +442,11 @@ protected void onResume() {
else
onExternalCalendarChanged();

registerReceiver(mCalendarUpdateReciever, mCalendarUpdateFilter);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
registerReceiver(mCalendarUpdateReciever, mCalendarUpdateFilter, Context.RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(mCalendarUpdateReciever, mCalendarUpdateFilter);
}
}

protected void onPause() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import android.content.Context;
import android.preference.DialogPreference;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;
import androidx.annotation.NonNull;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager.LayoutParams;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<vector android:height="108dp" android:viewportHeight="9001"
android:viewportWidth="9001" android:width="108dp" xmlns:android="http://schemas.android.com/apk/res/android">

<path android:fillColor="#79B149" android:fillType="evenOdd"
android:pathData="M4028,4709L3520,4709 3520,4058 4536,4058 4536,4709 4028,4709Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#C8C8C8" android:fillType="evenOdd"
android:pathData="M2752,2440C2590,2440 2460,2571 2460,2733L2460,3154 6576,3154 6576,2733C6576,2571 6446,2440 6285,2440L2752,2440Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#FFFFFF" android:fillType="evenOdd"
android:pathData="M3570,2803C3570,2832 3562,2860 3548,2885 3533,2910 3514,2930 3489,2945 3464,2959 3436,2967 3407,2967 3378,2967 3350,2959 3325,2945 3300,2930 3279,2910 3265,2885 3250,2860 3244,2832 3244,2803 3244,2775 3251,2746 3265,2722 3280,2697 3300,2676 3325,2662 3350,2647 3378,2640 3407,2640 3436,2640 3464,2647 3489,2662 3514,2676 3534,2697 3548,2722 3563,2746 3570,2775 3570,2803Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#00000000" android:fillType="evenOdd"
android:pathData="M3570,2803C3570,2831 3562,2860 3548,2885 3533,2910 3514,2930 3489,2945 3464,2959 3436,2967 3407,2967 3378,2967 3350,2959 3325,2945 3300,2930 3279,2910 3265,2885 3250,2860 3244,2831 3244,2803 3244,2774 3250,2746 3265,2722 3279,2697 3300,2676 3325,2662 3350,2647 3378,2640 3407,2640 3436,2640 3464,2647 3489,2662 3514,2676 3534,2697 3548,2722 3563,2746 3570,2774 3570,2803Z"
android:strokeColor="#FFFFFF" android:strokeLineJoin="miter" android:strokeWidth="8"/>
<path android:fillColor="#FFFFFF" android:fillType="evenOdd"
android:pathData="M5848,2780C5848,2809 5841,2837 5826,2862 5812,2887 5791,2908 5766,2922 5741,2936 5713,2944 5684,2944 5656,2944 5628,2936 5603,2922 5579,2908 5558,2887 5543,2862 5529,2837 5521,2809 5521,2780 5521,2752 5528,2723 5543,2699 5557,2674 5579,2653 5603,2639 5628,2624 5656,2617 5684,2617 5713,2617 5741,2624 5766,2639 5791,2653 5811,2674 5826,2699 5840,2723 5848,2752 5848,2780Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#00000000" android:fillType="evenOdd"
android:pathData="M5848,2780C5848,2808 5841,2837 5826,2862 5812,2887 5791,2908 5766,2922 5741,2936 5713,2944 5684,2944 5656,2944 5628,2936 5603,2922 5579,2908 5558,2887 5543,2862 5529,2837 5521,2808 5521,2780 5521,2751 5529,2723 5543,2699 5558,2674 5579,2653 5603,2639 5628,2624 5656,2617 5684,2617 5713,2617 5741,2624 5766,2639 5791,2653 5812,2674 5826,2699 5841,2723 5848,2751 5848,2780Z"
android:strokeColor="#FFFFFF" android:strokeLineJoin="miter" android:strokeWidth="8"/>
<path android:fillColor="#8BC34A" android:fillType="evenOdd"
android:pathData="M2463,3144L2463,6109C2463,6270 2592,6400 2753,6400L6285,6400C6446,6400 6576,6270 6576,6109L6576,3144 2463,3144Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#689F38" android:fillType="evenOdd"
android:pathData="M2991,5207L2462,5207 2462,3144 3519,3144 3519,5207 2991,5207Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#4CAF50" android:fillType="evenOdd"
android:pathData="M4031,6400L3520,6400 3520,4706 4542,4706 4542,6400 4031,6400Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#38823C" android:fillType="evenOdd"
android:pathData="M4031,4062L3520,4062 3520,3144 4542,3144 4542,4062 4031,4062Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#689F38" android:fillType="evenOdd"
android:pathData="M5043,6400L4532,6400 4532,4418 5555,4418 5555,6400 5043,6400Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#4CAF50" android:fillType="evenOdd"
android:pathData="M6064,5598L5551,5598 5551,3905 6578,3905 6578,5598 6064,5598Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#3D8B3F" android:fillType="evenOdd"
android:pathData="M5043,4456L4532,4456 4532,3144 5555,3144 5555,4456 5043,4456Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#276528" android:fillType="evenOdd"
android:pathData="M6791,5612C6791,5796 6742,5977 6650,6136 6558,6296 6426,6427 6267,6519 6108,6611 5927,6660 5743,6660 5559,6660 5378,6611 5219,6519 5060,6427 4928,6296 4836,6136 4744,5977 4695,5796 4695,5612 4695,5428 4744,5247 4836,5088 4928,4929 5060,4797 5219,4705 5378,4614 5559,4564 5743,4564 5927,4564 6108,4614 6267,4705 6426,4797 6558,4929 6650,5088 6742,5247 6791,5428 6791,5612Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#FFFFFF" android:fillType="evenOdd"
android:pathData="M5772,5563L5514,5563 5256,5563 5385,5380 5514,5197 5643,5380 5772,5563Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#FFFFFF" android:fillType="evenOdd"
android:pathData="M5514,6037L5424,6037 5424,5501 5604,5501 5604,6037 5514,6037Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#FFFFFF" android:fillType="evenOdd"
android:pathData="M6233,5668L5975,5668 5716,5668 5846,5850 5975,6033 6104,5850 6233,5668Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
<path android:fillColor="#FFFFFF" android:fillType="evenOdd"
android:pathData="M5975,5193L5884,5193 5884,5729 6065,5729 6065,5193 5975,5193Z"
android:strokeColor="#00000000" android:strokeLineJoin="round" android:strokeWidth="28.222"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="10751"
android:viewportHeight="10751">

<path
android:pathData="M3604,3395C3442,3395 3312,3526 3312,3688L3312,4109 7428,4109 7428,3688C7428,3526 7298,3395 7137,3395L3604,3395Z"
android:strokeLineJoin="miter"
android:strokeWidth="212"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M4422,3758C4422,3787 4414,3815 4400,3840 4385,3865 4366,3885 4341,3900 4316,3914 4288,3922 4259,3922 4230,3922 4202,3914 4177,3900 4152,3885 4131,3865 4117,3840 4102,3815 4096,3787 4096,3758 4096,3730 4103,3701 4117,3677 4132,3652 4152,3631 4177,3617 4202,3602 4230,3595 4259,3595 4288,3595 4316,3602 4341,3617 4366,3631 4386,3652 4400,3677 4415,3701 4422,3730 4422,3758Z"
android:strokeLineJoin="round"
android:strokeWidth="28.222"
android:fillColor="#FFFFFF"
android:strokeColor="#00000000"
android:fillType="evenOdd"/>
<path
android:pathData="M4422,3758C4422,3786 4414,3815 4400,3840 4385,3865 4366,3885 4341,3900 4316,3914 4288,3922 4259,3922 4230,3922 4202,3914 4177,3900 4152,3885 4131,3865 4117,3840 4102,3815 4096,3786 4096,3758 4096,3729 4102,3701 4117,3677 4131,3652 4152,3631 4177,3617 4202,3602 4230,3595 4259,3595 4288,3595 4316,3602 4341,3617 4366,3631 4386,3652 4400,3677 4415,3701 4422,3729 4422,3758Z"
android:strokeLineJoin="miter"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M6700,3735C6700,3764 6692,3792 6678,3817 6663,3842 6643,3863 6618,3877 6593,3891 6564,3899 6536,3899 6507,3899 6479,3891 6455,3877 6430,3863 6409,3842 6395,3817 6380,3792 6373,3764 6373,3735 6373,3707 6380,3678 6395,3654 6409,3629 6430,3608 6455,3594 6479,3579 6508,3572 6536,3572 6565,3572 6593,3579 6618,3594 6643,3608 6663,3629 6678,3654 6692,3678 6700,3707 6700,3735Z"
android:strokeLineJoin="round"
android:strokeWidth="28.222"
android:fillColor="#FFFFFF"
android:strokeColor="#00000000"
android:fillType="evenOdd"/>
<path
android:pathData="M6700,3735C6700,3763 6692,3792 6678,3817 6663,3842 6643,3863 6618,3877 6593,3891 6564,3899 6536,3899 6507,3899 6479,3891 6455,3877 6430,3863 6409,3842 6395,3817 6380,3792 6373,3763 6373,3735 6373,3706 6380,3678 6395,3654 6409,3629 6430,3608 6455,3594 6479,3579 6507,3572 6536,3572 6564,3572 6593,3579 6618,3594 6643,3608 6663,3629 6678,3654 6692,3678 6700,3706 6700,3735Z"
android:strokeLineJoin="miter"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M3315,4099L3315,7064C3315,7225 3444,7355 3605,7355L7137,7355C7298,7355 7428,7225 7428,7064L7428,4099 3315,4099Z"
android:strokeLineJoin="miter"
android:strokeWidth="212"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M4883,7355L4372,7355 4372,4100 5395,4100 5395,7355 4883,7355Z"
android:strokeLineJoin="miter"
android:strokeWidth="159"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M7439,6291C7439,6475 7390,6655 7298,6815 7206,6974 7074,7106 6915,7198 6756,7290 6575,7339 6391,7339 6207,7339 6026,7290 5867,7198 5708,7106 5576,6974 5484,6815 5392,6655 5343,6475 5343,6291 5343,6107 5392,5926 5484,5767 5576,5608 5708,5475 5867,5384 6026,5292 6207,5243 6391,5243 6575,5243 6756,5292 6915,5384 7074,5475 7206,5608 7298,5767 7390,5926 7439,6107 7439,6291Z"
android:strokeLineJoin="miter"
android:strokeWidth="212"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"
android:fillType="evenOdd"/>
<path
android:pathData="M7096,6432L6781,6432 6464,6432 6623,6672 6781,6912 6938,6672 7096,6432Z"
android:strokeLineJoin="round"
android:strokeWidth="28.222"
android:fillColor="#FFFFFF"
android:strokeColor="#00000000"
android:fillType="evenOdd"/>
<path
android:pathData="M6781,5806L6670,5806 6670,6512 6891,6512 6891,5806 6781,5806Z"
android:strokeLineJoin="round"
android:strokeWidth="28.222"
android:fillColor="#FFFFFF"
android:strokeColor="#00000000"
android:fillType="evenOdd"/>
<path
android:pathData="M6331,6287L6016,6287 5699,6287 5858,6047 6016,5807 6173,6047 6331,6287Z"
android:strokeLineJoin="round"
android:strokeWidth="28.222"
android:fillColor="#FFFFFF"
android:strokeColor="#00000000"
android:fillType="evenOdd"/>
<path
android:pathData="M6016,6913L5905,6913 5905,6207 6126,6207 6126,6913 6016,6913Z"
android:strokeLineJoin="round"
android:strokeWidth="28.222"
android:fillColor="#FFFFFF"
android:strokeColor="#00000000"
android:fillType="evenOdd"/>
<path
android:pathData="M6404,4205L6404,5205"
android:strokeLineJoin="round"
android:strokeWidth="159"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"
android:fillType="evenOdd"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_monochrome"/>
<background android:drawable="@android:color/white"/>
</adaptive-icon>
Binary file added Resources/ic_launcher.odg
Binary file not shown.
Loading

0 comments on commit 6e7c13a

Please sign in to comment.