Skip to content

Commit

Permalink
Clean Fix for 32 Bit
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentcox committed Oct 12, 2018
1 parent 587da17 commit 07816b2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/helpers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,14 @@ def app_prepper(self):
cmd = "bash "+cmd
Logger(cmd)

import subprocess, os
my_env = os.environ.copy()
my_env["JAVA_OPTS"] = "-Xmx2G"
jadx_process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, env=my_env)
# Check if system is running 32 bit system. If so, set memory to max 2GIG for Java.
if (sys.maxsize > 2 ** 32):
jadx_process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
else:
Logger("32 bit detected, setting max memory for java to 2G instead of 4G. This might cause problems for JADX.")
my_env = os.environ.copy()
my_env["JAVA_OPTS"] = "-Xmx2G"
jadx_process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, env=my_env)
output_jadx = "--------- JADX OUTPUT BELOW --------- \n "
for line in jadx_process.stdout:
output_jadx += str(line)
Expand Down

0 comments on commit 07816b2

Please sign in to comment.