17fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe#!/bin/bash
27fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe#
37fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# Copyright (C) 2014 The Android Open Source Project
47fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe#
57fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# Licensed under the Apache License, Version 2.0 (the "License");
67fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# you may not use this file except in compliance with the License.
77fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# You may obtain a copy of the License at
87fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe#
97fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe#     http://www.apache.org/licenses/LICENSE-2.0
107fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe#
117fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# Unless required by applicable law or agreed to in writing, software
127fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# distributed under the License is distributed on an "AS IS" BASIS,
137fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
147fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# See the License for the specific language governing permissions and
157fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# limitations under the License.
167fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe
177fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# Stop if something fails.
187fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampeset -e
197fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe
207fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# The classes are pre-compiled and modified with ASM.
217fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe#
227fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# To reproduce, compile the source files. Asm.java needs the ASM libraries (core and tree). Then
237fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# run Asm.java, which produces Inf.out and NonInf.out. Rename these to class files and put them
247fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# into the classes directory (this assumes the ASM libraries are names asm.jar and asm-tree.jar):
257fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe#
267fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# javac Inf.java NonInf.java Main.java
277fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# javac -cp asm.jar:asm-tree.jar:. Asm.java
287fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# java -cp asm.jar:asm-tree.jar:. Asm
297fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# mv Inf.out classes/Inf.class
307fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# mv NonInf.out classes/NonInf.class
317fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe# mv Main.class A.class A\$B.class A\$C.class classes/
327fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe
337fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampe${DX} --debug --dex --dump-to=classes.lst --output=classes.dex classes
347fc8f90b7160e879143be5cfd6ea3df866398884Andreas Gampezip $TEST_NAME.jar classes.dex
35