# Path: androguard/gui/helpers.py
# def classdot2class(path):
#     """ Convert a path such as 'android.support.v4.app.ActivityCompat'
#         into a string 'Landroid/support/v4/app/ActivityCompat'
#         so we can change name of a class by d.CLASS_Landroid_support_v4_app_ActivityCompat.set_name(new_name)
#     """
#     if path[0] == 'L' and path[-1] == ';':
#         log.debug("WARNING: %s already a Lclass; name" % path)
#         return path
# 
#     new_name = 'L' + path.replace('.', '/') + ';'
#     return new_name
# 
# def proto2methodprotofunc(proto):
#     """Convert a prototype such as 'Ljava/lang/String;'
#        into a string 'Ljava_lang_String" so we can append that to the
#        'METHOD_myMethod' if its export python name contains the prototype
#     """
#     return proto.replace(' ', '').replace('(', '').replace('[', '').replace(
#         ')', '').replace('/', '_').replace(';', '')
# 
# Path: androguard/gui/renamewindow.py
# class RenameDialog(QtWidgets.QDialog):
#     """
#         parent: SourceWindow that started the new XrefDialog
#     """
# 
#     def __init__(self, parent=None, win=None, element="", info=()):
#         super().__init__(parent)
# 
#         self.sourceWin = parent
#         self.info = info
#         self.element = element
#         title = "Rename: " + element
#         self.setWindowTitle(title)
# 
#         layout = QtWidgets.QGridLayout()
#         question = QtWidgets.QLabel("Please enter new name:")
#         layout.addWidget(question, 0, 0)
#         self.lineEdit = QtWidgets.QLineEdit()
#         layout.addWidget(self.lineEdit, 0, 1)
#         self.buttonOK = QtWidgets.QPushButton("OK", self)
#         layout.addWidget(self.buttonOK, 1, 1)
#         self.buttonCancel = QtWidgets.QPushButton("Cancel", self)
#         layout.addWidget(self.buttonCancel, 1, 0)
# 
#         self.lineEdit.setText(self.element)
# 
#         self.setLayout(layout)
# 
#         self.buttonCancel.clicked.connect(self.cancelClicked)
#         self.buttonOK.clicked.connect(self.okClicked)
# 
#     def cancelClicked(self):
#         self.close()
# 
#     def okClicked(self):
#         self.sourceWin.renameElement(self.element, self.lineEdit.text(),
#                                      self.info)
#         self.close()


import pyperclip
import logging
from PyQt5 import QtCore, QtGui, QtWidgets
from pygments.formatters.html import HtmlFormatter
from pygments.lexers import JavaLexer
from pygments.style import Style
from pygments.token import Token, Comment, Name, Keyword, Generic, Number, Operator, String
from androguard.gui.helpers import classdot2class, proto2methodprotofunc
from androguard.gui.renamewindow import RenameDialog
from androguard.gui.xrefwindow import XrefDialogMethod, XrefDialogField



log = logging.getLogger("androguard.gui")

BINDINGS_NAMES = [
    'NAME_PACKAGE', 'NAME_PROTOTYPE', 'NAME_SUPERCLASS', 'NAME_INTERFACE',
    'NAME_FIELD', 'NAME_METHOD_PROTOTYPE', 'NAME_ARG', 'NAME_CLASS_ASSIGNMENT',
    'NAME_PARAM', 'NAME_BASE_CLASS', 'NAME_METHOD_INVOKE', 'NAME_CLASS_NEW',
    'NAME_CLASS_INSTANCE', 'NAME_VARIABLE', 'NAME_CLASS_EXCEPTION'

# Path: androguard/gui/helpers.py
# def classdot2class(path):
#     """ Convert a path such as 'android.support.v4.app.ActivityCompat'
#         into a string 'Landroid/support/v4/app/ActivityCompat'
#         so we can change name of a class by d.CLASS_Landroid_support_v4_app_ActivityCompat.set_name(new_name)
#     """
#     if path[0] == 'L' and path[-1] == ';':
#         log.debug("WARNING: %s already a Lclass; name" % path)
#         return path
# 
#     new_name = 'L' + path.replace('.', '/') + ';'
#     return new_name
# 
# def proto2methodprotofunc(proto):
#     """Convert a prototype such as 'Ljava/lang/String;'
#        into a string 'Ljava_lang_String" so we can append that to the
#        'METHOD_myMethod' if its export python name contains the prototype
#     """
#     return proto.replace(' ', '').replace('(', '').replace('[', '').replace(
#         ')', '').replace('/', '_').replace(';', '')
# 
# Path: androguard/gui/renamewindow.py
# class RenameDialog(QtWidgets.QDialog):
#     """
#         parent: SourceWindow that started the new XrefDialog
#     """
# 
#     def __init__(self, parent=None, win=None, element="", info=()):
#         super().__init__(parent)
# 
#         self.sourceWin = parent
#         self.info = info
#         self.element = element
#         title = "Rename: " + element
#         self.setWindowTitle(title)
# 
#         layout = QtWidgets.QGridLayout()
#         question = QtWidgets.QLabel("Please enter new name:")
#         layout.addWidget(question, 0, 0)
#         self.lineEdit = QtWidgets.QLineEdit()
#         layout.addWidget(self.lineEdit, 0, 1)
#         self.buttonOK = QtWidgets.QPushButton("OK", self)
#         layout.addWidget(self.buttonOK, 1, 1)
#         self.buttonCancel = QtWidgets.QPushButton("Cancel", self)
#         layout.addWidget(self.buttonCancel, 1, 0)
# 
#         self.lineEdit.setText(self.element)
# 
#         self.setLayout(layout)
# 
#         self.buttonCancel.clicked.connect(self.cancelClicked)
#         self.buttonOK.clicked.connect(self.okClicked)
# 
#     def cancelClicked(self):
#         self.close()
# 
#     def okClicked(self):
#         self.sourceWin.renameElement(self.element, self.lineEdit.text(),
#                                      self.info)
#         self.close()


# Path: androguard/gui/sourcewindow.py
import pyperclip
import logging
from PyQt5 import QtCore, QtGui, QtWidgets
from pygments.formatters.html import HtmlFormatter
from pygments.lexers import JavaLexer
from pygments.style import Style
from pygments.token import Token, Comment, Name, Keyword, Generic, Number, Operator, String
from androguard.gui.helpers import classdot2class, proto2methodprotofunc
from androguard.gui.renamewindow import RenameDialog
from androguard.gui.xrefwindow import XrefDialogMethod, XrefDialogField




log = logging.getLogger("androguard.gui")

BINDINGS_NAMES = [
    'NAME_PACKAGE', 'NAME_PROTOTYPE', 'NAME_SUPERCLASS', 'NAME_INTERFACE',
    'NAME_FIELD', 'NAME_METHOD_PROTOTYPE', 'NAME_ARG', 'NAME_CLASS_ASSIGNMENT',
    'NAME_PARAM', 'NAME_BASE_CLASS', 'NAME_METHOD_INVOKE', 'NAME_CLASS_NEW',
    'NAME_CLASS_INSTANCE', 'NAME_VARIABLE', 'NAME_CLASS_EXCEPTION'

]