Skip to content

Commit 76a8fe0

Browse files
authored
Merge branch 'newhinton:master' into master
2 parents 372d331 + d12b0f9 commit 76a8fe0

File tree

60 files changed

+1940
-1953
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1940
-1953
lines changed

app/build.gradle

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ android {
1717
minSdkVersion 23
1818
compileSdk 34
1919
targetSdkVersion 34
20-
versionCode 340 // last digit is reserved for ABI, only ever end on 0!
21-
versionName '2.4.5'
20+
versionCode 370 // last digit is reserved for ABI, only ever end on 0!
21+
versionName '2.5.2'
2222
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2323
buildConfigField "java.lang.String", "CLI", System.getenv('RCX_BUILD_CLI') ? System.getenv('RCX_BUILD_CLI') : "\"c03129b6-b09f-9cb4-8fcd-7f143b8f94ef\""
2424
buildConfigField "java.lang.String", "VCP_AUTHORITY", "\"" + applicationId + ".vcp\"";
@@ -52,6 +52,7 @@ android {
5252
appIcon: "@mipmap/ic_launcher",
5353
appIconRound: "@mipmap/ic_launcher_round"
5454
]
55+
signingConfig signingConfigs.release
5556
}
5657
}
5758

@@ -136,6 +137,14 @@ android {
136137
}
137138

138139
namespace 'ca.pkay.rcloneexplorer'
140+
141+
// https://android.izzysoft.de/articles/named/iod-scan-apkchecks#blobs
142+
dependenciesInfo {
143+
// Disables dependency metadata when building APKs.
144+
includeInApk = false
145+
// Disables dependency metadata when building Android App Bundles.
146+
includeInBundle = false
147+
}
139148
}
140149

141150
repositories {
@@ -167,6 +176,7 @@ dependencies {
167176
// Thumbnails
168177
implementation 'com.github.bumptech.glide:glide:4.16.0'
169178
implementation 'androidx.work:work-runtime-ktx:2.9.0'
179+
implementation 'androidx.preference:preference:1.2.1'
170180
annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'
171181
// REST Client
172182
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
@@ -195,4 +205,7 @@ dependencies {
195205
// Splash screen
196206
implementation("androidx.core:core-splashscreen:1.0.1")
197207

208+
//Updates
209+
implementation 'com.github.Sharkaboi:AppUpdateChecker:v1.0.5'
210+
implementation("com.google.android.play:app-update-ktx:2.1.0")
198211
}

app/src/main/AndroidManifest.xml

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,27 @@
2121
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
2222
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
2323

24+
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
25+
<uses-permission android:name="android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION" />
26+
27+
28+
2429
<application
2530
android:allowBackup="true"
2631
android:icon="${appIcon}"
27-
android:roundIcon="${appIconRound}"
2832
android:label="@string/app_name"
2933
android:networkSecurityConfig="@xml/network_security_config"
3034
android:requestLegacyExternalStorage="true"
35+
android:roundIcon="${appIconRound}"
3136
android:supportsRtl="true"
3237
android:theme="@style/AppTheme"
3338
tools:ignore="GoogleAppIndexingWarning,MissingTvBanner"
3439
tools:targetApi="33">
40+
<receiver
41+
android:name="de.felixnuesse.extract.updates.UpdateUserchoiceReceiver"
42+
android:enabled="true"
43+
android:exported="true" />
44+
3545
<activity android:name=".Activities.OnboardingActivity" />
3646
<activity
3747
android:name=".Activities.MainActivity"
@@ -69,25 +79,22 @@
6979
</intent-filter>
7080
</provider>
7181

72-
<service android:name=".Services.StreamingService"
82+
<service
83+
android:name=".Services.StreamingService"
7384
android:foregroundServiceType="dataSync" />
74-
<service android:name=".Services.ThumbnailsLoadingService"
85+
<service
86+
android:name=".Services.ThumbnailsLoadingService"
7587
android:foregroundServiceType="dataSync" />
7688
<service
7789
android:name=".Services.TriggerService"
78-
android:foregroundServiceType="dataSync"
79-
android:exported="true" />
90+
android:exported="true"
91+
android:foregroundServiceType="dataSync" />
8092
<service
8193
android:name=".Services.RcdService"
82-
android:foregroundServiceType="dataSync" />
83-
84-
<!-- Used to expose tasks to other apps, no other functionality-->
94+
android:foregroundServiceType="dataSync" /> <!-- Used to expose tasks to other apps, no other functionality -->
8595
<service
8696
android:name=".Services.SyncService"
87-
android:exported="true">
88-
</service>
89-
90-
<!-- This is a default service required for any and all Workers. Do not remove.-->
97+
android:exported="true" /> <!-- This is a default service required for any and all Workers. Do not remove. -->
9198
<service
9299
android:name="androidx.work.impl.foreground.SystemForegroundService"
93100
android:foregroundServiceType="dataSync" />
@@ -106,8 +113,8 @@
106113
android:exported="true" />
107114
<receiver
108115
android:name=".BroadcastReceivers.ClearReportBroadcastReciever"
109-
android:exported="false">
110-
</receiver>
116+
android:exported="false" />
117+
111118
<provider
112119
android:name="androidx.core.content.FileProvider"
113120
android:authorities="${applicationId}.fileprovider"
@@ -209,9 +216,7 @@
209216
<activity
210217
android:name=".Activities.TriggerActivity"
211218
android:label="@string/title_activity_trigger"
212-
android:theme="@style/AppTheme.NoActionBar" />
213-
214-
<!-- Auto Language Generation -->
219+
android:theme="@style/AppTheme.NoActionBar" /> <!-- Auto Language Generation -->
215220
<service
216221
android:name="androidx.appcompat.app.AppLocalesMetadataHolderService"
217222
android:enabled="false"
@@ -221,6 +226,15 @@
221226
android:value="true" />
222227
</service>
223228

229+
<provider
230+
android:name="androidx.core.content.FileProvider"
231+
android:authorities="${applicationId}.fileprovider"
232+
android:exported="false"
233+
android:grantUriPermissions="true">
234+
<meta-data
235+
android:name="android.support.FILE_PROVIDER_PATHS"
236+
android:resource="@xml/paths"/>
237+
</provider>
224238

225239
</application>
226240

app/src/main/java/ca/pkay/rcloneexplorer/Activities/AboutActivity.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,4 @@ private void openOldMaintainerGithubLink() {
106106
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.github_maintainer_url)));
107107
tryStartActivity(this, browserIntent);
108108
}
109-
110-
private void openReleaseLink() {
111-
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.app_latest_release_url)));
112-
tryStartActivity(this, browserIntent);
113-
}
114109
}

app/src/main/java/ca/pkay/rcloneexplorer/Activities/MainActivity.java

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package ca.pkay.rcloneexplorer.Activities;
22

3-
import static android.provider.Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM;
43
import static ca.pkay.rcloneexplorer.util.ActivityHelper.tryStartActivityForResult;
54

65
import android.Manifest;
@@ -10,7 +9,6 @@
109
import android.content.Context;
1110
import android.content.Intent;
1211
import android.content.SharedPreferences;
13-
import android.content.pm.PackageManager;
1412
import android.net.Uri;
1513
import android.os.AsyncTask;
1614
import android.os.Build;
@@ -20,7 +18,6 @@
2018
import android.os.storage.StorageVolume;
2119
import android.text.InputType;
2220
import android.text.TextUtils;
23-
import android.util.Log;
2421
import android.view.Menu;
2522
import android.view.MenuItem;
2623
import android.view.SubMenu;
@@ -29,12 +26,10 @@
2926

3027
import androidx.annotation.NonNull;
3128
import androidx.annotation.Nullable;
32-
import androidx.annotation.RequiresApi;
3329
import androidx.appcompat.app.ActionBar;
3430
import androidx.appcompat.app.AlertDialog;
3531
import androidx.appcompat.app.AppCompatActivity;
3632
import androidx.appcompat.widget.Toolbar;
37-
import androidx.core.content.ContextCompat;
3833
import androidx.core.view.GravityCompat;
3934
import androidx.drawerlayout.widget.DrawerLayout;
4035
import androidx.fragment.app.Fragment;
@@ -49,7 +44,6 @@
4944

5045
import java.io.File;
5146
import java.io.IOException;
52-
import java.net.URLConnection;
5347
import java.text.SimpleDateFormat;
5448
import java.util.ArrayList;
5549
import java.util.Arrays;
@@ -81,11 +75,11 @@
8175
import ca.pkay.rcloneexplorer.RuntimeConfiguration;
8276
import ca.pkay.rcloneexplorer.Services.StreamingService;
8377
import ca.pkay.rcloneexplorer.Services.TriggerService;
84-
import ca.pkay.rcloneexplorer.pkg.PackageUpdate;
8578
import ca.pkay.rcloneexplorer.util.ActivityHelper;
8679
import ca.pkay.rcloneexplorer.util.FLog;
8780
import ca.pkay.rcloneexplorer.util.PermissionManager;
8881
import ca.pkay.rcloneexplorer.util.SharedPreferencesUtil;
82+
import de.felixnuesse.extract.updates.UpdateChecker;
8983
import es.dmoral.toasty.Toasty;
9084
import java9.util.stream.Stream;
9185

@@ -119,12 +113,14 @@ protected void onCreate(Bundle savedInstanceState) {
119113

120114
ActivityHelper.applyTheme(this);
121115

122-
if(!(new PermissionManager(this)).hasAllRequiredPermissions()) {
116+
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
117+
boolean allPermissionsGranted = (new PermissionManager(this)).hasAllRequiredPermissions();
118+
boolean completedIntroOnce = OnboardingActivity.Companion.completedIntro(this);
119+
if(!allPermissionsGranted || !completedIntroOnce) {
123120
startActivity(new Intent(this, OnboardingActivity.class));
124121
finish();
125122
}
126123

127-
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
128124

129125
context = this;
130126
drawerPinnedRemoteIds = new HashMap<>();
@@ -146,22 +142,6 @@ protected void onCreate(Bundle savedInstanceState) {
146142

147143
findViewById(R.id.locked_config_btn).setOnClickListener(v -> askForConfigPassword());
148144

149-
boolean appUpdates = sharedPreferences.getBoolean(getString(R.string.pref_key_app_updates), true);
150-
if (appUpdates) {
151-
// Google Play and F-Droid have their own update mechanisms
152-
// => do not check for updates
153-
PackageManager packageManager = getPackageManager();
154-
if ("com.android.vending".equals(packageManager.getInstallerPackageName(getPackageName()))
155-
|| BuildConfig.DEBUG) {
156-
FLog.d(TAG, "Installed via Google Play, not checking for updates");
157-
} else if ("oss".equals(BuildConfig.FLAVOR)){
158-
FLog.d(TAG, "OSS flavor, not checking for updates");
159-
} else {
160-
PackageUpdate packageUpdate = new PackageUpdate(this);
161-
packageUpdate.checkForUpdate(false);
162-
}
163-
}
164-
165145
Intent intent = getIntent();
166146
Bundle bundle = intent.getExtras();
167147

@@ -235,6 +215,8 @@ protected void onCreate(Bundle savedInstanceState) {
235215
updatePermissionFragmentVisibility();
236216
TriggerService triggerService = new TriggerService(context);
237217
triggerService.queueTrigger();
218+
219+
(new UpdateChecker(this)).schedule();
238220
}
239221

240222
@Override

0 commit comments

Comments
 (0)