mac android 反编译工具,mac下使用apktool反编译

这个脚本是一个用于调用smali.jar的bash脚本,主要目的是简化Android应用逆向工程过程中的命令行操作。它检查并设置脚本路径,确保能够找到所需的jar文件(apktool.jar),并提供了内存配置选项。通过这个脚本,用户可以更方便地执行smali指令,进行APK反编译等任务。
摘要由CSDN通过智能技术生成

#!/bin/bash

#

# Copyright (C)2007The Android Open Source Project

#

# Licensed under the Apache License, Version2.0 (the "License");

# you may not use thisfile except incompliance with the License.

# You may obtain a copy of the License at

#

# http://www.apache.org/licenses/LICENSE-2.0

#

# Unless required by applicable law or agreed toinwriting, software

# distributed under the License is distributed on an"AS IS"BASIS,

# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

# See the Licenseforthe specific language governing permissions and

# limitations under the License.

# This script is a wrapperfor smali.jar, so you can simply call "smali",

# instead of java-jar smali.jar. It is heavily based on the "dx"script

# from the Android SDK

# Set up prog to be the path of this script, including following symlinks,

# and set up progdir to be the fully-qualified pathname of its directory.

prog="$0"

while [ -h "${prog}" ]; donewProg=`/bin/ls -ld "${prog}"`echo${newProg}

newProg=`expr "${newProg}" : ".* -> (.*)$"`if expr "x${newProg}" : 'x/' >/dev/null; thenprog="${newProg}"

elseprogdir=`dirname "${prog}"`

prog="${progdir}/${newProg}"

fi

doneoldwd=`pwd`

progdir=`dirname "${prog}"`

cd"${progdir}"progdir=`pwd`

prog="${progdir}"/`basename "${prog}"`

cd"${oldwd}"jarfile=apktool.jar

libdir="$progdir"

if [ ! -r "$libdir/$jarfile"]then

echo `basename "$prog"`": can't find $jarfile"exit1

fijavaOpts=""# If you want DX to havemorememory when executing, uncomment the following

# line and adjust the value accordingly. Use"java -X" fora list of options

# you can pass here.

#

javaOpts="-Xmx256M"# Alternatively, this will extract any parameter"-Jxxx"from the command line

# and pass them to Java (instead of to dx). This makes it possibleforyou to

# add a command-line parameter such as "-JXmx256M" in your ant scripts, for# example.while expr "x$1" : 'x-J' >/dev/null; doopt=`expr "$1" : '-J(.*)'`

javaOpts="${javaOpts} -${opt}"

shift

done

if [ "$OSTYPE" = "cygwin" ] ; thenjarpath=`cygpath -w "$libdir/$jarfile"`elsejarpath="$libdir/$jarfile"

fi# add current location to pathforaapt

PATH=$PATH:`pwd`;

export PATH;

exec java $javaOpts-Djava.awt.headless=true -jar "$jarpath" "$@"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值