当前位置: 首页 > news >正文

【JD-GUI】MacOS 中使用Java反编译工具JD-GUI

希望文章能给到你启发和灵感~
如果觉得文章对你有帮助的话,点赞 + 关注+ 收藏 支持一下博主吧~

阅读指南

  • 开篇说明
  • 概念理解
  • 一、基础环境说明
    • 1.1 硬件环境
    • 1.2 软件环境
  • 二、下载与安装
    • 2.1 选择对应版本
    • 2.2 解压运行排除异常:
    • 2.3 关于使用
  • 三、最后

开篇说明

现在的反编译软件繁多,Apktool,JD-GUI,dedexer,IDA Pro等等,每种反编译工具都有各自使用的场景,例如Apktool我们在反编译apk类型文件时会用到,JD-GUI则是常用来反编译Java中的class文件,或者Jar等源文件;

在这里插入图片描述

概念理解

【1】什么是反编译?

简单的说,就是将机器语言转换成我们能看懂的语言,这个过程就叫反编译,例如Java中的class文件反编译后,就能变成我们日常开发写的代码xxx.java文件;

【2】反编译是否一定能成功?

不一定,随着现在很多代码编译中都会加入代码混淆,加密,或是加壳等等技术,加大反编译的难度和降低反编译代码的可读性,不过如果想完全避免反编译也是不可能的。只是反编译的还原度的大小问题了;

一、基础环境说明

考虑环境因素,大家适当的对比自己的软硬件环境情况分析~请仔细阅读硬件、软件环境

1.1 硬件环境

MacOS Monterey 版本 12.6.8 Apple M1

1.2 软件环境

JD-GUI版本:jd-gui-osx-1.6.6

二、下载与安装

Github下载JD-GUI软件github java-decompiler/jd-gui Public

2.1 选择对应版本

macOS系统我们选择jd-gui-osx-1.6.6.tar压缩包即可;

在这里插入图片描述

2.2 解压运行排除异常:

解压后,进入文件打开JD-GUI;
在这里插入图片描述
【注】运行时需要注意自己环境已经安装了JDK,否则你可能会遇到这样的错误:

在这里插入图片描述
若是确认JDK安装后,仍然提示该错误,需要修改文件->显示包内容->Contents->MacOs->universalJavaApplicationStub.sh;
在这里插入图片描述
将内容替换成下面的内容:

#!/bin/bash
##################################################################################
#                                                                                #
# universalJavaApplicationStub                                                   #
#                                                                                #
# A BASH based JavaApplicationStub for Java Apps on Mac OS X                     #
# that works with both Apple's and Oracle's plist format.                        #
#                                                                                #
# Inspired by Ian Roberts stackoverflow answer                                   #
# at http://stackoverflow.com/a/17546508/1128689                                 #
#                                                                                #
# @author    Tobias Fischer                                                      #
# @url       https://github.com/tofi86/universalJavaApplicationStub              #
# @date      2020-03-19                                                          #
# @version   3.0.6                                                               #
#                                                                                #
##################################################################################
#                                                                                #
# The MIT License (MIT)                                                          #
#                                                                                #
# Copyright (c) 2014-2020 Tobias Fischer                                         #
#                                                                                #
# Permission is hereby granted, free of charge, to any person obtaining a copy   #
# of this software and associated documentation files (the "Software"), to deal  #
# in the Software without restriction, including without limitation the rights   #
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell      #
# copies of the Software, and to permit persons to whom the Software is          #
# furnished to do so, subject to the following conditions:                       #
#                                                                                #
# The above copyright notice and this permission notice shall be included in all #
# copies or substantial portions of the Software.                                #
#                                                                                #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR     #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,       #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE    #
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER         #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  #
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  #
# SOFTWARE.                                                                      #
#                                                                                #
################################################################################### function 'stub_logger()'
#
# A logger which logs to the macOS Console.app using the 'syslog' command
#
# @param1  the log message
# @return  void
################################################################################
function stub_logger() {syslog -s -k \Facility com.apple.console \Level Notice \Sender "$(basename "$0")" \Message "[$$][${CFBundleName:-$(basename "$0")}] $1"
}# set the directory abspath of the current
# shell script with symlinks being resolved
############################################PRG=$0
while [ -h "$PRG" ]; dols=$(ls -ld "$PRG")link=$(expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null)if expr "$link" : '^/' 2> /dev/null >/dev/null; thenPRG="$link"elsePRG="$(dirname "$PRG")/$link"fi
done
PROGDIR=$(dirname "$PRG")
stub_logger "[StubDir] $PROGDIR"# set files and folders
############################################# the absolute path of the app package
cd "$PROGDIR"/../../ || exit 11
AppPackageFolder=$(pwd)# the base path of the app package
cd .. || exit 12
AppPackageRoot=$(pwd)# set Apple's Java folder
AppleJavaFolder="${AppPackageFolder}"/Contents/Resources/Java# set Apple's Resources folder
AppleResourcesFolder="${AppPackageFolder}"/Contents/Resources# set Oracle's Java folder
OracleJavaFolder="${AppPackageFolder}"/Contents/Java# set Oracle's Resources folder
OracleResourcesFolder="${AppPackageFolder}"/Contents/Resources# set path to Info.plist in bundle
InfoPlistFile="${AppPackageFolder}"/Contents/Info.plist# set the default JVM Version to a null string
JVMVersion=""
JVMMaxVersion=""# function 'plist_get()'
#
# read a specific Plist key with 'PlistBuddy' utility
#
# @param1  the Plist key with leading colon ':'
# @return  the value as String or Array
################################################################################
plist_get(){/usr/libexec/PlistBuddy -c "print $1" "${InfoPlistFile}" 2> /dev/null
}# function 'plist_get_java()'
#
# read a specific Plist key with 'PlistBuddy' utility
# in the 'Java' or 'JavaX' dictionary (<dict>)
#
# @param1  the Plist :Java(X):Key with leading colon ':'
# @return  the value as String or Array
################################################################################
plist_get_java(){plist_get ${JavaKey:-":Java"}$1
}# read Info.plist and extract JVM options
############################################# read the program name from CFBundleName
CFBundleName=$(plist_get ':CFBundleName')# read the icon file name
CFBundleIconFile=$(plist_get ':CFBundleIconFile')# check Info.plist for Apple style Java keys -> if key :Java is present, parse in apple mode
/usr/libexec/PlistBuddy -c "print :Java" "${InfoPlistFile}" > /dev/null 2>&1
exitcode=$?
JavaKey=":Java"# if no :Java key is present, check Info.plist for universalJavaApplication style JavaX keys -> if key :JavaX is present, parse in apple mode
if [ $exitcode -ne 0 ]; then/usr/libexec/PlistBuddy -c "print :JavaX" "${InfoPlistFile}" > /dev/null 2>&1exitcode=$?JavaKey=":JavaX"
fi# read 'Info.plist' file in Apple style if exit code returns 0 (true, ':Java' key is present)
if [ $exitcode -eq 0 ]; thenstub_logger "[PlistStyle] Apple"# set Java and Resources folderJavaFolder="${AppleJavaFolder}"ResourcesFolder="${AppleResourcesFolder}"APP_PACKAGE="${AppPackageFolder}"JAVAROOT="${AppleJavaFolder}"USER_HOME="$HOME"# read the Java WorkingDirectoryJVMWorkDir=$(plist_get_java ':WorkingDirectory' | xargs)# set Working Directory based upon PList valueif [[ ! -z ${JVMWorkDir} ]]; thenWorkingDirectory="${JVMWorkDir}"else# AppPackageRoot is the standard WorkingDirectory when the script is startedWorkingDirectory="${AppPackageRoot}"fi# expand variables $APP_PACKAGE, $JAVAROOT, $USER_HOMEWorkingDirectory=$(eval echo "${WorkingDirectory}")# read the MainClass nameJVMMainClass="$(plist_get_java ':MainClass')"# read the SplashFile nameJVMSplashFile=$(plist_get_java ':SplashFile')# read the JVM Properties as an array and retain spacesIFS=$'\t\n'JVMOptions=($(xargs -n1 <<<$(plist_get_java ':Properties' | grep " =" | sed 's/^ */-D/g' | sed -E 's/ = (.*)$/="\1"/g')))unset IFS# post processing of the array follows further below...# read the ClassPath in either Array or String styleJVMClassPath_RAW=$(plist_get_java ':ClassPath' | xargs)if [[ $JVMClassPath_RAW == *Array* ]] ; thenJVMClassPath=.$(plist_get_java ':ClassPath' | grep "    " | sed 's/^ */:/g' | tr -d '\n' | xargs)elseJVMClassPath=${JVMClassPath_RAW}fi# expand variables $APP_PACKAGE, $JAVAROOT, $USER_HOMEJVMClassPath=$(eval echo "${JVMClassPath}")# read the JVM Options in either Array or String styleJVMDefaultOptions_RAW=$(plist_get_java ':VMOptions' | xargs)if [[ $JVMDefaultOptions_RAW == *Array* ]] ; thenJVMDefaultOptions=$(plist_get_java ':VMOptions' | grep "    " | sed 's/^ */ /g' | tr -d '\n' | xargs)elseJVMDefaultOptions=${JVMDefaultOptions_RAW}fi# read StartOnMainThread and add as -XstartOnFirstThreadJVMStartOnMainThread=$(plist_get_java ':StartOnMainThread')if [ "${JVMStartOnMainThread}" == "true" ]; thenJVMDefaultOptions+=" -XstartOnFirstThread"fi# read the JVM Arguments in either Array or String style (#76) and retain spacesIFS=$'\t\n'MainArgs_RAW=$(plist_get_java ':Arguments' | xargs)if [[ $MainArgs_RAW == *Array* ]] ; thenMainArgs=($(xargs -n1 <<<$(plist_get_java ':Arguments' | tr -d '\n' | sed -E 's/Array \{ *(.*) *\}/\1/g' | sed 's/  */ /g')))elseMainArgs=($(xargs -n1 <<<$(plist_get_java ':Arguments')))fiunset IFS# post processing of the array follows further below...# read the Java version we want to findJVMVersion=$(plist_get_java ':JVMVersion' | xargs)# post processing of the version string follows below...# read 'Info.plist' file in Oracle style
elsestub_logger "[PlistStyle] Oracle"# set Working Directory and Java and Resources folderJavaFolder="${OracleJavaFolder}"ResourcesFolder="${OracleResourcesFolder}"WorkingDirectory="${OracleJavaFolder}"APP_ROOT="${AppPackageFolder}"# read the MainClass nameJVMMainClass="$(plist_get ':JVMMainClassName')"# read the SplashFile nameJVMSplashFile=$(plist_get ':JVMSplashFile')# read the JVM Options as an array and retain spacesIFS=$'\t\n'JVMOptions=($(plist_get ':JVMOptions' | grep "    " | sed 's/^ *//g'))unset IFS# post processing of the array follows further below...# read the ClassPath in either Array or String styleJVMClassPath_RAW=$(plist_get ':JVMClassPath')if [[ $JVMClassPath_RAW == *Array* ]] ; thenJVMClassPath=.$(plist_get ':JVMClassPath' | grep "    " | sed 's/^ */:/g' | tr -d '\n' | xargs)# expand variables $APP_PACKAGE, $JAVAROOT, $USER_HOMEJVMClassPath=$(eval echo "${JVMClassPath}")elif [[ ! -z ${JVMClassPath_RAW} ]] ; thenJVMClassPath=${JVMClassPath_RAW}# expand variables $APP_PACKAGE, $JAVAROOT, $USER_HOMEJVMClassPath=$(eval echo "${JVMClassPath}")else#default: fallback to OracleJavaFolderJVMClassPath="${JavaFolder}/*"# Do NOT expand the default 'AppName.app/Contents/Java/*' classpath (#42)fi# read the JVM Default OptionsJVMDefaultOptions=$(plist_get ':JVMDefaultOptions' | grep -o " \-.*" | tr -d '\n' | xargs)# read the Main Arguments from JVMArguments key as an array and retain spaces (see #46 for naming details)IFS=$'\t\n'MainArgs=($(xargs -n1 <<<$(plist_get ':JVMArguments' | tr -d '\n' | sed -E 's/Array \{ *(.*) *\}/\1/g' | sed 's/  */ /g')))unset IFS# post processing of the array follows further below...# read the Java version we want to findJVMVersion=$(plist_get ':JVMVersion' | xargs)# post processing of the version string follows below...
fi# (#75) check for undefined icons or icon names without .icns extension and prepare
# an osascript statement for those cases when the icon can be shown in the dialog
DialogWithIcon=""
if [ ! -z ${CFBundleIconFile} ]; thenif [[ ${CFBundleIconFile} == *.icns ]] && [[ -f "${ResourcesFolder}/${CFBundleIconFile}" ]] ; thenDialogWithIcon=" with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)"elif [[ ${CFBundleIconFile} != *.icns ]] && [[ -f "${ResourcesFolder}/${CFBundleIconFile}.icns" ]] ; thenCFBundleIconFile+=".icns"DialogWithIcon=" with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)"fi
fi# JVMVersion: post processing and optional splitting
if [[ ${JVMVersion} == *";"* ]]; thenminMaxArray=(${JVMVersion//;/ })JVMVersion=${minMaxArray[0]//+}JVMMaxVersion=${minMaxArray[1]//+}
fi
stub_logger "[JavaRequirement] JVM minimum version: ${JVMVersion}"
stub_logger "[JavaRequirement] JVM maximum version: ${JVMMaxVersion}"# MainArgs: replace occurences of $APP_ROOT with its content
MainArgsArr=()
for i in "${MainArgs[@]}"
doMainArgsArr+=("$(eval echo "$i")")
done# JVMOptions: replace occurences of $APP_ROOT with its content
JVMOptionsArr=()
for i in "${JVMOptions[@]}"
doJVMOptionsArr+=("$(eval echo "$i")")
done# internationalized messages
############################################LANG=$(defaults read -g AppleLocale)
stub_logger "[Language] $LANG"# French localization
if [[ $LANG == fr* ]] ; thenMSG_ERROR_LAUNCHING="ERREUR au lancement de '${CFBundleName}'."MSG_MISSING_MAINCLASS="'MainClass' n'est pas spécifié.\nL'application Java ne peut pas être lancée."MSG_JVMVERSION_REQ_INVALID="La syntaxe de la version de Java demandée est invalide: %s\nVeuillez contacter le développeur de l'application."MSG_NO_SUITABLE_JAVA="La version de Java installée sur votre système ne convient pas.\nCe programme nécessite Java %s"MSG_JAVA_VERSION_OR_LATER="ou ultérieur"MSG_JAVA_VERSION_LATEST="(dernière mise à jour)"MSG_JAVA_VERSION_MAX="à %s"MSG_NO_SUITABLE_JAVA_CHECK="Merci de bien vouloir installer la version de Java requise."MSG_INSTALL_JAVA="Java doit être installé sur votre système.\nRendez-vous sur java.com et suivez les instructions d'installation..."MSG_LATER="Plus tard"MSG_VISIT_JAVA_DOT_COM="Java by Oracle"MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"# German localization
elif [[ $LANG == de* ]] ; thenMSG_ERROR_LAUNCHING="FEHLER beim Starten von '${CFBundleName}'."MSG_MISSING_MAINCLASS="Die 'MainClass' ist nicht spezifiziert!\nDie Java-Anwendung kann nicht gestartet werden!"MSG_JVMVERSION_REQ_INVALID="Die Syntax der angeforderten Java-Version ist ungültig: %s\nBitte kontaktieren Sie den Entwickler der App."MSG_NO_SUITABLE_JAVA="Es wurde keine passende Java-Version auf Ihrem System gefunden!\nDieses Programm benötigt Java %s"MSG_JAVA_VERSION_OR_LATER="oder neuer"MSG_JAVA_VERSION_LATEST="(neuste Unterversion)"MSG_JAVA_VERSION_MAX="bis %s"MSG_NO_SUITABLE_JAVA_CHECK="Stellen Sie sicher, dass die angeforderte Java-Version installiert ist."MSG_INSTALL_JAVA="Auf Ihrem System muss die 'Java'-Software installiert sein.\nBesuchen Sie java.com für weitere Installationshinweise."MSG_LATER="Später"MSG_VISIT_JAVA_DOT_COM="Java von Oracle"MSG_VISIT_ADOPTOPENJDK="Java von AdoptOpenJDK"# Simplifyed Chinese localization
elif [[ $LANG == zh* ]] ; thenMSG_ERROR_LAUNCHING="无法启动 '${CFBundleName}'."MSG_MISSING_MAINCLASS="没有指定 'MainClass'!\nJava程序无法启动!"MSG_JVMVERSION_REQ_INVALID="Java版本参数语法错误: %s\n请联系该应用的开发者。"MSG_NO_SUITABLE_JAVA="没有在系统中找到合适的Java版本!\n必须安装Java %s才能够使用该程序!"MSG_JAVA_VERSION_OR_LATER="及以上版本"MSG_JAVA_VERSION_LATEST="(最新版本)"MSG_JAVA_VERSION_MAX="最高为 %s"MSG_NO_SUITABLE_JAVA_CHECK="请确保系统中安装了所需的Java版本"MSG_INSTALL_JAVA="你需要在Mac中安装Java运行环境!\n访问 java.com 了解如何安装。"MSG_LATER="稍后"MSG_VISIT_JAVA_DOT_COM="Java by Oracle"MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"# English default localization
elseMSG_ERROR_LAUNCHING="ERROR launching '${CFBundleName}'."MSG_MISSING_MAINCLASS="'MainClass' isn't specified!\nJava application cannot be started!"MSG_JVMVERSION_REQ_INVALID="The syntax of the required Java version is invalid: %s\nPlease contact the App developer."MSG_NO_SUITABLE_JAVA="No suitable Java version found on your system!\nThis program requires Java %s"MSG_JAVA_VERSION_OR_LATER="or later"MSG_JAVA_VERSION_LATEST="(latest update)"MSG_JAVA_VERSION_MAX="up to %s"MSG_NO_SUITABLE_JAVA_CHECK="Make sure you install the required Java version."MSG_INSTALL_JAVA="You need to have JAVA installed on your Mac!\nVisit java.com for installation instructions..."MSG_LATER="Later"MSG_VISIT_JAVA_DOT_COM="Java by Oracle"MSG_VISIT_ADOPTOPENJDK="Java by AdoptOpenJDK"
fi# function 'get_java_version_from_cmd()'
#
# returns Java version string from 'java -version' command
# works for both old (1.8) and new (9) version schema
#
# @param1  path to a java JVM executable
# @return  the Java version number as displayed in 'java -version' command
################################################################################
function get_java_version_from_cmd() {# second sed command strips " and -ea from the version stringecho $("$1" -version 2>&1 | awk '/version/{print $3}' | sed -E 's/"//g;s/-ea//g')
}# function 'extract_java_major_version()'
#
# extract Java major version from a version string
#
# @param1  a Java version number ('1.8.0_45') or requirement string ('1.8+')
# @return  the major version (e.g. '7', '8' or '9', etc.)
################################################################################
function extract_java_major_version() {echo $(echo "$1" | sed -E 's/^1\.//;s/^([0-9]+)(-ea|(\.[0-9_.]{1,7})?)(-b[0-9]+-[0-9]+)?[+*]?$/\1/')
}# function 'get_comparable_java_version()'
#
# return comparable version for a Java version number or requirement string
#
# @param1  a Java version number ('1.8.0_45') or requirement string ('1.8+')
# @return  an 8 digit numeral ('1.8.0_45'->'08000045'; '9.1.13'->'09001013')
################################################################################
function get_comparable_java_version() {# cleaning: 1) remove leading '1.'; 2) remove build string (e.g. '-b14-468'); 3) remove 'a-Z' and '-*+' (e.g. '-ea'); 4) replace '_' with '.'local cleaned=$(echo "$1" | sed -E 's/^1\.//g;s/-b[0-9]+-[0-9]+$//g;s/[a-zA-Z+*\-]//g;s/_/./g')# splitting at '.' into an arraylocal arr=( ${cleaned//./ } )# echo a string with left padded version numbersecho "$(printf '%02s' ${arr[0]})$(printf '%03s' ${arr[1]})$(printf '%03s' ${arr[2]})"
}# function 'is_valid_requirement_pattern()'
#
# check whether the Java requirement is a valid requirement pattern
#
# supported requirements are for example:
# - 1.6       requires Java 6 (any update)      [1.6, 1.6.0_45, 1.6.0_88]
# - 1.6*      requires Java 6 (any update)      [1.6, 1.6.0_45, 1.6.0_88]
# - 1.6+      requires Java 6 or higher         [1.6, 1.6.0_45, 1.8, 9, etc.]
# - 1.6.0     requires Java 6 (any update)      [1.6, 1.6.0_45, 1.6.0_88]
# - 1.6.0_45  requires Java 6u45                [1.6.0_45]
# - 1.6.0_45+ requires Java 6u45 or higher      [1.6.0_45, 1.6.0_88, 1.8, etc.]
# - 9         requires Java 9 (any update)      [9.0.*, 9.1, 9.3, etc.]
# - 9*        requires Java 9 (any update)      [9.0.*, 9.1, 9.3, etc.]
# - 9+        requires Java 9 or higher         [9.0, 9.1, 10, etc.]
# - 9.1       requires Java 9.1 (any update)    [9.1.*, 9.1.2, 9.1.13, etc.]
# - 9.1*      requires Java 9.1 (any update)    [9.1.*, 9.1.2, 9.1.13, etc.]
# - 9.1+      requires Java 9.1 or higher       [9.1, 9.2, 10, etc.]
# - 9.1.3     requires Java 9.1.3               [9.1.3]
# - 9.1.3*    requires Java 9.1.3 (any update)  [9.1.3]
# - 9.1.3+    requires Java 9.1.3 or higher     [9.1.3, 9.1.4, 9.2.*, 10, etc.]
# - 10-ea     requires Java 10 (early access release)
#
# unsupported requirement patterns are for example:
# - 1.2, 1.3, 1.9       Java 2, 3 are not supported
# - 1.9                 Java 9 introduced a new versioning scheme
# - 6u45                known versioning syntax, but unsupported
# - 9-ea*, 9-ea+        early access releases paired with */+
# - 9., 9.*, 9.+        version ending with a .
# - 9.1., 9.1.*, 9.1.+  version ending with a .
# - 9.3.5.6             4 part version number is unsupported
#
# @param1  a Java requirement string ('1.8+')
# @return  boolean exit code: 0 (is valid), 1 (is not valid)
################################################################################
function is_valid_requirement_pattern() {local java_req=$1java8pattern='1\.[4-8](\.[0-9]+)?(\.0_[0-9]+)?[*+]?'java9pattern='(9|1[0-9])(-ea|[*+]|(\.[0-9]+){1,2}[*+]?)?'# test matches either old Java versioning scheme (up to 1.8) or new scheme (starting with 9)if [[ ${java_req} =~ ^(${java8pattern}|${java9pattern})$ ]]; thenreturn 0elsereturn 1fi
}# determine which JVM to use
############################################# default Apple JRE plugin path (< 1.6)
apple_jre_plugin="/Library/Java/Home/bin/java"
apple_jre_version=$(get_java_version_from_cmd "${apple_jre_plugin}")
# default Oracle JRE plugin path (>= 1.7)
oracle_jre_plugin="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java"
oracle_jre_version=$(get_java_version_from_cmd "${oracle_jre_plugin}")# first check system variable "$JAVA_HOME" -> has precedence over any other System JVM
stub_logger '[JavaSearch] Checking for $JAVA_HOME ...'
if [ -n "$JAVA_HOME" ] ; thenstub_logger "[JavaSearch] ... found JAVA_HOME with value $JAVA_HOME"# PR 26: Allow specifying "$JAVA_HOME" relative to "$AppPackageFolder"# which allows for bundling a custom version of Java inside your app!if [[ $JAVA_HOME == /* ]] ; then# if "$JAVA_HOME" starts with a Slash it's an absolute pathJAVACMD="$JAVA_HOME/bin/java"else# otherwise it's a relative path to "$AppPackageFolder"JAVACMD="$AppPackageFolder/$JAVA_HOME/bin/java"fiJAVACMD_version=$(get_comparable_java_version $(get_java_version_from_cmd "${JAVACMD}"))
elsestub_logger "[JavaSearch] ... didn't found JAVA_HOME"
fi# check for any other or a specific Java version
# also if $JAVA_HOME exists but isn't executable
if [ -z "${JAVACMD}" ] || [ ! -x "${JAVACMD}" ] ; thenstub_logger "[JavaSearch] Checking for JavaVirtualMachines on the system ..."# reset variablesJAVACMD=""JAVACMD_version=""# first check whether JVMVersion string is a valid requirement stringif [ ! -z "${JVMVersion}" ] && ! is_valid_requirement_pattern ${JVMVersion} ; thenMSG_JVMVERSION_REQ_INVALID_EXPANDED=$(printf "${MSG_JVMVERSION_REQ_INVALID}" "${JVMVersion}")# log exit causestub_logger "[EXIT 4] ${MSG_JVMVERSION_REQ_INVALID_EXPANDED}"# display error message with AppleScriptosascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_JVMVERSION_REQ_INVALID_EXPANDED}\" with title \"${CFBundleName}\" buttons {\" OK \"} default button 1${DialogWithIcon}"# exit with errorexit 4fi# then check whether JVMMaxVersion string is a valid requirement stringif [ ! -z "${JVMMaxVersion}" ] && ! is_valid_requirement_pattern ${JVMMaxVersion} ; thenMSG_JVMVERSION_REQ_INVALID_EXPANDED=$(printf "${MSG_JVMVERSION_REQ_INVALID}" "${JVMMaxVersion}")# log exit causestub_logger "[EXIT 5] ${MSG_JVMVERSION_REQ_INVALID_EXPANDED}"# display error message with AppleScriptosascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_JVMVERSION_REQ_INVALID_EXPANDED}\" with title \"${CFBundleName}\" buttons {\" OK \"} default button 1${DialogWithIcon}"# exit with errorexit 5fi# find installed JavaVirtualMachines (JDK + JRE)allJVMs=()# read JDK's from '/usr/libexec/java_home -V' commandwhile read -r line; doversion=$(echo $line | awk -F $',' '{print $1;}')path=$(echo $line | awk -F $'" ' '{print $2;}')path+="/bin/java"allJVMs+=("$version:$path")done < <(/usr/libexec/java_home -V 2>&1 | grep '^[[:space:]]')# unset while loop variablesunset version path# add Apple JRE if availableif [ -x "${apple_jre_plugin}" ] ; thenallJVMs+=("$apple_jre_version:$apple_jre_plugin")fi# add Oracle JRE if availableif [ -x "${oracle_jre_plugin}" ] ; thenallJVMs+=("$oracle_jre_version:$oracle_jre_plugin")fi# debug outputfor i in "${allJVMs[@]}"dostub_logger "[JavaSearch] ... found JVM: $i"done# determine JVMs matching the min/max version requirementminC=$(get_comparable_java_version ${JVMVersion})maxC=$(get_comparable_java_version ${JVMMaxVersion})matchingJVMs=()for i in "${allJVMs[@]}"do# split JVM string at ':' delimiter to retain spaces in $path substringIFS=: arr=($i) ; unset IFS# [0] JVM version numberver=${arr[0]}# comparable JVM version numbercomp=$(get_comparable_java_version $ver)# [1] JVM pathpath="${arr[1]}"# construct string item for adding to the "matchingJVMs" arrayitem="$comp:$ver:$path"# pre-requisite: current version number needs to be greater than min version numberif [ "$comp" -ge "$minC" ] ; then# perform max version checks if max version requirement is presentif [ ! -z ${JVMMaxVersion} ] ; then# max version requirement ends with '*' modifierif [[ ${JVMMaxVersion} == *\* ]] ; then# use the '*' modifier from the max version string as wildcard for a 'starts with' comparison# and check whether the current version number starts with the max version wildcard stringif [[ ${ver} == ${JVMMaxVersion} ]]; thenmatchingJVMs+=("$item")# or whether the current comparable version is lower than the comparable max versionelif [ "$comp" -le "$maxC" ] ; thenmatchingJVMs+=("$item")fi# max version requirement ends with '+' modifier -> always add this version if it's greater than $min# because a max requirement with + modifier doesn't make senseelif [[ ${JVMMaxVersion} == *+ ]] ; thenmatchingJVMs+=("$item")# matches 6 zeros at the end of the max version string (e.g. for 1.8, 9)# -> then the max version string should be treated like with a '*' modifier at the end#elif [[ ${maxC} =~ ^[0-9]{2}0{6}$ ]] && [ "$comp" -le $(( ${maxC#0} + 999 )) ] ; then#	matchingJVMs+=("$item")# matches 3 zeros at the end of the max version string (e.g. for 9.1, 10.3)# -> then the max version string should be treated like with a '*' modifier at the end#elif [[ ${maxC} =~ ^[0-9]{5}0{3}$ ]] && [ "$comp" -le "${maxC}" ] ; then#	matchingJVMs+=("$item")# matches standard requirements without modifierelif [ "$comp" -le "$maxC" ]; thenmatchingJVMs+=("$item")fi# no max version requirement:# min version requirement ends with '+' modifier# -> always add the current version because it's greater than $minelif [[ ${JVMVersion} == *+ ]] ; thenmatchingJVMs+=("$item")# min version requirement ends with '*' modifier# -> use the '*' modifier from the min version string as wildcard for a 'starts with' comparison#    and check whether the current version number starts with the min version wildcard stringelif [[ ${JVMVersion} == *\* ]] ; thenif [[ ${ver} == ${JVMVersion} ]] ; thenmatchingJVMs+=("$item")fi# compare the min version against the current version with an additional * wildcard for a 'starts with' comparison# -> e.g. add 1.8.0_44 when the requirement is 1.8elif [[ ${ver} == ${JVMVersion}* ]] ; thenmatchingJVMs+=("$item")fifidone# unset for loop variablesunset arr ver comp path item# debug outputfor i in "${matchingJVMs[@]}"dostub_logger "[JavaSearch] ... ... matches all requirements: $i"done# sort the matching JavaVirtualMachines by version number# https://stackoverflow.com/a/11789688/1128689IFS=$'\n' matchingJVMs=($(sort -nr <<<"${matchingJVMs[*]}"))unset IFS# get the highest matching JVMfor ((i = 0; i < ${#matchingJVMs[@]}; i++));do# split JVM string at ':' delimiter to retain spaces in $path substringIFS=: arr=(${matchingJVMs[$i]}) ; unset IFS# [0] comparable JVM version numbercomp=${arr[0]}# [1] JVM version numberver=${arr[1]}# [2] JVM pathpath="${arr[2]}"# use current value as JAVACMD if it's executableif [ -x "$path" ] ; thenJAVACMD="$path"JAVACMD_version=$compbreakfidone# unset for loop variablesunset arr comp ver path
fi# log the Java Command and the extracted version number
stub_logger "[JavaCommand] '$JAVACMD'"
stub_logger "[JavaVersion] $(get_java_version_from_cmd "${JAVACMD}")${JAVACMD_version:+ / $JAVACMD_version}"if [ -z "${JAVACMD}" ] || [ ! -x "${JAVACMD}" ] ; then# different error messages when a specific JVM was requiredif [ ! -z "${JVMVersion}" ] ; then# display human readable java version (#28)java_version_hr=$(echo ${JVMVersion} | sed -E 's/^1\.([0-9+*]+)$/ \1/g' | sed "s/+/ ${MSG_JAVA_VERSION_OR_LATER}/;s/*/ ${MSG_JAVA_VERSION_LATEST}/")MSG_NO_SUITABLE_JAVA_EXPANDED=$(printf "${MSG_NO_SUITABLE_JAVA}" "${java_version_hr}").if [ ! -z "${JVMMaxVersion}" ] ; thenjava_version_hr=$(extract_java_major_version ${JVMVersion})java_version_max_hr=$(echo ${JVMMaxVersion} | sed -E 's/^1\.([0-9+*]+)$/ \1/g' | sed "s/+//;s/*/ ${MSG_JAVA_VERSION_LATEST}/")MSG_NO_SUITABLE_JAVA_EXPANDED="$(printf "${MSG_NO_SUITABLE_JAVA}" "${java_version_hr}") $(printf "${MSG_JAVA_VERSION_MAX}" "${java_version_max_hr}")"fi# log exit causestub_logger "[EXIT 3] ${MSG_NO_SUITABLE_JAVA_EXPANDED}"# display error message with AppleScriptosascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_NO_SUITABLE_JAVA_EXPANDED}\n${MSG_NO_SUITABLE_JAVA_CHECK}\" with title \"${CFBundleName}\"  buttons {\" OK \", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTOPENJDK}\"} default button 1${DialogWithIcon}" \-e "set response to button returned of the result" \-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \-e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\""# exit with errorexit 3else# log exit causestub_logger "[EXIT 1] ${MSG_ERROR_LAUNCHING}"# display error message with AppleScriptosascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_INSTALL_JAVA}\" with title \"${CFBundleName}\" buttons {\"${MSG_LATER}\", \"${MSG_VISIT_JAVA_DOT_COM}\", \"${MSG_VISIT_ADOPTOPENJDK}\"} default button 1${DialogWithIcon}" \-e "set response to button returned of the result" \-e "if response is \"${MSG_VISIT_JAVA_DOT_COM}\" then open location \"https://www.java.com/download/\"" \-e "if response is \"${MSG_VISIT_ADOPTOPENJDK}\" then open location \"https://adoptopenjdk.net/releases.html\""# exit with errorexit 1fi
fi# MainClass check
############################################if [ -z "${JVMMainClass}" ]; then# log exit causestub_logger "[EXIT 2] ${MSG_MISSING_MAINCLASS}"# display error message with AppleScriptosascript -e "tell application \"System Events\" to display dialog \"${MSG_ERROR_LAUNCHING}\n\n${MSG_MISSING_MAINCLASS}\" with title \"${CFBundleName}\" buttons {\" OK \"} default button 1${DialogWithIcon}"# exit with errorexit 2
fi# execute $JAVACMD and do some preparation
############################################# enable drag&drop to the dock icon
export CFProcessPath="$0"# remove Apples ProcessSerialNumber from passthru arguments (#39)
if [[ "$*" == -psn* ]] ; thenArgsPassthru=()
elseArgsPassthru=("$@")
fi# change to Working Directory based upon Apple/Oracle Plist info
cd "${WorkingDirectory}" || exit 13
stub_logger "[WorkingDirectory] ${WorkingDirectory}"# execute Java and set
# - classpath
# - splash image
# - dock icon
# - app name
# - JVM options / properties (-D)
# - JVM default options (-X)
# - main class
# - main class arguments
# - passthrough arguments from Terminal or Drag'n'Drop to Finder icon
stub_logger "[Exec] \"$JAVACMD\" -cp \"${JVMClassPath}\" -splash:\"${ResourcesFolder}/${JVMSplashFile}\" -Xdock:icon=\"${ResourcesFolder}/${CFBundleIconFile}\" -Xdock:name=\"${CFBundleName}\" ${JVMOptionsArr:+$(printf "'%s' " "${JVMOptionsArr[@]}") }${JVMDefaultOptions:+$JVMDefaultOptions }${JVMMainClass}${MainArgsArr:+ $(printf "'%s' " "${MainArgsArr[@]}")}${ArgsPassthru:+ $(printf "'%s' " "${ArgsPassthru[@]}")}"
exec "${JAVACMD}" \-cp "${JVMClassPath}" \-splash:"${ResourcesFolder}/${JVMSplashFile}" \-Xdock:icon="${ResourcesFolder}/${CFBundleIconFile}" \-Xdock:name="${CFBundleName}" \${JVMOptionsArr:+"${JVMOptionsArr[@]}" }\${JVMDefaultOptions:+$JVMDefaultOptions }\"${JVMMainClass}"\${MainArgsArr:+ "${MainArgsArr[@]}"}\${ArgsPassthru:+ "${ArgsPassthru[@]}"}

2.3 关于使用

打开软件,选择自己要反编译的文件即可;
在这里插入图片描述
确认文件打开之后,我们就能看到反编译的源代码了;
在这里插入图片描述

三、最后

Windows的宝子们,方法上大同小异的,除了下载包区分一下,其他基本一致的问题;

相关文章:

【JD-GUI】MacOS 中使用Java反编译工具JD-GUI

希望文章能给到你启发和灵感&#xff5e; 如果觉得文章对你有帮助的话&#xff0c;点赞 关注 收藏 支持一下博主吧&#xff5e; 阅读指南 开篇说明概念理解一、基础环境说明1.1 硬件环境1.2 软件环境 二、下载与安装2.1 选择对应版本2.2 解压运行排除异常&#xff1a;2.3 关于…...

C++:求梯形面积

梯形面积 已知上底15厘米&#xff0c;下底25厘米&#xff0c;问梯形面积值是多少&#xff1f; #include<iostream> using namespace std; int main() {//梯形的面积公式&#xff08;上底下底&#xff09; 高 2//上底变量、下底变量int s,d,h,m;s15;d25;h 2*150 * 2/s ;…...

学会python——在excel中写入数据(python实例十三)

目录 1.认识Python 2.环境与工具 2.1 python环境 2.2 Visual Studio Code编译 3 .想Excel中写入数据 3.1 代码构思 3.2 代码实例 3.3 运行结果 4.总结 1.认识Python Python 是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本语言。 Python 的设计具有很强的…...

Stable Diffusion【基础篇】:降噪强度(denoising strength)

提到降噪强度&#xff08;denoising strength&#xff09;&#xff0c;大家一定不会陌生&#xff0c;这个参数是图生图中最关键的参数之一。今天在Stable Diffusion Art网站看到一篇介绍降噪强度&#xff08;denoising strength&#xff09;的文章&#xff08;地址&#xff1a;…...

【Python】语法入门

文章目录 Python 基础语法&#xff1a;打印和变量打印和变量的基本语法打印变量 变量操作变量的命名规则打印和变量的应用场景示例&#xff1a;基本计算器 Python 基础语法&#xff1a;列表推导式列表推导式的基本语法基本示例带条件的列表推导式列表推导式的应用场景 Python 基…...

匠心独运:红酒与手工艺的很好结合

在岁月的长河中&#xff0c;红酒与手工艺都以其不同的魅力和技艺&#xff0c;书写着各自的故事。当这两者相遇&#xff0c;仿佛是一场跨越时空的对话&#xff0c;不仅展现了匠心独运的技艺之美&#xff0c;更在无声中诉说着对品质与生活的热爱。今天&#xff0c;就让我们一起探…...

第20章 Mac+VSCode配置C++环境

1. 下载VSCode VSCode下载地址在mac终端里输入xcode- select --install命令&#xff0c;根据提示安装xcode工具。 2. 安装插件&#xff08;4个&#xff09; 打开VScode&#xff0c;点击应用右侧菜单栏 C/C&#xff08;必装&#xff09; Code Runner&#xff08;必装&#xf…...

FactoryBean 原理简介

FactoryBean 首先是一个工厂类&#xff0c;它可以生产指定的Bean&#xff0c;特殊之处在于它可以向Spring容器中注册两个Bean&#xff0c;一个是它本身&#xff0c;一个是FactoryBean.getObject()方法返回值所代表的Bean。通过实现 FactoryBean 接口&#xff0c;你可以控制某个…...

Redis中hash类型的操作命令(命令的语法、返回值、时间复杂度、注意事项、操作演示)

文章目录 字符串和哈希类型相比hset 命令hget 命令hexistshdelhkeyshvalshgetallhmgethlenhsetnxhincrbyhincrbyfloat 字符串和哈希类型相比 假设有以下一种场景&#xff1a;现在要在 Redis 中存储一个用户的基本信息(id1、namezhangsan、age17)&#xff0c;下图表示使用字符串…...

UE5基本操作(二)

文章目录 前言相机的移动速度修改默认地图使用初学者内容包文件夹结构 总结 前言 在我们的上一篇文章中&#xff0c;我们已经介绍了一些Unreal Engine 5&#xff08;UE5&#xff09;的基本操作。UE5是一款强大的游戏开发引擎&#xff0c;它提供了许多工具和功能&#xff0c;使…...

React Navigation 和 Expo Router

React Navigation 是 React Native 社区最常用的导航库&#xff0c;其具有高度可定制性且性能良好的特性。它提供了一系列导航器&#xff08;如堆栈导航器、标签导航器、抽屉导航器等&#xff09;&#xff0c;可以满足绝大多数的页面导航需求。 Expo Router 是 Expo 官方最新发…...

如何使用python网络爬虫批量获取公共资源数据教程?

原文链接&#xff1a;如何使用python网络爬虫批量获取公共资源数据教程&#xff1f;https://mp.weixin.qq.com/s?__bizMzUzNTczMDMxMg&mid2247608240&idx4&snef281f66727afabfaae2066c6e92f792&chksmfa826657cdf5ef41571115328a09b9d34367d8b11415d5a5781dc4c…...

常见位运算总结

1.基础位运算 左移 &#xff08;<<&#xff09;: 最左侧位不要了, 最右侧补 0 右移&#xff08;>>&#xff09;: 最右侧位不要了, 最左侧补符号位(正数补0, 负数补1) 按位取反&#xff08;~&#xff09;&#xff1a;如果该位为 0 则转为 1, 如果该位为 1 则转为…...

自动化任务工具 -- zTasker v1.94 绿色版

软件简介 zTasker 是一款功能强大的自动化任务管理软件&#xff0c;以其简洁易用、一键式操作而著称。软件体积小巧&#xff0c;启动迅速&#xff0c;提供了超过100种任务类型和30多种定时/条件执行方法&#xff0c;能够满足用户在自动化方面的多样化需求。 zTasker 支持定时任…...

mybatis mapper.xml 比较运算符(大于|小于|等于)的写法: 转义和<![CDATA[]]>

文章目录 引言I 使用xml 原生转义的方式进行转义II 使用 <![CDATA[ 内容 ]]>引言 应用场景:查询时间范围 背景:在 *.xml 中使用常规的 < > = <= >= 会与xml的语法存在冲突 <![CDATA[]]> 比 转义符 来的繁琐 <![CDATA[]]> 表示xml解析器忽略…...

UE5的基本操作

涵盖了从建模、快捷键使用、界面操作到性能分析等多个方面&#xff0c;以下是一些关键点和技巧&#xff1a;12 建模操作&#xff1a; 使用Shift5切换到建模模式&#xff0c;可以通过Shapes创建基本图元如立方体、球体等。 利用Create面板中的工具&#xff0c;如polyext自由创…...

C++ 实现学生成绩管理系统

C 实现学生成绩管理系统 思路&#xff1a; 定义 Student 类&#xff0c;包含学生的基本信息和成绩。实现添加学生、删除学生、修改成绩、显示所有学生成绩和查找学生的功能。使用向量&#xff08;vector&#xff09;存储学生信息。 #include <iostream> #include <…...

Elasticsearch 第四期:搜索和过滤

序 2024年4月&#xff0c;小组计算建设标签平台&#xff0c;使用ES等工具建了一个demo&#xff0c;由于领导变动关系&#xff0c;项目基本夭折。其实这两年也陆陆续续接触和使用过ES&#xff0c;两年前也看过ES的官网&#xff0c;当时刚毕业半年多&#xff0c;由于历史局限性导…...

力扣1124.表现良好的最长时间段

力扣1124.表现良好的最长时间段 哈希表存最小的下标 当s[i] > 0 那么他到头可以构成一个合法时间段否则 找到之前的 s[i] - 1 的下标&#xff1a; 因为连续的前缀和一定只相差1若想算更小的s[i] - 2,s[i] - 3…一定会先算到s[i] - 1那么这些更小数必然在 s[i]−1 首次出现的…...

算法训练营day67

题目1&#xff1a; #include <iostream> #include <vector> #include <string> #include <unordered_set> #include <unordered_map> #include <queue>using namespace std;int main() {string beginStr, endStr;int n;cin >> n;ci…...

人工智能--图像语义分割

个人主页&#xff1a;欢迎来到 Papicatch的博客 课设专栏 &#xff1a;学生成绩管理系统 专业知识专栏&#xff1a;专业知识 ​ 文章目录 &#x1f349;引言 &#x1f349;介绍 &#x1f348;工作原理 &#x1f34d;数据准备 &#x1f34d;特征提取 &#x1f34d;像素分…...

fl studio20和21用哪一个好?FL-Chan from FL Studio欣赏

最近接到很多小伙伴的私信&#xff0c;都在问我平时会使用哪些音乐软件&#xff0c;能不能给一些参考。其实每个人的使用习惯不一样&#xff0c;需求也不一样。以DAW为例&#xff0c;有些人就是喜欢FL Studio&#xff0c;有些人吹爆Studio One&#xff0c;还有些人习惯使用Cuba…...

OpenCV直方图计算函数calcHist的使用

操作系统&#xff1a;ubuntu22.04OpenCV版本&#xff1a;OpenCV4.9IDE:Visual Studio Code编程语言&#xff1a;C11 功能描述 图像的直方图是一种统计表示方法&#xff0c;用于展示图像中不同像素强度&#xff08;通常是灰度值或色彩强度&#xff09;出现的频率分布。具体来说…...

09 docker 安装tomcat 详解

目录 一、安装tomcat 1. tomcat镜像的获取 2. docker创建容器实列 3. 访问测试 404错误 4. 解决方案 5. 使用免修改版容器镜像 5.1. 运行实列的创建 5.2. 出现问题及解决&#xff1a; 6. 验证 OK 一、安装tomcat 1. tomcat镜像的获取 docker search tomcat #docker …...

44.实现管理HOOK点的链表对象

上一个内容&#xff1a;43.实现HOOK接管寄存器数据 以 43.实现HOOK接管寄存器数据 它的代码为基础进行修改 首先创建一个类 这里创建的名为HOOKPOINT.h HOOKPOINT.cpp文件里面的内容 #include "pch.h" #include "HOOKPOINT.h"HOOKPOINT::HOOKPOINT() {…...

Unity小知识

1.当我们把摄像机的内容渲染到RenderTexture上而不是屏幕上时,那么相机的Aspect默认会设置成和RenderTexture的分辨率一样.不过最终如果把RenderTexture作为贴图贴到模型上去的时候还是会被UV拉伸和缩小的。 2.要想自定义UnityPackage的内容&#xff0c;只要找到UnityProject/L…...

【Jupyter Notebook与Git完美融合】在Notebook中驾驭版本控制的艺术

标题&#xff1a;【Jupyter Notebook与Git完美融合】在Notebook中驾驭版本控制的艺术 Jupyter Notebook是一个流行的开源Web应用程序&#xff0c;允许用户创建和共享包含实时代码、方程、可视化和解释性文本的文档。而Git是一个广泛使用的分布式版本控制系统&#xff0c;用于跟…...

Python开发者必看:内存优化的实战技巧

更多Python学习内容&#xff1a;ipengtao.com Python是一种高级编程语言&#xff0c;以其易读性和强大的功能而广受欢迎。然而&#xff0c;由于其动态类型和自动内存管理&#xff0c;Python在处理大量数据或高性能计算时&#xff0c;内存使用效率可能不如一些低级语言。本文将介…...

Golang | Leetcode Golang题解之第214题最短回文串

题目&#xff1a; 题解&#xff1a; func shortestPalindrome(s string) string {n : len(s)fail : make([]int, n)for i : 0; i < n; i {fail[i] -1}for i : 1; i < n; i {j : fail[i - 1]for j ! -1 && s[j 1] ! s[i] {j fail[j]}if s[j 1] s[i] {fail[i…...

【ajax实战08】分页功能

本文章目标&#xff1a;点击上/下一页按钮&#xff0c;实现对应页面的变化 实现基本步骤&#xff1a; 一&#xff1a;保存并设置文章总条数 设置一个全局变量&#xff0c;将服务器返回的数据返回给全局变量 二&#xff1a;点击下一页&#xff0c;做临界值判断&#xff0c;并…...

基于Hadoop平台的电信客服数据的处理与分析②项目分析与设计---需求分析-项目场景引入

任务描述 需求分析是软件生命周期中一个非常重要的过程&#xff0c;它决定着整个软件项目的质量&#xff0c;也是整个软件开发的成败所在。本环节任务是完成软件需求规格说明书。 知识点 &#xff1a;软件需求规格说明书的编写 重 点 &#xff1a;软件需求规格说明书内容的…...

debug-mmlab

mmyolo bug1: MMYOLO for yolov5 instance segmentation on balloon dataset getting this error "ValueError: Key img_path is not in available keys. solution: pip install albumentations1.3.1 reference...

年轻人为什么那么爱喝奶茶?

作者 | 艾泊宇 为什么年轻人那么爱喝奶茶&#xff1f;答案很简单&#xff1a;对他们来说&#xff0c;奶茶之于年轻人&#xff0c;正如白酒之于中年人。 奶茶不仅仅是一种饮料&#xff0c;它已经演化成一种文化现象&#xff0c;代表着温暖和爱的象征&#xff0c;甚至在某种程度上…...

手写数组去重

方法1-判断相邻元素 function _deleteRepeat(arr){if(!Array.isArray(arr)){throw new Error(参数必须是数组)}let res[];// 使用slice创建arr的副本&#xff0c;并排序let sortArrarr.slice().sort((a,b)>a-b);for(let i0;i<sortArr.length;i){if(isortArr.length-1||s…...

Firewalld 防火墙

1. 概述 在 RHEL7 系统中&#xff0c;firewalld 防火墙取代了传统的 iptables 防火墙。iptables 的防火墙策略是通过内核层面的 netfilter 网络过滤器来处理的&#xff0c;而 firewalld 则是通过内核层面的 nftables 包过滤框架来处理。firewalld 提供了更为丰富的功能和动态更…...

Hive查询优化 - 面试工作不走弯路

引言&#xff1a;Hive作为一种基于Hadoop的数据仓库工具&#xff0c;广泛应用于大数据分析。然而&#xff0c;由于其依赖于MapReduce框架&#xff0c;查询的性能可能会受到影响。为了确保Hive查询能够高效运行&#xff0c;掌握查询优化技巧至关重要。在日常工作中&#xff0c;高…...

【VUE3】uniapp + vite中 uni.scss 使用 /deep/ 不生效(踩坑记录三)

vite 中使用 /deep/ 进行样式穿透报错 原因&#xff1a;vite 中不支持&#xff0c;换成 ::v-deep 或:deep即可...

容器部署rabbitmq集群迁移

1、场景&#xff1a; 因业务需要&#xff0c;要求把rabbitmq-A集群上的数据迁移到rabbitmq-B集群上&#xff0c;rabbitmq的数据包括元数据&#xff08;RabbitMQ用户、vhost、队列、交换和绑定&#xff09;和消息数据&#xff0c;而消息数据存储在单独的消息存储库中。 2、迁移要…...

DP:背包问题----0/1背包问题

文章目录 &#x1f497;背包问题&#x1f49b;背包问题的变体&#x1f9e1;0/1 背包问题的数学定义&#x1f49a;解决背包问题的方法&#x1f499;例子 &#x1f497;解决背包问题的一般步骤&#xff1f;&#x1f497;例题&#x1f497;总结 ❤️❤️❤️❤️❤️博客主页&…...

React antd umi 监听当前页面离开,在菜单栏提示操作

需求是我这里有个页面&#xff0c;离开当前页面之后&#xff0c;需要在菜单栏显示个提示&#xff0c;也就是Tour const [unblock, setUnblock] useState<() > void>(() > () > {});const [next, setNext] useState();useEffect(() > {const unblockHandler…...

在 Windows PowerShell 中模拟 Unix/Linux 的 touch 命令

在 Unix 或 Linux 系统中&#xff0c;touch 命令被广泛用于创建新文件或更新现有文件的时间戳。不过&#xff0c;在 Windows 系统中&#xff0c;尤其是在 PowerShell 环境下&#xff0c;并没有内置的 touch 命令。这篇博客将指导你如何在 Windows PowerShell 中模拟 touch 命令…...

鸿蒙NEXT

[中国&#xff0c;东莞&#xff0c;2024年6月24日] 华为开发者大会&#xff08;HDC&#xff09;正式开幕&#xff0c;带来全新的 HarmonyOS NEXT、盘古大模型5.0等最创新成果&#xff0c;持续为消费者和开发者带来创新体验。 HarmonyOS NEXT 鸿蒙生态 星河璀璨 鸿蒙生态设备数…...

VUE3-Elementplus-form表单-笔记

1. 结构相关 el-row表示一行&#xff0c;一行分成24份 el-col表示列 (1) :span"12" 代表在一行中&#xff0c;占12份 (50%) (2) :span"6" 表示在一行中&#xff0c;占6份 (25%) (3) :offset"3" 代表在一行中&#xff0c;左侧margin份数 el…...

Analyze an ORA-12801分析并行 parallel 12801 实际原因

"ORA-06512: at "PKG_P_DATA", line 19639 ORA-06512: at "PKG_P_DATA", line 19595 ORA-06512: at "PKG_P_DATA", line 14471-JOB 调用 -ORA-12801: error signaled in parallel query server P009, instance rac2:dwh2 (2) Error: ORA-12…...

高级运维工程师讲述银河麒麟V10SP1服务器加固收回权限/tmp命令引起生产mysql数据库事故实战

高级运维工程师讲述银河麒麟V10SP1服务器加固收回权限/tmp命令引起生产MySql数据库事故实战 一、前言 作为运维工程师经常会对生产服务器进行安全漏洞加固&#xff0c;一般服务厂商、或者甲方信息安全中心提供一些安全的shell脚本&#xff0c;一般这种shell脚本都是收回权限&…...

昇思25天学习打卡营第09天|sea_fish

打开第九天&#xff0c;本次学习的内容为保存与加载&#xff0c;记录学习的过程。本次的内容少而且简单。 在训练网络模型的过程中&#xff0c;实际上我们希望保存中间和最后的结果&#xff0c;用于微调&#xff08;fine-tune&#xff09;和后续的模型推理与部署&#xff0c;因…...

flutter开发实战-Charles抓包设置,dio网络代理

flutter开发实战-Charles抓包设置 在开发过程中抓包&#xff0c;可以看到请求参数等数据&#xff0c;方便分析问题。flutter上使用Charles抓包设置。dio需要设置网络代理。 一、dio设置网络代理 在调试模式下需要抓包调试&#xff0c;所以需要使用代理&#xff0c;并且仅用H…...

Elasticsearch:Runtime fields - 运行时字段(二)

这是继上一篇文章 “Elasticsearch&#xff1a;Runtime fields - 运行时字段&#xff08;一&#xff09;” 的续篇。 在查询时覆盖字段值 如果你创建的运行时字段与映射中已存在的字段同名&#xff0c;则运行时字段会隐藏映射字段。在查询时&#xff0c;Elasticsearch 会评估运…...

Python正则表达式的入门用法(上)

Python正则表达式是使用re模块来进行操作的。re模块提供了一组函数&#xff0c;用于进行字符串的匹配和查找操作。 下面是Python中使用正则表达式的一些常用函数&#xff1a; re.search(pattern, string)&#xff1a;在字符串中查找并返回第一个匹配的对象。 re.match(patte…...

Audio Processing Graphs 管理 Audio Units

Audio Processing Graphs 管理 Audio Units Audio Processing Graphs 管理 Audio UnitsAudio Processing Graph 拥有精确的 I/O UnitAudio Processing Graph 提供线程安全通过 graph "pull" 音频流 Audio Processing Graphs 管理 Audio Units audio processing grap…...

redhat7.x 升级openssh至openssh-9.8p1

1.环境准备&#xff1a; OS系统&#xff1a;redhat 7.4 2.备份配置文件&#xff1a; cp -rf /etc/ssh /etc/ssh.bak cp -rf /usr/bin/openssl /usr/bin/openssl.bak cp -rf /etc/pam.d /etc/pam.d.bak cp -rf /usr/lib/systemd/system /usr/lib/systemd/system.bak 3.安装…...

如何使用小红书矩阵系统:提升内容营销效率

小红书&#xff0c;作为一个集社交和电商于一体的平台&#xff0c;已经成为品牌和个人创作者进行内容营销的重要渠道。小红书矩阵系统&#xff0c;作为一种高效的内容管理和分发机制&#xff0c;可以帮助用户更好地规划和执行营销策略。本文将详细介绍如何使用小红书矩阵系统&a…...

全新UI自助图文打印系统小程序源码 PHP后端 附教程

最新自助图文打印系统和证件照云打印小程序源码PHP后端&#xff0c;为用户用户自助打印的服务&#xff0c;包括但不限于文档、图片、表格等多种格式的文件。此外&#xff0c;它们还提供了诸如美颜、换装、文档打印等功能&#xff0c;以及后台管理系统&#xff0c;方便管理员对打…...

短信验证码实现

一、设置AccessKey 创建用户并配置使用权限&#xff0c;使我们拥有调用 aliyunAPI 的权限&#xff0c;之后会生成 AccessKeyID 和 AccessKey密码&#xff0c;后面我们会使用到。需要注意的是 AccessKeyID 和 AccessKey密码生成后我们需要将他保存起来&#xff0c;否则后期无法查…...

C++(Qt)-GIS开发-QGraphicsView显示瓦片地图简单示例

C(Qt)-GIS开发-QGraphicsView显示瓦片地图简单示例 文章目录 C(Qt)-GIS开发-QGraphicsView显示瓦片地图简单示例1、概述2、实现效果3、主要代码4、源码地址 更多精彩内容&#x1f449;个人内容分类汇总 &#x1f448;&#x1f449;GIS开发 &#x1f448; 1、概述 支持多线程加…...

追踪WebKit的缺陷:深入探索Bug跟踪系统

&#x1f41b; 追踪WebKit的缺陷&#xff1a;深入探索Bug跟踪系统 WebKit是一个活跃的开源项目&#xff0c;其开发过程中不可避免地会产生bug。为了有效地管理和修复这些缺陷&#xff0c;WebKit项目采用了一套成熟的bug跟踪系统。本文将详细介绍WebKit的bug跟踪系统是如何工作…...

湖北荆州:“铁娘子”战高温开展带电作业

但是,如果停电施工的话,会影响附近几百户居民用电,供电公司决定通过低压带电作业解决这一难题。荆州区供电公司铁娘子低压带电作业队接到任务后,发动荆州区公司低压带电作业区域协作中心成员,成立了两男三女组成的工作团队,迅速出发前往现场勘察,开展拉线更换。大家分工…...

新车凯美瑞买什么配置性价比最高,全新第九代:B级车市场新标杆

全新凯美瑞买什么配置性价比最高**广汽丰田第九代凯美瑞:B级车市场的璀璨明星**3月30日,广汽丰田第九代凯美瑞震撼上市,以其卓越的智能电混技术、智能座舱、智驾安全及无与伦比的驾乘质感,重新定义了中高级轿车市场的标杆。这款车型不仅价格亲民,介于17.18万元至20.68万元之…...

C#压缩单个文件

1、压缩方法 /// <summary> /// 压缩 /// </summary> /// <param name"source">源目录</param> /// <param name"s">ZipOutputStream对象</param> public static void Compress(string source, ZipOutputStream s) {…...

huggingface的self.state与self.control来源(TrainerState与TrainerControl)

文章目录 前言一、huggingface的trainer的self.state与self.control初始化调用二、TrainerState源码解读(self.state)1、huggingface中self.state初始化参数2、TrainerState类的Demo 三、TrainerControl源码解读(self.control)总结 前言 在 Hugging Face 中&#xff0c;self.s…...

华为校招机试 - LRU模拟(20240515)

题目描述 LRU(Least Recently Used)缓存算法是一种常用于管理缓存的策略,其目标是保留最近使用过的数据,而淘汰最久未被使用的数据。 实现简单的LRU缓存算法,支持查询、插入、删除操作。 最久未被使用定义:查询、插入和删除操作均为一次访问操作,每个元素均有一个最后…...

STL库--stack

目录 stack的定义 stack容器内元素的访问 stack常用函数实例解析 stack的常见用途 stack的定义 其定义的写法和其他STL容器相同&#xff0c;typename可以任意基本类型或容器&#xff1a; stack<typename> name; stack容器内元素的访问 由于栈本身就是一种后进先出…...