-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
246 changed files
with
604 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file modified
0
commons-lite/src/main/java/org/apache/commons/codec/binary/Hex.java
100644 → 100755
Empty file.
Empty file modified
0
commons-lite/src/main/java/org/apache/commons/collections/Transformer.java
100644 → 100755
Empty file.
Empty file modified
0
commons-lite/src/main/java/org/apache/commons/collections/map/LazyMap.java
100644 → 100755
Empty file.
Empty file modified
0
commons-lite/src/main/java/org/apache/commons/io/FileUtils.java
100644 → 100755
Empty file.
Empty file modified
0
commons-lite/src/main/java/org/apache/commons/io/FilenameUtils.java
100644 → 100755
Empty file.
Empty file.
Empty file modified
0
...lite/src/main/java/org/apache/xmlgraphics/image/codec/util/MemoryCacheSeekableStream.java
100644 → 100755
Empty file.
Empty file modified
0
commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/SeekableStream.java
100644 → 100755
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/ToStringUtil.java
100644 → 100755
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/ArrayExpr.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/BinopExpr.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/CastExpr.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/Exprs.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/FieldExpr.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/FilledArrayExpr.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/InvokeExpr.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/NewExpr.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/NewMutiArrayExpr.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/RefExpr.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/TypeExpr.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/UnopExpr.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/AssignStmt.java
100644 → 100755
Empty file.
35 changes: 35 additions & 0 deletions
35
dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/BaseSwitchStmt.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* dex2jar - Tools to work with android .dex and java .class files | ||
* Copyright (c) 2009-2012 Panxiaobo | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance 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 to in writing, 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 License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.googlecode.dex2jar.ir.stmt; | ||
|
||
import com.googlecode.dex2jar.ir.ValueBox; | ||
import com.googlecode.dex2jar.ir.stmt.Stmt.E1Stmt; | ||
|
||
/** | ||
* Parent class of {@link LookupSwitchStmt} and {@link TableSwitchStmt} | ||
* | ||
* @author <a href="mailto:[email protected]">Panxiaobo</a> | ||
* | ||
*/ | ||
public abstract class BaseSwitchStmt extends E1Stmt { | ||
public BaseSwitchStmt(ST type, ValueBox op) { | ||
super(type, op); | ||
} | ||
|
||
public LabelStmt[] targets; | ||
public LabelStmt defaultTarget; | ||
} |
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/JumpStmt.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/LabelStmt.java
100644 → 100755
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,21 +18,18 @@ | |
import java.util.Map; | ||
|
||
import com.googlecode.dex2jar.ir.ValueBox; | ||
import com.googlecode.dex2jar.ir.stmt.Stmt.E1Stmt; | ||
|
||
/** | ||
* Represent a LOOKUP_SWITCH statement | ||
* | ||
* @see ST#LOOKUP_SWITCH | ||
* | ||
* @author <a href="mailto:[email protected]">Panxiaobo</a> | ||
* @version $Rev$ | ||
* @version $Rev: 9fd8005bbaa4 $ | ||
*/ | ||
public class LookupSwitchStmt extends E1Stmt { | ||
public class LookupSwitchStmt extends BaseSwitchStmt { | ||
|
||
public LabelStmt defaultTarget; | ||
public int[] lookupValues; | ||
public LabelStmt[] targets; | ||
|
||
public LookupSwitchStmt(ValueBox key, int[] lookupValues, LabelStmt[] targets, LabelStmt defaultTarget) { | ||
super(ST.LOOKUP_SWITCH, key); | ||
|
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/NopStmt.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/ReturnVoidStmt.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/StmtList.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/Stmts.java
100644 → 100755
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,21 +19,18 @@ | |
|
||
import com.googlecode.dex2jar.ir.Value; | ||
import com.googlecode.dex2jar.ir.ValueBox; | ||
import com.googlecode.dex2jar.ir.stmt.Stmt.E1Stmt; | ||
|
||
/** | ||
* Represent a TABLE_SWITCH statement | ||
* | ||
* @see ST#TABLE_SWITCH | ||
* | ||
* @author <a href="mailto:[email protected]">Panxiaobo</a> | ||
* @version $Rev$ | ||
* @version $Rev: 9fd8005bbaa4 $ | ||
*/ | ||
public class TableSwitchStmt extends E1Stmt { | ||
public class TableSwitchStmt extends BaseSwitchStmt { | ||
|
||
public LabelStmt defaultTarget; | ||
public int lowIndex, highIndex; | ||
public LabelStmt[] targets; | ||
|
||
public TableSwitchStmt() { | ||
super(ST.TABLE_SWITCH, null); | ||
|
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/UnopStmt.java
100644 → 100755
Empty file.
Empty file modified
0
dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ArrayNullPointerTransformer.java
100644 → 100755
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/CleanLabel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* | ||
* dex2jar - Tools to work with android .dex and java .class files | ||
* Copyright (c) 2009-2012 Panxiaobo | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance 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 to in writing, 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 License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.googlecode.dex2jar.ir.ts; | ||
|
||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import com.googlecode.dex2jar.ir.IrMethod; | ||
import com.googlecode.dex2jar.ir.LocalVar; | ||
import com.googlecode.dex2jar.ir.Trap; | ||
import com.googlecode.dex2jar.ir.stmt.BaseSwitchStmt; | ||
import com.googlecode.dex2jar.ir.stmt.JumpStmt; | ||
import com.googlecode.dex2jar.ir.stmt.LabelStmt; | ||
import com.googlecode.dex2jar.ir.stmt.Stmt; | ||
import com.googlecode.dex2jar.ir.stmt.StmtList; | ||
import com.googlecode.dex2jar.ir.stmt.Stmt.ST; | ||
|
||
/** | ||
* Clean unused {@link LabelStmt} | ||
* | ||
* @author <a href="mailto:[email protected]">Panxiaobo</a> | ||
* | ||
*/ | ||
public class CleanLabel implements Transformer { | ||
|
||
@Override | ||
public void transform(IrMethod irMethod) { | ||
Set<LabelStmt> uselabels = new HashSet<LabelStmt>(); | ||
addTrap(irMethod.traps, uselabels); | ||
addVars(irMethod.vars, uselabels); | ||
addStmt(irMethod.stmts, uselabels); | ||
rmUnused(irMethod.stmts, uselabels); | ||
} | ||
|
||
private void addVars(List<LocalVar> vars, Set<LabelStmt> uselabels) { | ||
if (vars != null) { | ||
for (LocalVar var : vars) { | ||
uselabels.add(var.start); | ||
uselabels.add(var.end); | ||
} | ||
} | ||
|
||
} | ||
|
||
private void rmUnused(StmtList stmts, Set<LabelStmt> uselabels) { | ||
for (Stmt p = stmts.getFirst(); p != null;) { | ||
if (p.st == ST.LABEL) { | ||
if (!uselabels.contains(p)) { | ||
Stmt q = p.getNext(); | ||
stmts.remove(p); | ||
p = q; | ||
continue; | ||
} | ||
} | ||
p = p.getNext(); | ||
} | ||
} | ||
|
||
private void addStmt(StmtList stmts, Set<LabelStmt> labels) { | ||
for (Stmt p = stmts.getFirst(); p != null; p = p.getNext()) { | ||
if (p instanceof JumpStmt) { | ||
labels.add(((JumpStmt) p).target); | ||
} else if (p instanceof BaseSwitchStmt) { | ||
BaseSwitchStmt stmt = (BaseSwitchStmt) p; | ||
labels.add(stmt.defaultTarget); | ||
for (LabelStmt t : stmt.targets) { | ||
labels.add(t); | ||
} | ||
} | ||
} | ||
} | ||
|
||
private void addTrap(List<Trap> traps, Set<LabelStmt> labels) { | ||
if (traps != null) { | ||
for (Trap trap : traps) { | ||
labels.add(trap.start); | ||
labels.add(trap.end); | ||
for (LabelStmt h : trap.handlers) { | ||
labels.add(h); | ||
} | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.