-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a way to replace classes by Jimple code
- Loading branch information
Showing
5 changed files
with
110 additions
and
2 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
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
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,40 @@ | ||
/* | ||
* This Source Code is subject to the terms of the Mozilla Public License | ||
* version 2.0 (the "License"). You can obtain a copy of the License at | ||
* http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package info.palant.apkInstrumentation; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Properties; | ||
import java.util.StringTokenizer; | ||
|
||
import soot.SceneTransformer; | ||
|
||
public class ClassReplacer extends SceneTransformer | ||
{ | ||
private List<String> paths = new ArrayList<String>(); | ||
|
||
public ClassReplacer(Properties config) | ||
{ | ||
StringTokenizer tokenizer = new StringTokenizer(config.getProperty("ClassReplacer.classes")); | ||
while (tokenizer.hasMoreTokens()) | ||
{ | ||
String token = tokenizer.nextToken(); | ||
if (token.equals("")) | ||
continue; | ||
|
||
paths.add(token); | ||
} | ||
} | ||
|
||
@Override | ||
protected void internalTransform(String phaseName, Map<String, String> options) | ||
{ | ||
for (String path: this.paths) | ||
ClassInjector.injectJimple(path); | ||
} | ||
} |
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