Skip to content

Commit

Permalink
chore: merge dev to main (ReVanced#857)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aunali321 authored May 8, 2023
2 parents a290791 + 31fc7b7 commit 289c6cd
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 79 deletions.
6 changes: 1 addition & 5 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,12 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

// ReVanced
implementation "app.revanced:revanced-patcher:7.0.0"
implementation "app.revanced:revanced-patcher:7.1.1"

// Signing & aligning
implementation("org.bouncycastle:bcpkix-jdk15on:1.70")
implementation("com.android.tools.build:apksig:7.2.2")

// MicroG cronet
implementation("org.microg:cronet-common:$cronetVersion")
implementation("org.microg:cronet-native:$cronetVersion")

// Core libraries
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

Expand Down
1 change: 0 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
buildscript {
ext.cronetVersion = '102.5005.125'
ext.kotlin_version = '1.7.10'
repositories {
google()
Expand Down
25 changes: 3 additions & 22 deletions lib/services/github_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import 'package:dio_cache_interceptor/dio_cache_interceptor.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:injectable/injectable.dart';
import 'package:native_dio_adapter/native_dio_adapter.dart';
import 'package:revanced_manager/models/patch.dart';

@lazySingleton
class GithubAPI {
late Dio _dio = Dio();

final _cacheOptions = CacheOptions(
store: MemCacheStore(),
maxStale: const Duration(days: 1),
Expand All @@ -33,22 +32,6 @@ class GithubAPI {

Future<void> initialize(String repoUrl) async {
try {
if (Platform.isIOS || Platform.isMacOS || Platform.isAndroid) {
final CronetEngine androidCronetEngine = await CronetEngine.build(
userAgent: 'ReVanced Manager',
enableBrotli: true,
enableQuic: true,
);
_dio.httpClientAdapter =
NativeAdapter(androidCronetEngine: androidCronetEngine);

_dio = Dio(
BaseOptions(
baseUrl: repoUrl,
),
);
}

_dio = Dio(
BaseOptions(
baseUrl: repoUrl,
Expand Down Expand Up @@ -126,8 +109,7 @@ class GithubAPI {
String repoName,
) async {
try {
final Map<String, dynamic>? release =
await getLatestRelease(repoName);
final Map<String, dynamic>? release = await getLatestRelease(repoName);
if (release != null) {
final Map<String, dynamic>? asset =
(release['assets'] as List<dynamic>).firstWhereOrNull(
Expand Down Expand Up @@ -166,8 +148,7 @@ class GithubAPI {

Future<String> getLastestReleaseVersion(String repoName) async {
try {
final Map<String, dynamic>? release =
await getLatestRelease(repoName);
final Map<String, dynamic>? release = await getLatestRelease(repoName);
if (release != null) {
return release['tag_name'];
} else {
Expand Down
36 changes: 6 additions & 30 deletions lib/services/revanced_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import 'package:dio_cache_interceptor/dio_cache_interceptor.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:injectable/injectable.dart';
import 'package:native_dio_adapter/native_dio_adapter.dart';
import 'package:revanced_manager/models/patch.dart';
import 'package:revanced_manager/utils/check_for_gms.dart';
import 'package:timeago/timeago.dart';

@lazySingleton
Expand All @@ -25,34 +23,12 @@ class RevancedAPI {

Future<void> initialize(String apiUrl) async {
try {
final bool isGMSInstalled = await checkForGMS();

if (!isGMSInstalled) {
_dio = Dio(
BaseOptions(
baseUrl: apiUrl,
),
);
log('ReVanced API: Using default engine + $isGMSInstalled');
} else {
if (Platform.isIOS || Platform.isMacOS || Platform.isAndroid) {
final CronetEngine androidCronetEngine = await CronetEngine.build(
userAgent: 'ReVanced Manager',
enableBrotli: true,
enableQuic: true,
);
_dio.httpClientAdapter =
NativeAdapter(androidCronetEngine: androidCronetEngine);

_dio = Dio(
BaseOptions(
baseUrl: apiUrl,
),
);
}

log('ReVanced API: Using CronetEngine + $isGMSInstalled');
}
_dio = Dio(
BaseOptions(
baseUrl: apiUrl,
),
);

_dio.interceptors.add(DioCacheInterceptor(options: _cacheOptions));
} on Exception catch (e) {
if (kDebugMode) {
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/views/app_selector/app_selector_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class _AppSelectorViewState extends State<AppSelectorView> {
child: model.noApps
? Center(
child: I18nText(
'appSelectorView.noApps',
'appSelectorView.noAppsLabel',
child: Text(
'',
style: TextStyle(
Expand Down
1 change: 0 additions & 1 deletion lib/ui/views/app_selector/app_selector_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ class AppSelectorViewModel extends BaseViewModel {
isFilled: false,
onPressed: () {
Navigator.pop(context);
Navigator.pop(context);
},
label: Row(
mainAxisAlignment: MainAxisAlignment.center,
Expand Down
12 changes: 5 additions & 7 deletions lib/ui/views/patcher/patcher_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,11 @@ class PatcherViewModel extends BaseViewModel {
}

Future<void> showArmv7WarningDialog(BuildContext context) async {
final bool armv7 = await AboutInfo.getInfo().then(
(info) =>
info['arch'] != null &&
info['arch']!.contains('armeabi-v7a') &&
!info['arch']!.contains('arm64-v8a'),
);

final bool armv7 = await AboutInfo.getInfo().then((info) {
final List<String> archs = info['arch'];
final supportedAbis = ['arm64-v8a', 'x86', 'x86_64'];
return !archs.any((arch) => supportedAbis.contains(arch));
});
if (context.mounted && armv7) {
return showDialog(
context: context,
Expand Down
10 changes: 0 additions & 10 deletions lib/utils/check_for_gms.dart

This file was deleted.

3 changes: 1 addition & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager

publish_to: 'none'

version: 1.0.0+100000000
version: 1.1.0+100100000

environment:
sdk: ">=2.17.5 <3.0.0"
Expand Down Expand Up @@ -56,7 +56,6 @@ dependencies:
package_info_plus: ^3.0.3
path_provider: ^2.0.14
permission_handler: ^10.2.0
native_dio_adapter: ^0.1.0
pull_to_refresh: ^2.0.0
root:
git:
Expand Down

0 comments on commit 289c6cd

Please sign in to comment.