# VPN Service 保护规则
-keep class com.hiddify.hiddify.bg.VPNService {*;}
-keep class com.hiddify.hiddify.bg.VPNService$* {*;}
-keep class com.hiddify.hiddify.bg.BoxService {*;}
-keep class com.hiddify.hiddify.bg.BoxService$* {*;}
-keep class com.hiddify.hiddify.MainActivity {*;}
-keep class com.hiddify.hiddify.MainActivity$* {*;}

# 保护所有 VPN 相关类
-keep class android.net.VpnService {*;}
-keep class * extends android.net.VpnService {*;}

# 保护 Service Connection
-keep class com.hiddify.hiddify.bg.ServiceConnection {*;}
-keep class com.hiddify.hiddify.bg.ServiceConnection$* {*;}

# 保护 libbox 相关
-keep class io.nekohasekai.libbox.** {*;}
-keep interface io.nekohasekai.libbox.** {*;}

# 保护 Settings
-keep class com.hiddify.hiddify.Settings {*;}
-keep class com.hiddify.hiddify.Settings$* {*;}

# 保护 Kotlin 相关
-keep class kotlin.** {*;}
-keep interface kotlin.** {*;}

# 保护协程相关
-keep class kotlinx.coroutines.** {*;}
-keep interface kotlinx.coroutines.** {*;}

# 保护 AndroidX 相关
-keep class androidx.** {*;}
-keep interface androidx.** {*;}

# 保护所有回调接口
-keep class com.hiddify.hiddify.bg.ServiceConnection$Callback {*;}
-keep interface com.hiddify.hiddify.bg.ServiceConnection$Callback {*;}

# 保护 Intent 和相关
-keep class android.content.Intent {*;}

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

# 保护 enum
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

# 保护 Parcelable 对象
-keep class * implements android.os.Parcelable {
    public static final android.os.Parcelable$Creator *;
}

# 保护所有方法（重要的运行时反射）
-keepclassmembers class * {
    *** *(...);
}
