-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproguard-rules.pro
More file actions
414 lines (362 loc) · 14.4 KB
/
Copy pathproguard-rules.pro
File metadata and controls
414 lines (362 loc) · 14.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
-dontwarn kotlinx.serialization.**
-keep class sumpdf.BuildConfig { *; }
# OkHttp - Suppress warnings for Android, Conscrypt, and OpenJSSE specific classes
-dontwarn okhttp3.internal.platform.**
-dontwarn org.conscrypt.**
-dontwarn org.openjsse.**
-dontwarn android.security.**
-dontwarn android.os.**
-dontwarn android.util.**
-dontwarn android.net.**
-dontwarn dalvik.system.**
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-keep class okio.** { *; }
-keep interface okio.** { *; }
# Notes related to dynamic access in OkHttp
-dontnote okhttp3.internal.platform.android.CloseGuard$Companion
-dontnote okhttp3.internal.platform.android.AndroidSocketAdapter
# Keep Semver4j library
-keep class com.vdurmont.semver4j.** { *; }
-keep interface com.vdurmont.semver4j.** { *; }
-dontnote com.vdurmont.semver4j.**
# Sun/Swing warnings
-dontwarn sun.misc.**
-dontwarn sun.swing.SwingUtilities2$AATextInfo
-dontwarn net.miginfocom.swing.MigLayout
-dontwarn sun.java2d.cmm.**
-dontwarn sun.misc.Unsafe
-dontwarn jdk.internal.misc.Unsafe
-keep class com.google.gson.internal.UnsafeAllocator { *; }
-keep class com.google.gson.internal.** { *; }
# Suppress notes
-dontnote kotlinx.serialization.**
-dontnote META-INF.**
-dontnote kotlinx.serialization.internal.PlatformKt
# Keep Kotlin Serialization
-keepattributes *Annotation*, InnerClasses
-dontnote kotlinx.serialization.AnnotationsKt
# Keep all serializable classes
-keepclassmembers class ** {
@kotlinx.serialization.Serializable <fields>;
}
# Keep serializers
-keepclasseswithmembers class **$$serializer {
static **$$serializer INSTANCE;
}
# Keep serializable classes and their properties
-if @kotlinx.serialization.Serializable class **
-keep class <1> {
static <1>$Companion Companion;
}
# Keep serialization classes
-keepclassmembers class kotlinx.serialization.json.** {
*** Companion;
}
-keepclasseswithmembers class kotlinx.serialization.json.** {
kotlinx.serialization.KSerializer serializer(...);
}
-keep class kotlinx.serialization.descriptors.** { *; }
# Keep data classes and their inner classes
-keep class combiner.AppSettings { *; }
-keep class combiner.AppSettings$$serializer { *; }
-keep class converter.ConverterSettings { *; }
-keep class converter.ConverterSettings$$serializer { *; }
-keep class converter.ConversionTask { *; }
-keep class converter.ConversionTask$$serializer { *; }
# Keep all local model classes and enums
-keep class combiner.PdfCombinerIntent { *; }
-keep class combiner.PdfCombinerIntent$* { *; }
-keep class combiner.PdfFile { *; }
-keep class combiner.PdfFile$* { *; }
-keep enum converter.ConversionStatus { *; }
-keep class model.FileItem { *; }
-keep class model.ConversionResult { *; }
-keep interface converter.Converter { *; }
# XML and DOM - Handle duplicate definitions
-dontnote javax.xml.**
-dontnote org.w3c.dom.**
-dontnote org.xml.sax.**
-dontwarn javax.xml.**
-dontwarn org.w3c.dom.**
-dontwarn org.xml.sax.**
# Apache Commons
-dontwarn org.objectweb.asm.**
-dontwarn org.brotli.dec.**
-dontwarn com.github.luben.zstd.**
-dontwarn org.tukaani.xz.**
-dontwarn org.apache.commons.compress.archivers.sevenz.**
-dontwarn org.apache.commons.compress.compressors.**
-dontwarn org.apache.commons.compress.harmony.**
-dontnote org.apache.commons.compress.**
-dontnote org.apache.commons.io.**
-dontnote org.apache.commons.lang3.**
# Apache Commons Logging
-keep class org.apache.commons.logging.impl.** { *; }
-keep class org.apache.commons.logging.LogFactory { *; }
-keep class org.apache.commons.logging.Log { *; }
-keepnames class org.apache.commons.logging.LogFactory
-keepnames class org.apache.commons.logging.impl.LogFactoryImpl
-keepnames class org.apache.commons.logging.impl.NoOpLog
-keepnames class org.apache.commons.logging.impl.SimpleLog
-dontwarn org.apache.commons.logging.**
-dontnote org.apache.commons.logging.**
-dontwarn javax.servlet.**
-dontwarn org.apache.avalon.framework.**
-dontwarn org.apache.log4j.**
-dontwarn org.apache.log.**
-dontnote org.apache.log4j.**
-dontnote org.apache.log.**
# SLF4J
-keep class org.slf4j.impl.** { *; }
-keep class org.slf4j.simple.** { *; }
-keepnames class org.slf4j.impl.StaticLoggerBinder
-dontwarn org.slf4j.**
-dontnote org.slf4j.**
-keep class org.slf4j.LoggerFactory { *; }
-keep interface org.slf4j.Logger { *; }
-keep class org.slf4j.simple.SimpleServiceProvider implements org.slf4j.spi.SLF4JServiceProvider { *; }
-keepnames class * implements org.slf4j.spi.SLF4JServiceProvider
-keep interface org.slf4j.spi.SLF4JServiceProvider { *; }
# Apache PDFBox
-keep class org.apache.pdfbox.io.IOUtils {
static final org.apache.commons.logging.Log LOG;
*;
}
-keepclassmembers class org.apache.pdfbox.io.IOUtils {
static final org.apache.commons.logging.Log LOG;
}
# Ensure Apache Commons Logging initialization works
-keep class org.apache.commons.logging.LogFactory {
static org.apache.commons.logging.LogFactory factory;
static java.util.Hashtable factories;
*;
}
-keepclassmembers class org.apache.commons.logging.LogFactory {
static *;
}
-dontnote org.apache.pdfbox.**
-dontnote org.apache.fontbox.**
-dontwarn org.bouncycastle.**
-dontwarn org.apache.pdfbox.io.IOUtils
-dontwarn org.apache.fontbox.**
-keep class org.apache.pdfbox.** { *; }
-keep class org.apache.fontbox.** { *; }
-keep class org.apache.pdfbox.util.PDFBoxResourceLoader { *; }
-keepnames class * implements org.apache.pdfbox.pdmodel.graphics.image.ImageReader
-keepnames class * implements org.apache.pdfbox.pdmodel.font.FontProvider
# Deskit UI Library
-dontwarn com.github.zahid4kh.deskit.**
-dontnote com.github.zahid4kh.deskit.**
-keep public class com.github.zahid4kh.deskit.** {
public protected *;
}
-keep public interface com.github.zahid4kh.deskit.** {
public protected *;
}
-keepclassmembers enum com.github.zahid4kh.deskit.** {
*;
}
# JodConverter - Keep all required classes
-dontwarn org.jodconverter.**
-dontwarn com.sun.star.**
-dontwarn java.lang.ProcessBuilder
# Koin dependency injection
-dontwarn org.koin.**
-dontnote org.koin.**
-keep class org.koin.core.** { *; }
-keep class org.koin.core.scope.Scope { *; }
-keep class org.koin.core.parameter.ParametersHolder { *; }
-keep class org.koin.core.module.Module { *; }
-keep class org.koin.dsl.** { *; }
# Keep Koin related lambda functions in AppModule
-keepclassmembers class AppModuleKt {
** appModule$lambda$*(***);
}
# JodConverter registry and format loading
-keep class org.jodconverter.core.document.JsonDocumentFormatRegistry { *; }
-keep class org.jodconverter.core.document.DefaultDocumentFormatRegistry { *; }
-keep class org.jodconverter.core.document.DefaultDocumentFormatRegistryInstanceHolder { *; }
# Keep core JodConverter classes and their inner classes
-keep class org.jodconverter.core.** { *; }
# Keep DocumentFormat and related classes for Gson
-keep class org.jodconverter.core.document.DocumentFormat { *; }
-keep class org.jodconverter.core.document.DocumentFormat$* { *; }
-keep class org.jodconverter.core.document.** { *; }
-keepclassmembers class org.jodconverter.core.document.** {
<init>();
<init>(...);
}
-keep class org.jodconverter.local.LocalConverter { *; }
-keep class org.jodconverter.local.LocalConverter$* { *; }
-keep class org.jodconverter.local.office.LocalOfficeManager { *; }
-keep class org.jodconverter.local.office.LocalOfficeManager$* { *; }
-keep class org.jodconverter.local.office.LocalOfficeUtils { *; }
-keep class org.jodconverter.local.office.OfficeConnection { *; }
-keep class org.jodconverter.local.office.OfficeConnectionEvent { *; }
-keep class org.jodconverter.local.office.OfficeConnectionEventListener { *; }
-keep class org.jodconverter.local.office.OfficeUrl { *; }
-keep class org.jodconverter.local.office.ExistingProcessAction { *; }
-keep class org.jodconverter.local.task.LoadDocumentMode { *; }
-keep class org.jodconverter.local.process.ProcessManager { *; }
-keep class org.jodconverter.local.process.ProcessQuery { *; }
-keep interface org.jodconverter.local.** { *; }
# Suppress dynamic constructor notes for JodConverter
-dontnote org.jodconverter.local.office.LocalOfficeManager$Builder
-dontnote org.jodconverter.local.filter.**
# Keep only the necessary com.sun.star classes
-dontnote com.sun.star.**
-keep interface com.sun.star.** { *; }
-keep class com.sun.star.lib.uno.helper.UnoUrl { *; }
-keep class com.sun.star.comp.** { *; }
-keep class com.sun.star.lib.** { *; }
-keep class com.sun.star.uno.** { *; }
# Apache Batik and XMLGraphics
-dontwarn org.apache.batik.**
-dontwarn org.mozilla.javascript.**
-dontwarn org.python.**
-dontwarn org.apache.fop.**
# Suppress Batik and XMLGraphics dynamic loading notes
-dontnote org.apache.batik.**
-dontnote org.w3c.css.sac.helpers.ParserFactory
-dontnote javax.xml.datatype.DatatypeConfigurationException
-dontnote javax.xml.transform.TransformerException
-dontnote org.apache.xmlgraphics.ps.dsc.DSCCommentFactory
-dontnote org.apache.xmlgraphics.util.Service
# Keep Batik classes actually used
-keep class org.apache.batik.transcoder.** { *; }
-keep class org.apache.batik.transcoder.image.PNGTranscoder { *; }
-keep class org.apache.batik.bridge.** { *; }
-keep class org.apache.batik.dom.** { *; }
-keep class org.apache.batik.util.** { *; }
-keep class org.apache.batik.apps.** { *; }
-keep class org.apache.batik.ext.** { *; }
-keep class org.apache.batik.gvt.** { *; }
-keep class org.apache.xmlgraphics.** { *; }
-keep interface org.apache.batik.** { *; }
# Keep Batik service implementations
-keepnames class * implements org.apache.batik.ext.awt.image.spi.ImageWriter
-keepnames class * implements org.apache.batik.ext.awt.image.spi.ImageTranscoder
-keepnames class * implements org.apache.batik.gvt.font.FontFamily
# Fix for Batik's BridgeContext methods
-keepclassmembers class org.apache.batik.bridge.BatikWrapFactory {
void setJavaPrimitiveWrap(boolean);
}
-keepclassmembers class org.apache.batik.bridge.EventTargetWrapper {
java.lang.Object unwrap();
}
-keepclassmembers class org.apache.batik.bridge.GlobalWrapper {
void defineFunctionProperties(java.lang.String[], java.lang.Class, int);
}
-keepclassmembers class org.apache.batik.bridge.WindowWrapper {
void defineFunctionProperties(java.lang.String[], java.lang.Class, int);
void defineProperty(java.lang.String, java.lang.Class, int);
}
# XML/SAX Support for Batik - Critical for SVG processing
-keep class javax.xml.** { *; }
-keep class org.xml.sax.** { *; }
-keep class org.xml.sax.ext.** { *; }
-keep class org.xml.sax.helpers.** { *; }
-keep class com.sun.org.apache.xerces.** { *; }
-keep class com.sun.org.apache.xalan.** { *; }
# Batik SAX/DOM classes - Essential for SVG transcoding
-keep class org.apache.batik.dom.** { *; }
-keep class org.apache.batik.anim.dom.** { *; }
-keep class org.apache.batik.parser.** { *; }
-keep class org.apache.batik.transcoder.** { *; }
-keep class org.apache.batik.transcoder.image.** { *; }
# XML Parser implementations
-keep class * implements org.xml.sax.XMLReader { *; }
-keep class * implements org.xml.sax.ext.LexicalHandler { *; }
-keep class * implements org.xml.sax.ContentHandler { *; }
-keep class * implements org.xml.sax.ErrorHandler { *; }
# Keep XML property setters/getters
-keepclassmembers class * {
*** setProperty(...);
*** getProperty(...);
*** setFeature(...);
*** getFeature(...);
}
# Suppress XML warnings but keep functionality
-dontwarn javax.xml.**
-dontwarn org.xml.sax.**
-dontwarn com.sun.org.apache.xerces.**
-dontwarn com.sun.org.apache.xalan.**
# Batik CSS Parser - Critical for SVG processing
-keep class org.apache.batik.css.parser.** { *; }
-keep class org.apache.batik.css.engine.** { *; }
-keep class org.apache.batik.css.** { *; }
# Batik Bridge classes that load CSS dynamically
-keep class org.apache.batik.bridge.** { *; }
-keep class org.apache.batik.gvt.** { *; }
-keep class org.apache.batik.script.** { *; }
# Keep all Batik parser implementations
-keep class * extends org.apache.batik.css.parser.AbstractParser { *; }
-keep class * implements org.apache.batik.css.parser.CSSParser { *; }
# Dynamic class loading for Batik
-keepnames class org.apache.batik.css.parser.Parser
-keepnames class org.apache.batik.css.engine.CSSEngine
-keepnames class org.apache.batik.dom.ExtensibleDOMImplementation
# Don't warn about optional dependencies
-dontwarn java.awt.**
-dontwarn javax.swing.**
# Gson support for JodConverter - More comprehensive
-keep class com.google.gson.** { *; }
-keep class * implements 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 { *; }
-keep class com.google.gson.internal.** { *; }
-keep class com.google.gson.reflect.** { *; }
# Critical for Gson to work with JodConverter DocumentFormat
-keepattributes Signature
-keepattributes *Annotation*
-keepattributes EnclosingMethod
-keepattributes InnerClasses
# Force keep DocumentFormat constructors and fields
-keep class org.jodconverter.core.document.DocumentFormat {
<init>();
<init>(...);
<fields>;
<methods>;
}
-keepclassmembers class org.jodconverter.core.document.DocumentFormat {
*;
}
# Keep all field names for Gson reflection
-keepclassmembers class org.jodconverter.core.document.** {
<fields>;
<init>();
<init>(...);
}
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
-dontwarn com.google.gson.**
-dontnote com.google.gson.**
# PreCompose
-dontwarn moe.tlaster.precompose.**
-keep class moe.tlaster.precompose.** { *; }
-keep interface moe.tlaster.precompose.** { *; }
-keep class * extends moe.tlaster.precompose.viewmodel.ViewModel { *; }
-keepnames class * implements moe.tlaster.precompose.navigation.Route
-dontnote moe.tlaster.precompose.navigation.Route
# Keep ViewModels and other app classes
-keep class combiner.CombinerViewModel { *; }
-keep class combiner.CombinerViewModel$* { *; }
-keep class converter.ConverterViewModel { *; }
-keep class converter.ConverterViewModel$* { *; }
-keep class converter.PDFConverter { *; }
-keep class Database { *; }
-keep class SumPDF { *; }
-keep class AppModuleKt { *; }
# Suppress dynamic loading notes
-dontnote org.apache.batik.apps.svgbrowser.JSVGViewerFrame$Debugger
-dontnote org.apache.batik.apps.svgbrowser.Main
-dontnote org.apache.batik.apps.rasterizer.DestinationType
-dontnote org.apache.batik.ext.awt.image.spi.ImageTranscoder
-dontnote org.apache.batik.gvt.font.FontFamily
# Keep reflection access needed by your app
-keepclassmembers class * {
@com.sun.star.lib.uno.typeinfo.TypeInfo <fields>;
}