File: baksmali

package info (click to toggle)
libsmali-java 2.5.2.git2771eae-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 9,136 kB
  • sloc: java: 47,715; sh: 232; xml: 60; ansic: 46; makefile: 6
file content (150 lines) | stat: -rw-r--r-- 4,180 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# Debian baksmali completion                             -*- shell-script -*-

_baksmali()
{
    local cur prev words cword
    _init_completion || return

    # see if the user selected a command already
    local COMMANDS=(
        "deodex"
        "disassemble"
        "dump"
        "help"
        "list"
    )

    local command i
    for (( i=0; i < ${#words[@]}-1; i++ )); do
        if [[ ${COMMANDS[@]} =~ ${words[i]} ]]; then
            command=${words[i]}
            break
        fi
    done

    # Complete a --option<SPACE><TAB>
    case $prev in
	-d|--classpath-dir|--cpd|--dir)
            _filedir -d
            return 0
            ;;
	--inline-table|--inline|--it)
            _filedir
            return 0
            ;;
        -o|--output)
            _filedir
            return 0
            ;;
    esac

    # supported options per command
    if [[ "$cur" == -* ]]; then
        case $command in
            deodex|de|x)
                COMPREPLY=($(compgen -W '
                    -a --api
                    --accessor-comments
                    --allow-odex-opcodes
                    -b --bootclasspath
                    -c --classpath
                    --check-package-private-access --package-private
                    --classes
                    --code-offsets --offsets
                    -d --classpath-dir --dir
                    --debug-info
                    -h --help
                    --implicit-references
                    --inline-table
                    -j --jobs
                    -l --use-locals
                    --normalize-virtual-methods
                    -o --output
                    --parameter-registers
                    -r --register-info
                    --resolve-resources
                    --sequential-labels
                '))
                return 
                ;;
            disassemble|dis|d)
                COMPREPLY=($(compgen -W '
                    -a --api
                    --accessor-comments
                    --allow-odex-opcodes
                    -b --bootclasspath
                    -c --classpath
                    --classes
                    --code-offsets --offsets
                    -d --classpath-dir --dir
                    --debug-info
                    -h --help
                    --implicit-references
                    -j --jobs
                    -l --use-locals
                    --normalize-virtual-methods
                    -o --output
                    --parameter-registers
                    -r --register-info
                    --resolve-resources
                    --sequential-labels
                '))
                return 0
                ;;
            dump|du)
                COMPREPLY=($(compgen -W '-a --api -h --help'))
                return 0
                ;;
            list|l)
                COMPREPLY=($(compgen -W '-h --help'))
                return 0
                ;;
            help)
                return 0
                ;;
        esac
    fi

    # specific command arguments
    if [[ -n $command ]]; then
        case $command in
            deodex|de|x)
                _filedir '@(apk|dex|oat|odex)'
                return 0
                ;;
            disassemble|dis|d)
                _filedir '@(apk|dex|oat|odex)'
                return 0
                ;;
            dump|du)
                _filedir '@(apk|dex|oat|odex)'
                return 0
                ;;
            list|l)
                COMPREPLY=($(compgen -W '
                      classes
                      dependencies
                      dex
                      fieldoffsets
                      fields
                      help
                      methods
                      strings
                      types
                      vtables
                '))
                return 0
                ;;
        esac
    fi

    # no command yet, show what commands we have
    if [ "$command" = "" ]; then
        COMPREPLY=( $( compgen -W '${COMMANDS[@]}' -- "$cur" ) )
    fi

    return 0
} &&
complete -F _baksmali baksmali

# ex: ts=4 sw=4 et filetype=sh