Skip to content

Commit

Permalink
修复备份失败
Browse files Browse the repository at this point in the history
  • Loading branch information
generocket committed May 16, 2024
1 parent 264433f commit 6e7dadf
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 242 deletions.
18 changes: 5 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android {

defaultConfig {
applicationId 'com.github.tvbox.osc'
minSdkVersion 29
minSdkVersion 18
targetSdkVersion 29
versionCode 1
versionName '1.0.0'
Expand All @@ -20,10 +20,8 @@ android {

packagingOptions {
exclude 'META-INF/DEPENDENCIES'
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
exclude 'META-INF/INDEX.LIST'
pickFirst('/META-INF/{AL2.0,LGPL2.1}')
pickFirst('META-INF/INDEX.LIST')
}

buildTypes {
Expand Down Expand Up @@ -54,12 +52,6 @@ android {
checkReleaseBuilds false
abortOnError false
}
dexOptions {
javaMaxHeapSize "4g"
additionalParameters += '--multi-dex'
additionalParameters += '--set-max-idx-number=48000'
additionalParameters += '--minimal-main-dex'
}
}

dependencies {
Expand All @@ -76,8 +68,8 @@ dependencies {
implementation files('libs/commons-lang3-3.12.0.jar')
implementation 'org.conscrypt:conscrypt-android:2.5.2'
implementation 'com.squareup.okhttp3:okhttp:3.12.11'
annotationProcessor 'androidx.room:room-compiler:2.5.1'
implementation 'androidx.room:room-runtime:2.5.1'
annotationProcessor 'androidx.room:room-compiler:2.4.0'
implementation 'androidx.room:room-runtime:2.4.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.squareup.okio:okio:2.8.0'
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.45-androidx'
Expand Down
221 changes: 0 additions & 221 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,221 +0,0 @@
#############################################
#
# 对于一些基本指令的添加
#
#############################################
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
-printmapping proguardMapping.txt
-optimizations !code/simplification/cast,!field/*,!class/merging/*
-keepattributes *Annotation*,InnerClasses
-keepattributes EnclosingMethod, InnerClasses
-keepattributes *Annotation*
-keepattributes Signature
-keepattributes LineNumberTable
-renamesourcefileattribute SourceFile

# 重新包装所有重命名的包并放在给定的单一包中
-flattenpackagehierarchy androidx.base

# 将包里的类混淆成n个再重新打包到一个统一的package中 会覆盖flattenpackagehierarchy选项
-repackageclasses androidx.base

# 把混淆类中的方法名也混淆了
-useuniqueclassmembernames
#############################################
#
# Android开发中一些需要保留的公共部分
#
#############################################

# 保留我们使用的四大组件,自定义的Application等等这些类不被混淆
# 因为这些子类都有可能被外部调用
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application.**
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class * extends android.view.View
-keep public class com.android.vending.licensing.ILicensingService.**

# 保留support下的所有类及其内部类
-keep class android.support.** {*;}
# 保留继承的
-keep public class * extends android.support.v4.**
-keep public class * extends android.support.v7.**
-keep public class * extends android.support.annotation.**

-keep class com.google.android.material.** { *; }
-dontwarn com.google.android.material.**
-dontnote com.google.android.material.**
-dontwarn androidx.**
-keep class androidx.** { *; }
-keep interface androidx.** { *; }
#-keep public class * extends androidx.**

-keep class org.xmlpull.v1.** {*;}

# 保留R下面的资源
-keep class **.R$* {*;}

# 保留本地native方法不被混淆
-keepclasseswithmembernames class * {
native <methods>;
}

# 保留在Activity中的方法参数是view的方法,
# 这样以来我们在layout中写的onClick就不会被影响
-keepclassmembers class * extends android.app.Activity{
public void *(android.view.View);
}

# 保留枚举类不被混淆
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

# 保留我们自定义控件(继承自View)不被混淆
-keep public class * extends android.view.View{
*** get*();
void set*(***);
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keep public class * extends androidx.recyclerview.widget.RecyclerView$LayoutManager{
*** get*();
void set*(***);
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keep class com.orhanobut.hawk.** { *; }

# 保留Parcelable序列化类不被混淆
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

# 保留Serializable序列化的类不被混淆
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
!static !transient <fields>;
!private <fields>;
!private <methods>;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}

# 对于带有回调函数的onXXEvent、**On*Listener的,不能被混淆
-keepclassmembers class * {
void *(**On*Event);
void *(**On*Listener);
}
#xwalk
-keep class org.xwalk.core.** { *; }
-keep class org.crosswalk.engine.** { *; }
-keep class org.chromium.** { *; }
-dontwarn android.view.**
-dontwarn android.media.**
-dontwarn org.chromium.**
#okhttp
-dontwarn okhttp3.**
-keep class okhttp3.**{*;}
#okio
-dontwarn okio.**
-keep class okio.**{*;}
#loadsir
-dontwarn com.kingja.loadsir.**
-keep class com.kingja.loadsir.** {*;}
#gson
# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }
# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { <fields>; }
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
#xstream
-keep class com.thoughtworks.xstream.converters.extended.SubjectConverter { *; }
-keep class com.thoughtworks.xstream.converters.extended.ThrowableConverter { *; }
-keep class com.thoughtworks.xstream.converters.extended.StackTraceElementConverter { *; }
-keep class com.thoughtworks.xstream.converters.extended.CurrencyConverter { *; }
-keep class com.thoughtworks.xstream.converters.extended.RegexPatternConverter { *; }
-keep class com.thoughtworks.xstream.converters.extended.CharsetConverter { *; }
-keep class com.thoughtworks.xstream.** { *; }
#eventbus
-keepclassmembers class * {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
# And if you use AsyncExecutor:
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
<init>(java.lang.Throwable);
}
#bugly
-dontwarn com.tencent.bugly.**
-keep public class com.tencent.bugly.**{*;}
-keep class android.support.**{*;}

#dkplayer
-keep class com.dueeeke.videoplayer.** { *; }
-dontwarn com.dueeeke.videoplayer.**

# IjkPlayer
-keep class tv.danmaku.ijk.** { *; }
-dontwarn tv.danmaku.ijk.**

# ExoPlayer
-keep class com.google.android.exoplayer2.** { *; }
-dontwarn com.google.android.exoplayer2.**

# 实体类
#-keep class com.github.tvbox.osc.bean.** { *; }
#CardView
-keep class com.github.tvbox.osc.ui.tv.widget.card.**{*;}
#ViewObj
-keep class com.github.tvbox.osc.ui.tv.widget.ViewObj{
<methods>;
}

-keep class com.github.catvod.crawler.*{*;}
# 迅雷下载模块
-keep class com.xunlei.downloadlib.** {*;}
# quickjs引擎
-keep class com.whl.quickjs.** {*;}
# 支持影视的ali相关的jar
-keep class com.google.gson.**{*;}
# Zxing
-keep class com.google.zxing.**{*;}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-dontwarn org.xmlpull.v1.**
-dontwarn org.kxml2.io.**
-dontwarn android.content.res.**
-dontwarn org.slf4j.impl.StaticLoggerBinder

-keep class org.xmlpull.** { *; }
-keepclassmembers class org.xmlpull.** { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ List<String> allBackup() {
String root = Environment.getExternalStorageDirectory().getAbsolutePath();
File file = new File(root + "/tvbox_backup/");
File[] list = file.listFiles();
if (list == null || list.length == 0) {
return result;
}
Arrays.sort(list, new Comparator<File>() {
@Override
public int compare(File o1, File o2) {
Expand Down
5 changes: 1 addition & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ buildscript {
// maven { url 'http://9xi4o.tk/maven2' }
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.2"
classpath 'com.android.tools.build:gradle:7.4.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// constraints {
// classpath("com.google.guava:guava:29.0-jre")
// }
}
}

Expand Down
5 changes: 1 addition & 4 deletions player/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ android {
compileSdk 33

defaultConfig {
minSdkVersion 29
minSdkVersion 18
targetSdkVersion 29
versionCode 1
versionName "1.0"
}

buildTypes {
Expand Down Expand Up @@ -41,6 +39,5 @@ dependencies {
implementation "androidx.media3:media3-exoplayer-rtsp:1.1.1"
implementation "androidx.media3:media3-datasource-rtmp:1.1.1"
implementation 'com.squareup.okhttp3:okhttp:3.12.11'
// api("com.google.guava:guava:29.0-jre")
api 'xyz.doikki.android.dkplayer:dkplayer-ui:3.3.7'
}

0 comments on commit 6e7dadf

Please sign in to comment.