Bumped to latest 7.3.

Most likely many deps missing. Will be added later
This commit is contained in:
Jiri 2023-07-03 18:00:21 +02:00
commit bedecc2650
17 changed files with 328 additions and 69 deletions

View file

@ -16,44 +16,35 @@ function warning() {
fi
}
# identify directory tree
JRD=`basename $0`
# the launcher is reused uder different name, hardcoding name
JRD=java-runtime-decompiler
CONF_HOME=$XDG_CONFIG_HOME
if [ "$CONF_HOME" = "" ] ; then
CONF_HOME=$HOME/.config/$JRD
else
CONF_HOME=$CONF_HOME/$JRD
fi
LOG_DIR=$CONF_HOME/logs
CONF_DIR=$CONF_HOME/conf
# create directory tree
PLUGIN_HOME=$CONF_HOME/plugins
PLUGIN_HOME_LEGACY=$CONF_HOME/plugins-legacy
mkdir -p $LOG_DIR
mkdir -p $CONF_DIR
mkdir -p $PLUGIN_HOME
: ${MAIN_CLASS:=org.jrd.backend.data.Main}
if [ "x$JAVA_HOME" == "x" ] ; then
JAVA_HOME=/usr/lib/jvm/java-11-openjdk
fi
# set java and jvm arguments
export _prefer_jre=false
export _prefer_jre=false #although java moved compiler classes to jre, PREFERING jdk should not hurt
_set_java_home
set_jvm
# all dependencies must be on classpath
set_classpath java-runtime-decompiler rsyntaxtextarea byteman google-gson classpathless-compiler objectweb-asm
set_classpath java-runtime-decompiler rsyntaxtextarea byteman google-gson classpathless-compiler objectweb-asm java-diff-utils
CLASSPATH=$CLASSPATH:${JAVA_HOME}/lib/tools.jar
# set path to agent automatically
@ -63,16 +54,19 @@ AGENT_PREFIX="AGENT_PATH==="
AGENT_STRING=$AGENT_PREFIX$AGENT
# copy json wrappers information to home so the users can edit
CP_FILES="$(ls /etc/$JRD/plugins/*.json)"
for cpfile in $CP_FILES; do
FILE_NAME="$(basename -- $cpfile)"
if [ ! -e "$PLUGIN_HOME/$FILE_NAME" ]
then
cp $cpfile $PLUGIN_HOME
else
warning "Configuration files were not copied for $FILE_NAME - the existing configuration would be overwritten."
fi
done
if [ ! -e "$PLUGIN_HOME_LEGACY" -a -e "$PLUGIN_HOME" ] ; then
mv "$PLUGIN_HOME" "$PLUGIN_HOME_LEGACY"
echo "jrd no longer handles custom plugins for you. Your's "
echo "$PLUGIN_HOME was moved to $PLUGIN_HOME_LEGACY"
echo "You can play with custom plugins in $PLUGIN_HOME"
echo "but keep $PLUGIN_HOME_LEGACY created, so it is not renamed again"
fi
mkdir -p $PLUGIN_HOME_LEGACY
warning "jrd no longer handles custom plugins for you. Your's "
warning echo "$PLUGIN_HOME was moved to $PLUGIN_HOME_LEGACY"
warning "You can play with custom plugins in $PLUGIN_HOME"
warning "but keep $PLUGIN_HOME_LEGACY created, so it is not renamed again"
# create config file and add agent default path
touch $CONFIG_FILE
@ -94,5 +88,5 @@ else
echo "Agent was not found and agent path was not set correctly. This has to be done manually in the decompiler GUI, or set AGENT_PATH===path_to_agent_jar in the configuration file: $CONFIG_FILE" >&2
fi
export FLAGS="$FLAGS -Djdk.attach.allowAttachSelf=true --add-exports jdk.jdeps/com.sun.tools.javap=ALL-UNNAMED" # jdk11+ do not allow attach by default; jdk17 is hiding javap api
run "$@"
export FLAGS="$FLAGS -Djdk.attach.allowAttachSelf=true --add-exports jdk.jdeps/com.sun.tools.javap=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED" # jdk11+ do not allow attach by default; jdk17 is hiding javap api
run "$@"