androguard.core package¶
Subpackages¶
Submodules¶
androguard.core.androconf module¶
-
class
androguard.core.androconf.
Color
¶ Bases:
object
-
Black
= '\x1b[30m'¶
-
Blue
= '\x1b[34m'¶
-
Bold
= '\x1b[1m'¶
-
Cyan
= '\x1b[36m'¶
-
Green
= '\x1b[32m'¶
-
Grey
= '\x1b[37m'¶
-
Normal
= '\x1b[0m'¶
-
Purple
= '\x1b[35m'¶
-
Red
= '\x1b[31m'¶
-
Yellow
= '\x1b[33m'¶
-
-
exception
androguard.core.androconf.
InvalidResourceError
¶ Bases:
Exception
Invalid Resource Erorr is thrown by load_api_specific_resource_module
-
androguard.core.androconf.
color_range
(startcolor, goalcolor, steps)¶ wrapper for interpolate_tuple that accepts colors as html (“#CCCCC” and such)
-
androguard.core.androconf.
default_colors
(obj)¶
-
androguard.core.androconf.
disable_colors
()¶ Disable colors from the output (color = normal)
-
androguard.core.androconf.
enable_colors
(colors)¶
-
androguard.core.androconf.
interpolate_tuple
(startcolor, goalcolor, steps)¶ Take two RGB color sets and mix them over a specified number of steps. Return the list
-
androguard.core.androconf.
is_android
(filename)¶ Return the type of the file
@param filename : the filename @rtype : “APK”, “DEX”, None
-
androguard.core.androconf.
is_android_raw
(raw)¶ Returns a string that describes the type of file, for common Android specific formats
-
androguard.core.androconf.
is_ascii_problem
(s)¶ Test if a string contains other chars than ASCII
Parameters: s – a string to test Returns: True if string contains other chars than ASCII, False otherwise
-
androguard.core.androconf.
load_api_specific_resource_module
(resource_name, api=None)¶ Load the module from the JSON files and return a dict, which might be empty if the resource could not be loaded.
If no api version is given, the default one from the CONF dict is used.
Parameters: - resource_name – Name of the resource to load
- api – API version
Returns: dict
-
androguard.core.androconf.
make_color_tuple
(color)¶ turn something like “#000000” into 0,0,0 or “#FFFFFF into “255,255,255”
-
androguard.core.androconf.
remove_colors
()¶ Remove colors from the output (no escape sequences)
-
androguard.core.androconf.
rrmdir
(directory)¶ Recursivly delete a directory
Parameters: directory – directory to remove
-
androguard.core.androconf.
save_colors
()¶
-
androguard.core.androconf.
set_options
(key, value)¶
-
androguard.core.androconf.
show_logging
(level=20)¶ enable log messages on stdout
We will catch all messages here! From all loggers…
androguard.core.bytecode module¶
-
class
androguard.core.bytecode.
Buff
(offset, buff)¶ Bases:
object
-
class
androguard.core.bytecode.
BuffHandle
(buff)¶ Bases:
object
-
end
()¶
-
get_idx
()¶
-
read
(size)¶
-
readNullString
(size)¶
-
read_at
(offset, size)¶
-
read_b
(size)¶
-
set_idx
(idx)¶
-
size
()¶
-
-
androguard.core.bytecode.
Exit
(msg)¶
-
androguard.core.bytecode.
FormatClassToJava
(i)¶ Transform a typical xml format class into java format
Parameters: i – the input class name Return type: string
-
androguard.core.bytecode.
FormatClassToPython
(i)¶
-
androguard.core.bytecode.
FormatDescriptorToPython
(i)¶
-
androguard.core.bytecode.
FormatNameToPython
(i)¶
-
class
androguard.core.bytecode.
Node
(n, s)¶ Bases:
object
-
androguard.core.bytecode.
PrettyShow
(m_a, basic_blocks, notes={})¶
-
androguard.core.bytecode.
PrettyShowEx
(exceptions)¶
-
class
androguard.core.bytecode.
SV
(size, buff)¶ Bases:
object
-
get_value
()¶
-
get_value_buff
()¶
-
set_value
(attr)¶
-
-
class
androguard.core.bytecode.
SVs
(size, ntuple, buff)¶ Bases:
object
-
get_value
()¶
-
get_value_buff
()¶
-
set_value
(attr)¶
-
-
androguard.core.bytecode.
disable_print_colors
()¶
-
androguard.core.bytecode.
enable_print_colors
(colors)¶
-
androguard.core.bytecode.
method2dot
(mx, colors={})¶ Export analysis method to dot format
@param mx : MethodAnalysis object @param colors : MethodAnalysis object
@rtype : dot format buffer (it is a subgraph (dict))
-
androguard.core.bytecode.
method2format
(output, _format='png', mx=None, raw=None)¶ Export method to a specific file format
@param output : output filename @param _format : format type (png, jpg …) (default : png) @param mx : specify the MethodAnalysis object @param raw : use directly a dot raw buffer if None
-
androguard.core.bytecode.
method2jpg
(output, mx, raw=False)¶ Export method to a jpg file format
Parameters: - output (string) – output filename
- mx (
MethodAnalysis
object) – specify the MethodAnalysis object - raw (string) – use directly a dot raw buffer (optional)
-
androguard.core.bytecode.
method2json
(mx, directed_graph=False)¶
-
androguard.core.bytecode.
method2json_direct
(mx)¶
-
androguard.core.bytecode.
method2json_undirect
(mx)¶
-
androguard.core.bytecode.
method2png
(output, mx, raw=False)¶ Export method to a png file format
Parameters: - output (string) – output filename
- mx (
MethodAnalysis
object) – specify the MethodAnalysis object - raw (string) – use directly a dot raw buffer
-
androguard.core.bytecode.
object_to_bytes
(obj)¶ Convert a object to a bytearray or call get_raw() of the object if no useful type was found.
-
androguard.core.bytecode.
vm2json
(vm)¶