Mac安装JD-GUI

Mac安装反编译工具步骤如下:

  1. 打开官网https://java-decompiler.github.io/
  2.  选择下载mac的安装包
  3. 解压下载好的压缩包,点击JD-GUI安装 
  4. 有可能会遇到如下错误。
  5. 请先检查是否安装JDK,通过java -version命令查看是否是1.8版本的jdk
  6. 如果jdk没问题,那么需要修改安装包文件。
  7. 点击显示包内容->Contents->MacOs->universalJavaApplicationStub.sh;
  8. 编辑文件,把universalJavaApplicationStub.sh文件内容替换为如下内容:
  9. #!/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" ]; do
    	ls=$(ls -ld "$PRG")
    	link=$(expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null)
    	if expr "$link" : '^/' 2> /dev/null >/dev/null; then
    		PRG="$link"
    	else
    		PRG="$(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
    ###########################
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值