obfuscate serialization class in java - serialization

I want to obfuscate our project to prevent the code from being cracked, So I used ProGuard to obfuscate. But our project contains many serialization classes or models(it's important and should be secret).And the ProGuard can not do this. So what can I do to protect these serialization classes or models from being decompiled?

Related

wsimport generate files including Jackson annotations

How can I use wsimport (or any other tool that provides similar funcionality for that matter) to generate the required files to talk to a JAX-WS webservice, but not only have it add JAXB annotation to the request/response classes, but also add Jackson annotations?
In the big picture, I do not want to duplicate, I want to reuse the generated classes for a REST service. If the above is not possible, is there any other way that saves me from duplicating everything?
As mentioned in a comment, Jackson has a JAXB Annotations module, that can use JAXB annotated classes beside / instead of standard Jackson annotated ones...
See: https://github.com/FasterXML/jackson-module-jaxb-annotations

How to disable proguard in javafxports for errors "You should consider keeping the * attributes"

I'm trying to use JavaFX in my android device, with the help of javafxports.
I used the XStream to parse some XML file in my program.
When i compile them, the javafxports outputs the following warnings:
Note: there were 9 classes trying to access annotations using reflection.
You should consider keeping the annotation attributes
(using '-keepattributes *Annotation*').
(http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
Note: there were 32 classes trying to access generic signatures using reflection.
You should consider keeping the signature attributes
(using '-keepattributes Signature').
(http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
Note: there were 56 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 3 class casts of dynamically created class instances.
You might consider explicitly keeping the mentioned classes and/or
their implementations (using '-keep').
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclasscast)
Note: there were 39 accesses to class members by means of introspection.
You should consider explicitly keeping the mentioned class members
(using '-keep' or '-keepclassmembers').
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)
Note: you're ignoring all warnings!
The output .apk can be installed and run until it calls the xstream classes to read annotations in my classes. The reason is actually described in the warnings.
So my question is, how can i disable the proguard when generating .apk, or send it a custom proguard.pro configuration.
And my build.gradle is almost the same as that in the helloworld example.
Thanks.

Do Kotlin's access modifiers mean the same thing as in Java?

Kotlin has 3 keywords for access: public, private and protected. Do they mean the same thing as in Java, or are there differences? Also, is internal the same as package private? I keep reading about "modules" in Kotlin, and I'm not sure if that's just another word for "package".
Kotlin's access modifiers do not always mean the same thing as in Java. For example, Kotlin allows protected members in interfaces while Java does not.
Modules are compile-time only entities. They group source files and declare dependencies for them (binary libraries and other modules). A module is a unit of compilation, i.e. all of its files are compiled together (in fact there is file-by-file incremental compilation, but its effect must be the same as re-compiling the whole module).
For example, each Maven pom implicitly declares a module, and IDE has modules in the Project View and Project Structure.

Save and Load instances of objects created earlier via the Eclipse registry

I am currently experiencing a problem in my RCP application and wanted to ask, if someone stumbled over the same problem and can give me some valuable hints:
My RCP application allows plugins to provide implementations of a specific abstract class of my model (singleton) to extend my model during runtime via the update manager. I instantiate these classes via
extensionPointImplementation.createExecutableExtension(..)
after parsing the Eclipse registry. I can serialize the created instances using the default Java serialization API.
Now to the problem: The plugin trying to deserialize the objects cannot find the class implementations of the model extensions due to the fact, that there is no plugin dependency between the plugins. Nevertheless, it is not possible for me to create such a dependency which would make the idea of extending the model during runtime obsolete.
Is it possible to solve this problem by using the default Java serialization API or do I have to implement my own serialization (which parses the Eclipse registry and creates the instances via the line shown above if all necessary plugins are available, otherwise throw an exception) which might be based on the default Java serialization API (if possible I do not want to create the serialization completely by myself)?
Thanks.
You need to define a so called buddy policy.
In the bundle trying to instantiate the class add
Eclipse-BuddyPolicy: registered
to the manifest.mf.
In the bundle providing the class add
Eclipse-RegisterBuddy: <symbolic name of the bundle instantiating the class>
to the manifest.mf.

XText using type information from an external EMF Model

I'm looking into using XText to make an extenstion DSL to a language that I use daily and has some obvious shortcomings (AS3, through FlashBuilder).
I have a grammar and code generation system working, where the below declaration generates a value class, with constructor, class level vars and getters etc.
class Person (name: String, age: int)
This is fine, but I would like the have the types defined in the flash player library and also the types that I define in users projects available in my extension DSL. In the code above both String and int come from the native flash library.
I presume that Flash Builder uses the EMF core internally to represent both any included libs (swcs) and any types I define in my projects. If this is the case, my question is:
How can I access the EMF model of FLash Builder?
If there is no EMF model then I presume I would have to parse the library.swc myself and the source code of my projects.
Is the Xtend language intended to preform these sort of native filesystem tasks?
Thanks
Let us asume the Flash Builder comes with an EMF based metamodel. then the "thing" you have to do is to implement a IResourceServiceProvider. I have blogged on doing the very same stuff for uml models: http://christiandietrich.wordpress.com/2011/07/17/xtext-2-0-and-uml/
and no: xtend is a modern style programming language that compiles to Java and has nice Templating support.