Added Plugin View APK Android Permissions

This commit is contained in:
Konloch 2021-07-11 04:16:54 -07:00
parent 7d140580ee
commit 5cbe3122e5

AI 샘플 코드 생성 중입니다

Loading...

View File

@ -0,0 +1,42 @@
package the.bytecode.club.bytecodeviewer.plugin.preinstalled;
import org.objectweb.asm.tree.ClassNode;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.api.Plugin;
import the.bytecode.club.bytecodeviewer.api.PluginConsole;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
/**
* @author Konloch
* @since 07/11/2021
*/
public class ViewAPKAndroidPermissions extends Plugin
{
@Override
public void execute(ArrayList<ClassNode> classNodeList)
{
PluginConsole frame = new PluginConsole("Android Permissions");
frame.setVisible(true);
byte[] encodedAndroidManifest = BytecodeViewer.getFileContents("AndroidManifest.xml");
if(encodedAndroidManifest == null)
{
frame.appendText("This plugin only works on valid Android APKs");
return;
}
byte[] decodedAndroidManifest = BytecodeViewer.getFileContents("Decoded Resources/AndroidManifest.xml");
if(decodedAndroidManifest != null)
{
String manifest = new String(decodedAndroidManifest, StandardCharsets.UTF_8);
String[] lines = manifest.split("\r?\n");
for(String line : lines)
if(line.toLowerCase().contains("uses-permission"))
frame.appendText(line.trim());
}
else
frame.appendText("Enable Settings>Decode APK Resources!");
}
}