示例#1
0
    def testDeletesDEXFiles(self):

        clean.clean(self.reflector)

        cache = self.reflector.klass.context.cache.files

        self.assertEqual(cache[0].toString(), "---",
                         "DEX File not deleted: %s" % cache[0].toString())
        self.assertEqual(cache[2].toString(), "---",
                         "DEX File not deleted: %s" % cache[2].toString())
示例#2
0
    def testDoesNotDeleteOtherFiles(self):

        clean.clean(self.reflector)

        cache = self.reflector.klass.context.cache.files

        self.assertNotEqual(cache[4].toString(), "---",
                            "non DEX File deleted: %s" % cache[4].toString())
        self.assertNotEqual(cache[5].toString(), "---",
                            "non DEX File deleted: %s" % cache[5].toString())
        self.assertNotEqual(cache[6].toString(), "---",
                            "non APK File deleted: %s" % cache[6].toString())
        self.assertNotEqual(cache[7].toString(), "---",
                            "non DEX File deleted: %s" % cache[7].toString())
        self.assertNotEqual(cache[8].toString(), "---",
                            "non APK File deleted: %s" % cache[8].toString())
示例#3
0
    def do_clean(self, args):
        """
        usage: clean
        
        Cleans APK and DEX files from drozer's cache.
        
        During normal operation, drozer uploads a number of APK files to your device, and extracts the DEX bytecode from others already on your device. This can start to consume a large amount of space, particularly if you are developing drozer modules.
        
        The `clean` command removes all of these cached files for you.
        
        drozer will automatically re-upload any files that it needs as you continue to use it.
        """

        files = clean.clean(self.reflector)

        self.stdout.write("Removed %d cached files.\n" % files)
示例#4
0
文件: session.py 项目: 0xr0ot/drozer
    def do_clean(self, args):
        """
        usage: clean
        
        Cleans APK and DEX files from drozer's cache.
        
        During normal operation, drozer uploads a number of APK files to your device, and extracts the DEX bytecode from others already on your device. This can start to consume a large amount of space, particularly if you are developing drozer modules.
        
        The `clean` command removes all of these cached files for you.
        
        drozer will automatically re-upload any files that it needs as you continue to use it.
        """

        files = clean.clean(self.reflector)
        
        self.stdout.write("Removed %d cached files.\n" % files)
示例#5
0
    def testDeletedFilesCount(self):

        cleaned = clean.clean(self.reflector)

        self.assertEqual(cleaned, 4, "Incorrect Value Returned: %d" % cleaned)
示例#6
0
    def testException(self):

        with self.assertRaises(AttributeError):
            clean.clean(None)