Comments (12)
My test results
## build.gradle file
compile 'com.jakewharton.threetenabp:threetenabp:1.0.3'
FIRST TEST
# proguard file for Threeten backport
-dontwarn java.util.spi.LocaleServiceProvider
-dontwarn sun.util.calendar.*
-keep class org.threeten.bp.zone.*
-keep class org.threeten.bp.*
android test code:
Log.e(LOG_TAG, "toJson:" + new Gson().toJson(LocalDateTime.now()));
console output :
toJson:{"a":{"a":2015,"b":11,"c":14},"b":{"b":18,"c":47,"d":37,"e":79000000}}
SECOND TEST
# proguard file for Threeten backport
-dontwarn java.util.spi.LocaleServiceProvider
-dontwarn sun.util.calendar.*
-keep class org.threeten.bp.zone.*
-keep class org.threeten.bp.*
-keepclassmembers class org.threeten.bp.** { *; }
android test code:
Log.e(LOG_TAG, "toJson:" + new Gson().toJson(LocalDateTime.now()));
console output :
toJson:{"date":{"day":14,"month":11,"year":2015},"time":{"hour":18,"minute":51,"nano":394000000,"second":14}}
I think you should add the following line in proguard file.
-keepclassmembers class org.threeten.bp.** { *; }
from threetenabp.
-keep class org.threeten.bp.zone.*
@bryanstern Why did you add this?
from threetenabp.
I got this far: https://github.com/JakeWharton/ThreeTenABP/compare/jw/PROGUARD_IS_PAIN
Proguard is pain.
from threetenabp.
# Threeten backport
-dontwarn java.util.spi.LocaleServiceProvider
-dontwarn sun.util.calendar.*
-keep class org.threeten.bp.zone.*
I haven't had a chance to exercise these a ton, but they have me building. Found here ThreeTen/threetenbp#12 (comment)
from threetenabp.
Bundled rules can be done with:
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard.cfg'
consumerProguardFiles 'proguard.cfg'
}
}
from threetenabp.
Good catch, I don't think -keep class org.threeten.bp.zone.*
is needed. I misinterpreted some of the build errors that were spit out. I'm not having any issues without it.
from threetenabp.
I'll kick the tires tomorrow on that code, but it looks good. 👍
from threetenabp.
I removed it. I also removed -dontwarn java.util.spi.LocaleServiceProvider
which isn't used anywhere in 310BP.
from threetenabp.
Released in 1.0.2.
from threetenabp.
That effectively disables proguard for the whole library. If you don't want
it obfuscated, turn off obfuscation on it in your own config.
On Sat, Nov 14, 2015, 4:57 AM cp949 [email protected] wrote:
build.gradle file
compile 'com.jakewharton.threetenabp:threetenabp:1.0.3'
FIRST TEST
proguard file for Threeten backport
-dontwarn java.util.spi.LocaleServiceProvider
-dontwarn sun.util.calendar.*
-keep class org.threeten.bp.zone.*
-keep class org.threeten.bp.*android test code:
Log.e(LOG_TAG, "toJson:" + new Gson().toJson(LocalDateTime.now()));console output :
toJson:{"a":{"a":2015,"b":11,"c":14},"b":{"b":18,"c":47,"d":37,"e":79000000}}SECOND TEST
proguard file for Threeten backport
-dontwarn java.util.spi.LocaleServiceProvider
-dontwarn sun.util.calendar.*
-keep class org.threeten.bp.zone.*
-keep class org.threeten.bp.*
-keepclassmembers class org.threeten.bp.** { *; }android test code:
Log.e(LOG_TAG, "toJson:" + new Gson().toJson(LocalDateTime.now()));console output :
toJson:{"date":{"day":14,"month":11,"year":2015},"time":{"hour":18,"minute":51,"nano":394000000,"second":14}}I think you should add the following line in proguard file.
-keepclassmembers class org.threeten.bp.** { *; }—
Reply to this email directly or view it on GitHub
#4 (comment)
.
from threetenabp.
My server uses the java8 and LocalDateTime.
The json messages received from the server can not handle because threeten-Proguard on Android.
I probably always will be off the threeten-proguard.
from threetenabp.
If you are JSON serializing the objects then that is something specific to
your application and should be addressed in your proguard config. The
library does not concern itself with retaining field names by default
because most people will not be doing this.
On Sat, Nov 14, 2015, 3:52 PM cp949 [email protected] wrote:
My server uses the java8 and LocalDateTime.
The json messages received from the server can not handle because
threeten-Proguard on Android.I probably always will be off the threeten-proguard.
—
Reply to this email directly or view it on GitHub
#4 (comment)
.
from threetenabp.
Related Issues (20)
- Add Usage info HOT 1
- DateTimeParseException when parse HOT 4
- Update tzdb.dat to new version. HOT 3
- Duplicate ThreeTen Classes in AndroidTest HOT 2
- Calculation problem HOT 4
- IllegalStateException: Already initialized HOT 14
- minusDays() returns wrong date for specific use case HOT 2
- R8 issue with Ser HOT 14
- Contribution: Gson.toJson with @Expose annotations error HOT 1
- Will we still need this library after java.time will be desugared? HOT 6
- Do I actually want to switch to desugared native apis? HOT 7
- Wrong Format OffsetDateTime HOT 1
- Bug in DateTimeFormatter - Wrong year. HOT 1
- Help for specific pattern HOT 1
- Support Compose Preview HOT 2
- Wrong time zone offset HOT 1
- NoClassDefFoundError in android 4.4 even with multidex enabled HOT 2
- Returns the Value to 1926 HOT 3
- Please *do not* consider switching to core library desugaring HOT 2
- Fatal Exception: n30.g Unknown time-zone ID: America/Ciudad_Juarez HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from threetenabp.