tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

java_deobfuscate.py (980B)


      1 #!/usr/bin/env python3
      2 #
      3 # Copyright 2020 The Chromium Authors
      4 # Use of this source code is governed by a BSD-style license that can be
      5 # found in the LICENSE file.
      6 """Wrapper script for java_deobfuscate.
      7 
      8 This is also a buildable target, but having it pre-built here simplifies usage.
      9 """
     10 
     11 import os
     12 import sys
     13 
     14 DIR_SOURCE_ROOT = os.path.normpath(
     15    os.path.join(os.path.dirname(__file__), '../../../'))
     16 
     17 def main():
     18  classpath = [
     19      os.path.join(DIR_SOURCE_ROOT, 'build', 'android', 'stacktrace',
     20                   'java_deobfuscate_java.jar'),
     21      os.path.join(DIR_SOURCE_ROOT, 'third_party', 'r8', 'cipd', 'lib',
     22                   'r8.jar')
     23  ]
     24  java_path = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'jdk', 'current',
     25                           'bin', 'java')
     26 
     27  cmd = [
     28      java_path, '-classpath', ':'.join(classpath),
     29      'org.chromium.build.FlushingReTrace'
     30  ]
     31  cmd.extend(sys.argv[1:])
     32 
     33  os.execvp(cmd[0], cmd)
     34 
     35 
     36 if __name__ == '__main__':
     37  main()