Exemplo n.º 1
0
 def test_SignApexFile(self):
     foo_apex = os.path.join(self.testdata_dir, 'foo.apex')
     payload_key = os.path.join(self.testdata_dir, 'testkey_RSA4096.key')
     container_key = os.path.join(self.testdata_dir, 'testkey')
     signed_foo_apex = sign_apex.SignApexFile('avbtool', foo_apex,
                                              payload_key, container_key)
     self.assertTrue(os.path.exists(signed_foo_apex))
Exemplo n.º 2
0
 def test_SignApexWithApk(self):
     test_apex = os.path.join(self.testdata_dir, 'has_apk.apex')
     payload_key = os.path.join(self.testdata_dir, 'testkey_RSA4096.key')
     container_key = os.path.join(self.testdata_dir, 'testkey')
     apk_keys = {
         'wifi-service-resources.apk':
         os.path.join(self.testdata_dir, 'testkey')
     }
     signed_test_apex = sign_apex.SignApexFile('avbtool', test_apex,
                                               payload_key, container_key,
                                               False, apk_keys)
     self.assertTrue(os.path.exists(signed_test_apex))
Exemplo n.º 3
0
 def test_SignCompressedApexFile(self):
   apex = os.path.join(test_utils.get_current_dir(), 'com.android.apex.compressed.v1.capex')
   payload_key = os.path.join(self.testdata_dir, 'testkey_RSA4096.key')
   container_key = os.path.join(self.testdata_dir, 'testkey')
   signed_apex = sign_apex.SignApexFile(
       'avbtool',
       apex,
       payload_key,
       container_key,
       False,
       codename_to_api_level_map={'S': 31})
   self.assertTrue(os.path.exists(signed_apex))