Example #1
0
    def testListClasses_noStatusPrefix(self):
        oatdump_output = [
            _CreateOdexLine('a.b.JavaClass1', 6, 'Verified'),
            _CreateOdexLine('a.b.JavaClass2', 7, 'RetryVerificationAtRuntime'),
        ]

        classes = list_verification.ListClassesAndVerificationStatus(
            oatdump_output, None)
        self.assertEqual(2, len(classes))
        java_class_1 = _ClassForName('a.b.JavaClass1', classes)
        java_class_2 = _ClassForName('a.b.JavaClass2', classes)
        self.assertEqual(java_class_1.verification_status, 'Verified')
        self.assertEqual(java_class_2.verification_status,
                         'RetryVerificationAtRuntime')
Example #2
0
    def testListClasses_proguardMap(self):
        oatdump_output = [
            _CreateOdexLine('a.b.ObfuscatedJavaClass1', 6, 'StatusVerified'),
            _CreateOdexLine('a.b.ObfuscatedJavaClass2', 7,
                            'StatusRetryVerificationAtRuntime'),
        ]

        mapping = {
            'a.b.ObfuscatedJavaClass1': 'a.b.JavaClass1',
            'a.b.ObfuscatedJavaClass2': 'a.b.JavaClass2',
        }
        classes = list_verification.ListClassesAndVerificationStatus(
            oatdump_output, mapping)
        self.assertEqual(2, len(classes))
        java_class_1 = _ClassForName('a.b.JavaClass1', classes)
        java_class_2 = _ClassForName('a.b.JavaClass2', classes)
        self.assertEqual(java_class_1.verification_status, 'Verified')
        self.assertEqual(java_class_2.verification_status,
                         'RetryVerificationAtRuntime')