Entry points are mainly the parts of your software you expect other software to access from outside. For them to work correctly, PreEmptive Protection™ DashO™ generally must not remove or rename them. DashO also analyzes entry points to find which classes and members your code never uses.
Defining entry points correctly lets DashO protect everything else as strongly as possible. If you don't define any and DashO can't find any on its own, it treats your project like a library and doesn't rename or remove its public code.
This article explains entry point concepts. To configure them, see Configuring Entry Points.
Common Entry Points
Consider marking these as entry points:
- Classes or members you expect to be part of a public API.
-
public static void main(String[])methods you want to be executable. - Methods your code accesses through reflection.
- Android activities that an Android manifest refers to, when you post-process an APK.
Default Behavior
If your DashO configuration doesn't define any entry points, DashO tries to find them in this order:
- It analyzes the manifests of all input JAR files, if any, for entry points such as
Main-Classheaders. - It looks for
public static void main(String[])methods. - If it finds no entry points, it treats all inputs as library entry points. It excludes all
publicandprotectedmembers ofpublicclasses from Renaming and Removal.
Method and Field Entry Points
By default, DashO excludes method and field entry points from both Removal and Renaming. It analyzes the methods you specify as entry points to determine which classes and members are unused.
You can allow entry point classes, methods, and fields to be renamed. Generally, don't rename entry points, because something outside your app presumably accesses them. Some can be renamed safely, though. For example, if a JAR manifest's Main-Class attribute references a class, DashO updates the manifest with the new name.
Library Entry Points
Use library entry points to distribute a library with a public API, or when other software must interoperate extensively with your library. A library entry point can be a directory, JAR file, WAR file, ZIP file, or APK file.
- By default, all
publicclasses and theirpublicmembers in a library entry point are effectively entry points. DashO excludes them from Removal and Renaming. - You can configure DashO to treat
protectedmembers as entry points too. - DashO automatically treats library entry points as inputs, so you don't need to add them to the Input - Jars and Classes page too.
For more information, see Manage Inputs.
Special Class Entry Points
Special class entry points let you set rules for a class that go beyond simple method and field entry points. Most types are for classes that extend a framework class or implement a framework interface. Specify class names as an exact match, a pattern, or a regular expression.
| Type | Use it for | Project file element |
|---|---|---|
| Class; public fields/methods | Marking all public fields and methods in the matched classes as entry points. DashO doesn't remove the classes or their members. | <publics> |
| Class; all fields/methods | Marking all fields and methods in the matched classes as entry points. By default, DashO doesn't rename the classes or their members, but you can allow it. | <unconditional> |
| Applet Class | Classes that extend java.applet.Applet. DashO may rename the classes themselves. |
<applet> |
| Servlet Class | Classes that extend javax.servlet.Servlet. DashO may rename the classes themselves. |
<servlet> |
| Enterprise Java Bean | Classes that extend any of the interfaces in the javax.ejb package, including the bean's home and key classes. |
<ejb> |
| Midlet Class | Classes that extend javax.microedition.midlet.Midlet, directly or indirectly. DashO may rename the classes themselves. |
<midlet> |
| Android Class | Classes that extend android.app.Application, android.app.Activity, android.app.Service, android.content.BroadcastReceiver, or android.content.ContentProvider. |
<android> |
| Spring Bean | Spring Beans. See Spring Bean Entry Points. | <springbean> |
| i-appli Class | Classes that extend com.nttdocomo.ui.IApplication, from NTT DoCoMo's iAppli framework. DashO may rename the classes themselves. |
<iappli> |
Spring Bean Entry Points
SpringBean entry points identify classes as Spring Beans that your Spring XML configuration files reference.
- By default, DashO excludes property methods from Renaming and Removal. These are methods that follow the
getFoo(),setFoo(), andisBar()conventions. - You can also designate additional entry points, such as methods that the
init-methodanddestroy-methodattributes in your Spring XML files refer to.
Three settings control which members DashO can rename:
| Setting | When enabled |
| Rename Property Methods | DashO renames property methods without breaking their property conventions. For example, it might rename getFoo() to getA(). |
| Rename Entry Points | DashO renames the additional entry points you specify. |
| Rename Other Members | DashO renames non-property members that aren't additional entry points. |
For more information, see the <springbean> element and Protect Spring Boot and Spring Framework Applications.
Limitations and Troubleshooting
| Limitation or issue | Details |
| Entry points have no effect. | Your project uses Android Mode, where DashO ignores entry points and R8 handles renaming and removal. |
| Most public code isn't renamed or removed. | DashO found no entry points and treated all inputs as libraries. Define entry points. |
| Code accessed through reflection breaks after protection. | DashO may not detect reflection. Mark the reflected classes and members as entry points. |