Compare commits

...

6 Commits

Author SHA1 Message Date
oSumAtrIX
68ce751745 build: bump version to v0.0.27 2022-10-01 02:15:47 +02:00
oSumAtrIX
74ff64d41a chore: bump patcher dependency version to v5.1.2 2022-10-01 02:15:08 +02:00
Ushie
6d45ccecc2 build: Bump version to v0.0.27 2022-09-30 21:38:15 +03:00
Ushie
5418c36716 feat: use patcher for resourcePatch detection (#337)
Co-authored-by: Aunali321 <aunvakil.aa@gmail.com>
2022-09-30 21:36:39 +03:00
Aunali321
ca0657e8f9 feat: decrease cache duration of patches and integrations. 2022-09-28 22:26:54 +05:30
Canny
a5511c2a2c feat: update unsupported button title 2022-09-26 23:36:17 +03:00
7 changed files with 21 additions and 23 deletions

View File

@@ -71,7 +71,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// ReVanced // ReVanced
implementation "app.revanced:revanced-patcher:5.1.0" implementation "app.revanced:revanced-patcher:5.1.2"
// Signing & aligning // Signing & aligning
implementation("org.bouncycastle:bcpkix-jdk15on:1.70") implementation("org.bouncycastle:bcpkix-jdk15on:1.70")

View File

@@ -1,5 +1,6 @@
package app.revanced.manager.flutter package app.revanced.manager.flutter
import android.os.Build
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import androidx.annotation.NonNull import androidx.annotation.NonNull
@@ -42,7 +43,6 @@ class MainActivity : FlutterActivity() {
val selectedPatches = call.argument<List<String>>("selectedPatches") val selectedPatches = call.argument<List<String>>("selectedPatches")
val cacheDirPath = call.argument<String>("cacheDirPath") val cacheDirPath = call.argument<String>("cacheDirPath")
val mergeIntegrations = call.argument<Boolean>("mergeIntegrations") val mergeIntegrations = call.argument<Boolean>("mergeIntegrations")
val resourcePatching = call.argument<Boolean>("resourcePatching")
val keyStoreFilePath = call.argument<String>("keyStoreFilePath") val keyStoreFilePath = call.argument<String>("keyStoreFilePath")
if (patchBundleFilePath != null && if (patchBundleFilePath != null &&
originalFilePath != null && originalFilePath != null &&
@@ -53,7 +53,6 @@ class MainActivity : FlutterActivity() {
selectedPatches != null && selectedPatches != null &&
cacheDirPath != null && cacheDirPath != null &&
mergeIntegrations != null && mergeIntegrations != null &&
resourcePatching != null &&
keyStoreFilePath != null keyStoreFilePath != null
) { ) {
runPatcher( runPatcher(
@@ -67,7 +66,6 @@ class MainActivity : FlutterActivity() {
selectedPatches, selectedPatches,
cacheDirPath, cacheDirPath,
mergeIntegrations, mergeIntegrations,
resourcePatching,
keyStoreFilePath keyStoreFilePath
) )
} else { } else {
@@ -90,7 +88,6 @@ class MainActivity : FlutterActivity() {
selectedPatches: List<String>, selectedPatches: List<String>,
cacheDirPath: String, cacheDirPath: String,
mergeIntegrations: Boolean, mergeIntegrations: Boolean,
resourcePatching: Boolean,
keyStoreFilePath: String keyStoreFilePath: String
) { ) {
val originalFile = File(originalFilePath) val originalFile = File(originalFilePath)
@@ -102,16 +99,20 @@ class MainActivity : FlutterActivity() {
Thread { Thread {
try { try {
val patches = DexPatchBundle( val patches = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
patchBundleFilePath, DexPatchBundle(
DexClassLoader(
patchBundleFilePath, patchBundleFilePath,
cacheDirPath, DexClassLoader(
null, patchBundleFilePath,
javaClass.classLoader cacheDirPath,
) null,
).loadPatches().filter { patch -> selectedPatches.any { it == patch.patchName } } javaClass.classLoader
)
).loadPatches().filter { patch -> selectedPatches.any { it == patch.patchName } }
} else {
TODO("VERSION.SDK_INT < CUPCAKE")
}
handler.post { handler.post {
installerChannel.invokeMethod( installerChannel.invokeMethod(
"update", "update",
@@ -139,7 +140,6 @@ class MainActivity : FlutterActivity() {
PatcherOptions( PatcherOptions(
inputFile, inputFile,
cacheDirPath, cacheDirPath,
resourcePatching,
Aapt.binary(applicationContext).absolutePath, Aapt.binary(applicationContext).absolutePath,
cacheDirPath, cacheDirPath,
logger = ManagerLogger() logger = ManagerLogger()

View File

@@ -80,7 +80,7 @@
"selectAllPatchesWarningContent": "You are about to select all patches, that includes unrecommended patches and can cause unwanted behavior." "selectAllPatchesWarningContent": "You are about to select all patches, that includes unrecommended patches and can cause unwanted behavior."
}, },
"patchItem": { "patchItem": {
"unsupportedWarningButton": "Unsupported version", "unsupportedWarningButton": "Warning",
"unsupportedDialogTitle": "Warning", "unsupportedDialogTitle": "Warning",
"unsupportedDialogText": "Selecting this patch may result in patching errors.\n\nApp version: {packageVersion}\nCurrent supported versions:\n{supportedVersions}" "unsupportedDialogText": "Selecting this patch may result in patching errors.\n\nApp version: {packageVersion}\nCurrent supported versions:\n{supportedVersions}"
}, },

View File

@@ -20,8 +20,8 @@ class GithubAPI {
); );
final DioCacheManager _dioCacheManager = DioCacheManager(CacheConfig()); final DioCacheManager _dioCacheManager = DioCacheManager(CacheConfig());
final Options _cacheOptions = buildCacheOptions( final Options _cacheOptions = buildCacheOptions(
const Duration(days: 1), const Duration(hours: 6),
maxStale: const Duration(days: 7), maxStale: const Duration(days: 1),
); );
final Map<String, String> repoAppPath = { final Map<String, String> repoAppPath = {
'com.google.android.youtube': 'youtube', 'com.google.android.youtube': 'youtube',

View File

@@ -142,7 +142,6 @@ class PatcherAPI {
List<Patch> selectedPatches, List<Patch> selectedPatches,
) async { ) async {
bool mergeIntegrations = await needsIntegrations(selectedPatches); bool mergeIntegrations = await needsIntegrations(selectedPatches);
bool resourcePatching = await needsResourcePatching(selectedPatches);
bool includeSettings = await needsSettingsPatch(selectedPatches); bool includeSettings = await needsSettingsPatch(selectedPatches);
if (includeSettings) { if (includeSettings) {
try { try {
@@ -186,7 +185,6 @@ class PatcherAPI {
'selectedPatches': selectedPatches.map((p) => p.name).toList(), 'selectedPatches': selectedPatches.map((p) => p.name).toList(),
'cacheDirPath': cacheDir.path, 'cacheDirPath': cacheDir.path,
'mergeIntegrations': mergeIntegrations, 'mergeIntegrations': mergeIntegrations,
'resourcePatching': resourcePatching,
'keyStoreFilePath': _keyStoreFile.path, 'keyStoreFilePath': _keyStoreFile.path,
}, },
); );

View File

@@ -13,8 +13,8 @@ class RevancedAPI {
late Dio _dio = Dio(); late Dio _dio = Dio();
final DioCacheManager _dioCacheManager = DioCacheManager(CacheConfig()); final DioCacheManager _dioCacheManager = DioCacheManager(CacheConfig());
final Options _cacheOptions = buildCacheOptions( final Options _cacheOptions = buildCacheOptions(
const Duration(days: 1), const Duration(hours: 6),
maxStale: const Duration(days: 7), maxStale: const Duration(days: 1),
); );
Future<void> initialize(String apiUrl) async { Future<void> initialize(String apiUrl) async {

View File

@@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager
publish_to: 'none' publish_to: 'none'
version: 0.0.26+26 version: 0.0.28+28
environment: environment:
sdk: ">=2.17.5 <3.0.0" sdk: ">=2.17.5 <3.0.0"