Got basic functionality
currently retrace isn't finding tmp files refs #17
This commit is contained in:
@@ -158,31 +158,38 @@ module ExceptionhandlerHelper
|
|||||||
# de obfuscates a trace of there is a map available
|
# de obfuscates a trace of there is a map available
|
||||||
def deobfuscate (stacktrace, package, build)
|
def deobfuscate (stacktrace, package, build)
|
||||||
|
|
||||||
map = Map.find_by_package(package)
|
map = find_map(package, build)
|
||||||
|
|
||||||
if map != nil
|
if map != nil
|
||||||
map = map.find_by_build(build)
|
|
||||||
end
|
|
||||||
|
|
||||||
if map != nil
|
|
||||||
|
|
||||||
# Save the stack trace to a temp file
|
# Save the stack trace to a temp file
|
||||||
# might need to add ruby path
|
# might need to add ruby path
|
||||||
tf = Tempfile.open('stacktrace')
|
tf = Tempfile.open('stacktrace')
|
||||||
tf.puts stacktrace
|
tf.puts stacktrace
|
||||||
|
|
||||||
#retrace
|
output = ""
|
||||||
Dir.chdir("#{RAILS_ROOT}/vendor/plugins/redmine-exception-handler/public/proguard") do
|
#retrace
|
||||||
Open3.popen3("bin/retrace.sh #{RAILS_ROOT}/public/maps/#{map} #{RAILS_ROOT}/#{tf.path}") do |stdrin, stdout, stderr|
|
Dir.chdir("#{RAILS_ROOT}/vendor/plugins/redmine-exception-handler/public/proguard") do
|
||||||
output = stderr.read
|
Open3.popen3("bin/retrace.sh #{RAILS_ROOT}/public/maps/#{map.map} #{tf.path}") do |stdrin, stdout, stderr|
|
||||||
end
|
output += stderr.read
|
||||||
end
|
end
|
||||||
|
|
||||||
tf.close!
|
tf.close!
|
||||||
retrun output
|
return output
|
||||||
else
|
|
||||||
return stacktrace
|
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
return stacktrace
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# find a proguard map if it exists
|
||||||
|
def find_map (package, build)
|
||||||
|
Map.all.each do |map|
|
||||||
|
if(map.package == package)
|
||||||
|
if map.build == build
|
||||||
|
return map
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user