Compare commits

...

3 Commits

Author SHA1 Message Date
a68a83940d chore(release): 1.22.1-dev.2 [skip ci]
## [1.22.1-dev.2](https://github.com/ReVanced/revanced-manager/compare/v1.22.1-dev.1...v1.22.1-dev.2) (2024-09-19)

### Bug Fixes

* Get changelogs for alternative sources ([#1766](https://github.com/ReVanced/revanced-manager/issues/1766)) ([c729842](c7298424e5))
* Resolve EACCESS error in special cases ([#2135](https://github.com/ReVanced/revanced-manager/issues/2135)) ([1f95767](1f95767aeb))
2024-09-19 23:07:33 +00:00
1f95767aeb fix: Resolve EACCESS error in special cases (#2135)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2024-09-20 00:59:27 +02:00
c7298424e5 fix: Get changelogs for alternative sources (#1766) 2024-09-20 00:57:07 +02:00
4 changed files with 19 additions and 7 deletions

View File

@ -219,6 +219,9 @@ class MainActivity : FlutterActivity() {
keystorePassword: String
) {
val inFile = File(inFilePath)
// Necessary because the file is copied from a nonwriteable location.
inFile.setWritable(true)
inFile.setReadable(true)
val outFile = File(outFilePath)
val integrations = File(integrationsPath)
val keyStoreFile = File(keyStoreFilePath)

View File

@ -69,7 +69,8 @@ class ManagerAPI {
}
// Migrate to new API URL if not done yet as the old one is sunset.
final bool hasMigratedToNewApi = _prefs.getBool('migratedToNewApiUrl') ?? false;
final bool hasMigratedToNewApi =
_prefs.getBool('migratedToNewApiUrl') ?? false;
if (!hasMigratedToNewApi) {
final String apiUrl = getApiUrl().toLowerCase();
if (apiUrl.contains('releases.revanced.app')) {
@ -78,11 +79,14 @@ class ManagerAPI {
}
}
final bool hasMigratedToAlternativeSource = _prefs.getBool('migratedToAlternativeSource') ?? false;
final bool hasMigratedToAlternativeSource =
_prefs.getBool('migratedToAlternativeSource') ?? false;
if (!hasMigratedToAlternativeSource) {
final String patchesRepo = getPatchesRepo();
final String integrationsRepo = getIntegrationsRepo();
final bool usingAlternativeSources = patchesRepo.toLowerCase() != defaultPatchesRepo || integrationsRepo.toLowerCase() != defaultIntegrationsRepo;
final bool usingAlternativeSources =
patchesRepo.toLowerCase() != defaultPatchesRepo ||
integrationsRepo.toLowerCase() != defaultIntegrationsRepo;
_prefs.setBool('useAlternativeSources', usingAlternativeSources);
_prefs.setBool('migratedToAlternativeSource', true);
}
@ -119,6 +123,9 @@ class ManagerAPI {
}
String getPatchesRepo() {
if (!isUsingAlternativeSources()) {
return defaultPatchesRepo;
}
return _prefs.getString('patchesRepo') ?? defaultPatchesRepo;
}
@ -452,7 +459,7 @@ class ManagerAPI {
Future<File?> downloadPatches() async {
try {
final String repoName = !isUsingAlternativeSources() ? defaultPatchesRepo : getPatchesRepo();
final String repoName = getPatchesRepo();
final String currentVersion = await getCurrentPatchesVersion();
final String url = getPatchesDownloadURL();
return await _githubAPI.getReleaseFile(
@ -471,7 +478,9 @@ class ManagerAPI {
Future<File?> downloadIntegrations() async {
try {
final String repoName = !isUsingAlternativeSources() ? defaultIntegrationsRepo : getIntegrationsRepo();
final String repoName = !isUsingAlternativeSources()
? defaultIntegrationsRepo
: getIntegrationsRepo();
final String currentVersion = await getCurrentIntegrationsVersion();
final String url = getIntegrationsDownloadURL();
return await _githubAPI.getReleaseFile(

View File

@ -484,7 +484,7 @@ class HomeViewModel extends BaseViewModel {
Future<String?> getLatestPatchesChangelog() async {
final release =
await _githubAPI.getLatestRelease(_managerAPI.defaultPatchesRepo);
await _githubAPI.getLatestRelease(_managerAPI.getPatchesRepo());
return release?['body'];
}

View File

@ -4,7 +4,7 @@ homepage: https://github.com/ReVanced/revanced-manager
publish_to: 'none'
version: 1.22.1-dev.1+101800039
version: 1.22.1-dev.2+101800040
environment:
sdk: '>=3.0.0 <4.0.0'