Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70bc1d3f authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add "signature only" mode to dump-jar" into main

parents 6ee7692b dc980a7c
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ help() {

      -s: Simple output mode, used to check HostStubGen output jars.

      -n: Even simpler output mode; print signature only.

      -o: Write the output to a specified file.
EOF
}
@@ -49,7 +51,7 @@ EOF
verbose=0
simple=0
output=""
while getopts "hvso:" opt; do
while getopts "hvsno:" opt; do
case "$opt" in
    h)
        help
@@ -61,6 +63,9 @@ case "$opt" in
    s)
        simple=1
        ;;
    n)
        simple=2
        ;;
    o)
        output="$OPTARG"
        ;;
@@ -74,13 +79,15 @@ shift $(($OPTIND - 1))

JAVAP_OPTS="${JAVAP_OPTS:--v -p -s -sysinfo -constants}"

if (( $simple )) ; then
if (( $simple == 1 )) ; then
  JAVAP_OPTS="-p -c -v"
elif (( $simple == 2 )) ; then
  JAVAP_OPTS="-p"
fi

# Convert the output for `-s` as needed.
filter_output() {
  if (( $simple )) ; then
  if (( $simple != 0 )) ; then
    # For "simple output" mode,
    # - Normalize the constant numbers (replace with "#x")
    # - Normalize byte code offsets and other similar numbers. (e.g. "0:" -> "x:")
@@ -158,7 +165,7 @@ for file in "${@}"; do
        file="${file%:*}"

        # Print the filename and the regex.
        if ! (( $simple )) ; then
        if (( $simple == 0 )) ; then
          echo -n "# Jar: $file"
          if [[ "$regex" != "" ]] ;then
              echo -n "  (regex: $regex)"