Annotation for proguard -keep
This commit is contained in:
parent
580ba60762
commit
c32652394e
7
scripts/proguard.pro
vendored
7
scripts/proguard.pro
vendored
@ -23,6 +23,13 @@
|
|||||||
|
|
||||||
-keep class baritone.api.utils.MyChunkPos { *; } # even in standalone we need to keep this for gson reflect
|
-keep class baritone.api.utils.MyChunkPos { *; } # even in standalone we need to keep this for gson reflect
|
||||||
|
|
||||||
|
# Keep any class or member annotated with @KeepName so we dont have to put everything in the script
|
||||||
|
-keep,allowobfuscation @interface baritone.KeepName
|
||||||
|
-keep @baritone.KeepName class *
|
||||||
|
-keepclassmembers class * {
|
||||||
|
@baritone.KeepName *;
|
||||||
|
}
|
||||||
|
|
||||||
# setting names are reflected from field names, so keep field names
|
# setting names are reflected from field names, so keep field names
|
||||||
-keepclassmembers class baritone.api.Settings {
|
-keepclassmembers class baritone.api.Settings {
|
||||||
public <fields>;
|
public <fields>;
|
||||||
|
21
src/main/java/baritone/KeepName.java
Normal file
21
src/main/java/baritone/KeepName.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of Baritone.
|
||||||
|
*
|
||||||
|
* Baritone is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Baritone is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package baritone;
|
||||||
|
|
||||||
|
// Annotation for classes and class members that should not be renamed by proguard
|
||||||
|
public @interface KeepName { }
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package baritone.command.defaults;
|
package baritone.command.defaults;
|
||||||
|
|
||||||
|
import baritone.KeepName;
|
||||||
import baritone.api.IBaritone;
|
import baritone.api.IBaritone;
|
||||||
import baritone.api.command.Command;
|
import baritone.api.command.Command;
|
||||||
import baritone.api.command.datatypes.EntityClassById;
|
import baritone.api.command.datatypes.EntityClassById;
|
||||||
@ -130,6 +131,7 @@ public class FollowCommand extends Command {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@KeepName
|
||||||
private enum FollowGroup {
|
private enum FollowGroup {
|
||||||
ENTITIES(EntityLiving.class::isInstance),
|
ENTITIES(EntityLiving.class::isInstance),
|
||||||
PLAYERS(EntityPlayer.class::isInstance); /* ,
|
PLAYERS(EntityPlayer.class::isInstance); /* ,
|
||||||
@ -142,6 +144,7 @@ public class FollowCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@KeepName
|
||||||
private enum FollowList {
|
private enum FollowList {
|
||||||
ENTITY(EntityClassById.INSTANCE),
|
ENTITY(EntityClassById.INSTANCE),
|
||||||
PLAYER(NearbyPlayer.INSTANCE);
|
PLAYER(NearbyPlayer.INSTANCE);
|
||||||
|
Loading…
Reference in New Issue
Block a user