Showing preview only (332K chars total). Download the full file or copy to clipboard to get everything.
Repository: tresacton/dspectrumgui
Branch: master
Commit: d80d063cd7c8
Files: 267
Total size: 274.5 KB
Directory structure:
gitextract_do_0u321/
├── .gitignore
├── .rspec
├── .ruby-gemset
├── .ruby-version
├── .well-known/
│ └── .placeholder
├── COMM-LICENSE
├── Gemfile
├── Guardfile
├── LICENSE
├── README.md
├── Rakefile
├── SECURITY.md
├── app/
│ ├── assets/
│ │ ├── images/
│ │ │ └── .keep
│ │ ├── javascripts/
│ │ │ ├── advisories.coffee
│ │ │ ├── advisory_comments.coffee
│ │ │ ├── application.js
│ │ │ ├── captures.coffee
│ │ │ ├── categories.coffee
│ │ │ ├── challenge_attempts.coffee
│ │ │ ├── challenges.coffee
│ │ │ ├── dashboard.coffee
│ │ │ ├── devices.coffee
│ │ │ ├── messages.coffee
│ │ │ ├── product_versions.coffee
│ │ │ ├── products.coffee
│ │ │ ├── profile.coffee
│ │ │ ├── sections.coffee
│ │ │ ├── submission.coffee
│ │ │ ├── triage.coffee
│ │ │ ├── units.coffee
│ │ │ └── vendors.coffee
│ │ └── stylesheets/
│ │ ├── advisories.scss
│ │ ├── advisory_comments.scss
│ │ ├── application.scss
│ │ ├── captures.scss
│ │ ├── categories.scss
│ │ ├── challenge_attempts.scss
│ │ ├── challenges.scss
│ │ ├── dashboard.scss
│ │ ├── devices.scss
│ │ ├── messages.scss
│ │ ├── product_versions.scss
│ │ ├── products.scss
│ │ ├── profile.scss
│ │ ├── researcher.scss
│ │ ├── scaffolds.scss
│ │ ├── sections.scss
│ │ ├── submission.scss
│ │ ├── triage.scss
│ │ ├── units.scss
│ │ └── vendors.scss
│ ├── controllers/
│ │ ├── application_controller.rb
│ │ ├── captures_controller.rb
│ │ ├── concerns/
│ │ │ └── .keep
│ │ ├── dashboard_controller.rb
│ │ ├── devices_controller.rb
│ │ ├── registrations_controller.rb
│ │ ├── section_templates_controller.rb
│ │ ├── sections_controller.rb
│ │ └── units_controller.rb
│ ├── helpers/
│ │ ├── application_helper.rb
│ │ ├── captures_helper.rb
│ │ ├── dashboard_helper.rb
│ │ ├── devices_helper.rb
│ │ ├── section_templates_helper.rb
│ │ ├── sections_helper.rb
│ │ └── units_helper.rb
│ ├── models/
│ │ ├── .keep
│ │ ├── capture.rb
│ │ ├── concerns/
│ │ │ └── .keep
│ │ ├── cons.rb
│ │ ├── device.rb
│ │ ├── section.rb
│ │ ├── section_template.rb
│ │ ├── unit.rb
│ │ └── user.rb
│ └── views/
│ ├── application/
│ │ └── _favicon.html.erb
│ ├── captures/
│ │ ├── _form.html.haml
│ │ ├── edit.html.haml
│ │ ├── index.html.haml
│ │ ├── index.json.jbuilder
│ │ ├── new.html.haml
│ │ ├── show.html.haml
│ │ └── show.json.jbuilder
│ ├── dashboard/
│ │ ├── about.html.haml
│ │ ├── contribute.html.haml
│ │ └── temp.html.haml
│ ├── devices/
│ │ ├── _add_unit.html.haml
│ │ ├── _form.html.haml
│ │ ├── _manchester_analysis.html.haml
│ │ ├── _pwm_analysis.html.haml
│ │ ├── _raw_analysis.html.haml
│ │ ├── _show_units.html.haml
│ │ ├── edit.html.haml
│ │ ├── index.html.haml
│ │ ├── index.json.jbuilder
│ │ ├── new.html.haml
│ │ ├── show.html.haml
│ │ └── show.json.jbuilder
│ ├── devise/
│ │ ├── confirmations/
│ │ │ └── new.html.erb
│ │ ├── mailer/
│ │ │ ├── confirmation_instructions.html.erb
│ │ │ ├── password_change.html.erb
│ │ │ ├── reset_password_instructions.html.erb
│ │ │ └── unlock_instructions.html.erb
│ │ ├── passwords/
│ │ │ ├── edit.html.haml
│ │ │ └── new.html.haml
│ │ ├── registrations/
│ │ │ ├── edit.html.erb
│ │ │ └── new.html.haml
│ │ ├── sessions/
│ │ │ └── new.html.haml
│ │ ├── shared/
│ │ │ └── _links.html.erb
│ │ └── unlocks/
│ │ └── new.html.haml
│ ├── layouts/
│ │ ├── _footer.html.erb
│ │ ├── _messages.html.haml
│ │ ├── _navigation.html.haml
│ │ ├── _navigation_links.html.erb
│ │ ├── application.html.haml
│ │ ├── mailer.html.haml
│ │ └── mailer.text.haml
│ ├── profile/
│ │ ├── edit.html.haml
│ │ ├── index.html.haml
│ │ └── show.html.haml
│ ├── section_templates/
│ │ ├── index.html.haml
│ │ └── show.html.haml
│ ├── sections/
│ │ ├── _form.html.haml
│ │ ├── _manchester_analysis.html.haml
│ │ ├── _no_sections.html.haml
│ │ ├── _pwm_analysis.html.haml
│ │ ├── _raw_analysis.html.haml
│ │ ├── _rfcat_config.html.haml
│ │ ├── _section_transformations.html.haml
│ │ ├── _sections.html.haml
│ │ ├── edit.html.haml
│ │ ├── generate.html.haml
│ │ ├── index.html.haml
│ │ ├── index.json.jbuilder
│ │ ├── new.html.haml
│ │ ├── show.html.haml
│ │ └── show.json.jbuilder
│ └── units/
│ ├── _captures.html.haml
│ ├── _form.html.haml
│ ├── _manchester_analysis.html.haml
│ ├── _manchester_decoding.html.haml
│ ├── _pwm_analysis.html.haml
│ ├── _pwm_decoding.html.haml
│ ├── _raw_analysis.html.haml
│ ├── _raw_decoding.html.haml
│ ├── edit.html.haml
│ ├── index.html.haml
│ ├── index.json.jbuilder
│ ├── new.html.haml
│ ├── show.html.haml
│ └── show.json.jbuilder
├── bin/
│ ├── bundle
│ ├── rails
│ ├── rake
│ └── setup
├── config/
│ ├── application.rb
│ ├── boot.rb
│ ├── database.yml
│ ├── environment.rb
│ ├── environments/
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── favicon.json
│ ├── initializers/
│ │ ├── action_mailer.rb
│ │ ├── assets.rb
│ │ ├── backtrace_silencers.rb
│ │ ├── cookies_serializer.rb
│ │ ├── devise.rb
│ │ ├── filter_parameter_logging.rb
│ │ ├── inflections.rb
│ │ ├── kaminari.rb
│ │ ├── mime_types.rb
│ │ ├── session_store.rb
│ │ ├── simple_form.rb
│ │ └── wrap_parameters.rb
│ ├── locales/
│ │ ├── devise.en.yml
│ │ ├── en.yml
│ │ ├── simple_form.en.yml
│ │ ├── social_share_button.en.yml
│ │ ├── social_share_button.zh-CN.yml
│ │ └── social_share_button.zh-TW.yml
│ ├── railscomposer.yml
│ ├── routes.rb
│ └── secrets.yml
├── config.ru
├── db/
│ ├── migrate/
│ │ ├── 20160225071956_devise_create_users.rb
│ │ ├── 20160227015521_add_full_name_to_user.rb
│ │ ├── 20160918060423_create_devices.rb
│ │ ├── 20160918060509_create_units.rb
│ │ ├── 20160918060631_create_captures.rb
│ │ ├── 20170515023720_create_sections.rb
│ │ ├── 20170520033410_add_flip_pwm_to_devices.rb
│ │ └── 20170525084143_create_section_templates.rb
│ ├── schema.rb
│ ├── seeds.rb
│ └── template_seeds/
│ └── user_contributions.rb
├── lib/
│ ├── assets/
│ │ └── .keep
│ ├── tasks/
│ │ ├── .keep
│ │ ├── account_seeds.rake
│ │ └── custom_seed.rake
│ └── templates/
│ └── haml/
│ └── scaffold/
│ └── _form.html.haml
├── public/
│ ├── 404.html
│ ├── 422.html
│ ├── 500.html
│ └── robots.txt
├── spec/
│ ├── controllers/
│ │ ├── captures_controller_spec.rb
│ │ ├── devices_controller_spec.rb
│ │ ├── section_templates_controller_spec.rb
│ │ ├── sections_controller_spec.rb
│ │ └── units_controller_spec.rb
│ ├── factories/
│ │ ├── captures.rb
│ │ ├── devices.rb
│ │ ├── section_templates.rb
│ │ ├── sections.rb
│ │ └── units.rb
│ ├── helpers/
│ │ ├── captures_helper_spec.rb
│ │ ├── devices_helper_spec.rb
│ │ ├── section_templates_helper_spec.rb
│ │ ├── sections_helper_spec.rb
│ │ └── units_helper_spec.rb
│ ├── models/
│ │ ├── capture_spec.rb
│ │ ├── device_spec.rb
│ │ ├── section_spec.rb
│ │ ├── section_template_spec.rb
│ │ └── unit_spec.rb
│ ├── rails_helper.rb
│ ├── requests/
│ │ ├── captures_spec.rb
│ │ ├── devices_spec.rb
│ │ ├── section_templates_spec.rb
│ │ ├── sections_spec.rb
│ │ └── units_spec.rb
│ ├── routing/
│ │ ├── captures_routing_spec.rb
│ │ ├── devices_routing_spec.rb
│ │ ├── section_templates_routing_spec.rb
│ │ ├── sections_routing_spec.rb
│ │ └── units_routing_spec.rb
│ ├── spec_helper.rb
│ └── views/
│ ├── captures/
│ │ ├── edit.html.haml_spec.rb
│ │ ├── index.html.haml_spec.rb
│ │ ├── new.html.haml_spec.rb
│ │ └── show.html.haml_spec.rb
│ ├── devices/
│ │ ├── edit.html.haml_spec.rb
│ │ ├── index.html.haml_spec.rb
│ │ ├── new.html.haml_spec.rb
│ │ └── show.html.haml_spec.rb
│ ├── section_templates/
│ │ ├── edit.html.haml_spec.rb
│ │ ├── index.html.haml_spec.rb
│ │ ├── new.html.haml_spec.rb
│ │ └── show.html.haml_spec.rb
│ ├── sections/
│ │ ├── edit.html.haml_spec.rb
│ │ ├── index.html.haml_spec.rb
│ │ ├── new.html.haml_spec.rb
│ │ └── show.html.haml_spec.rb
│ └── units/
│ ├── edit.html.haml_spec.rb
│ ├── index.html.haml_spec.rb
│ ├── new.html.haml_spec.rb
│ └── show.html.haml_spec.rb
├── test/
│ ├── controllers/
│ │ └── .keep
│ ├── fixtures/
│ │ └── .keep
│ ├── helpers/
│ │ └── .keep
│ ├── integration/
│ │ └── .keep
│ ├── mailers/
│ │ └── .keep
│ ├── models/
│ │ └── .keep
│ └── test_helper.rb
└── vendor/
└── assets/
├── javascripts/
│ └── .keep
└── stylesheets/
└── .keep
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
#----------------------------------------------------------------------------
# Ignore these files when commiting to a git repository.
#
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# The original version of this file is found here:
# https://github.com/RailsApps/rails-composer/blob/master/files/gitignore.txt
#
# Corrections? Improvements? Create a GitHub issue:
# http://github.com/RailsApps/rails-composer/issues
#----------------------------------------------------------------------------
# user files
/mcs/*
# github issue template files
/.github
# bundler state
/.bundle
/vendor/bundle/
/vendor/ruby/
# minimal Rails specific artifacts
db/*.sqlite3
/db/*.sqlite3-journal
/log/*
/tmp/*
# add /config/database.yml if it contains passwords
# /config/database.yml
# various artifacts
**.war
*.rbc
*.sassc
.redcar/
.sass-cache
/config/config.yml
/coverage.data
/coverage/
/db/*.javadb/
/db/*.sqlite3
/doc/api/
/doc/app/
/doc/features.html
/doc/specs.html
/public/cache
/public/stylesheets/compiled
/public/system/*
/spec/tmp/*
/cache
/capybara*
/capybara-*.html
/gems
/specifications
rerun.txt
pickle-email-*.html
.zeus.sock
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
#
# Here are some files you may want to ignore globally:
# scm revert files
**.orig
# Mac finder artifacts
.DS_Store
# Netbeans project directory
/nbproject/
# RubyMine project files
.idea
# Textmate project files
/*.tmproj
# vim artifacts
**.swp
# Environment files that may contain sensitive data
.env
.powenv
# tilde files are usually backup files from a text editor
*~
================================================
FILE: .rspec
================================================
--require spec_helper
--format Fuubar
--color
================================================
FILE: .ruby-gemset
================================================
dspectrumgui
================================================
FILE: .ruby-version
================================================
ruby-2.5.5
================================================
FILE: .well-known/.placeholder
================================================
================================================
FILE: COMM-LICENSE
================================================
MIT License
Copyright (c) 2017 Très Acton
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: Gemfile
================================================
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
ruby '2.5.5'
gem 'rails', '4.2.11.1'
# gem 'letsencrypt_plugin' # free SSL
# Use sqlite3 as the database for Active Record
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
gem 'jquery-turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'will_paginate'
gem 'will_paginate-bootstrap'
gem 'seed_dump'
gem 'shareable'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'rake-progressbar'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'rails_real_favicon'
gem 'pry'
end
gem "administrate"
gem 'bootstrap-sass'
gem 'devise'
gem 'devise_invitable'
gem 'haml-rails'
gem 'high_voltage'
# gem 'pg'
gem 'simple_form'
gem 'upmin-admin'
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
gem 'better_errors'
gem 'binding_of_caller', :platforms=>[:mri_21]
gem 'guard-bundler'
gem 'guard-rails'
gem 'html2haml'
gem 'quiet_assets'
gem 'rails_apps_pages'
gem 'rails_apps_testing'
gem 'rails_layout'
gem 'rb-fchange', :require=>false
gem 'rb-inotify', :require=>false
gem 'spring-commands-rspec'
end
group :development, :test do
gem "sqlite3", "~> 1.3.6"
gem 'factory_girl_rails'
gem 'faker'
gem 'rspec-rails'
gem 'shoulda'
gem 'rb-fsevent', :require => false #if RUBY_PLATFORM =~ /darwin/i
gem 'guard-rspec'
gem 'fuubar'
end
group :production do
#gem 'puma'
gem 'rails_12factor'
end
group :test do
gem 'capybara'
gem 'database_cleaner'
gem 'launchy'
gem 'selenium-webdriver'
end
================================================
FILE: Guardfile
================================================
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
## Uncomment and set this to only include directories you want to watch
# directories %w(app lib config test spec features) \
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
## Note: if you are using the `directories` clause above and you are not
## watching the project directory ('.'), then you will want to move
## the Guardfile to a watched dir and symlink it back, e.g.
#
# $ mkdir config
# $ mv Guardfile config/
# $ ln -s config/Guardfile .
#
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
# Note: The cmd option is now required due to the increasing number of ways
# rspec may be run, below are examples of the most common uses.
# * bundler: 'bundle exec rspec'
# * bundler binstubs: 'bin/rspec'
# * spring: 'bin/rspec' (This will use spring if running and you have
# installed the spring binstubs per the docs)
# * zeus: 'zeus rspec' (requires the server to be started separately)
# * 'just' rspec: 'rspec'
guard :rspec, cmd: "bundle exec rspec" do
require "guard/rspec/dsl"
dsl = Guard::RSpec::Dsl.new(self)
# Feel free to open issues for suggestions and improvements
# RSpec files
rspec = dsl.rspec
watch(rspec.spec_helper) { rspec.spec_dir }
watch(rspec.spec_support) { rspec.spec_dir }
watch(rspec.spec_files)
# Ruby files
ruby = dsl.ruby
dsl.watch_spec_files_for(ruby.lib_files)
# Rails files
rails = dsl.rails(view_extensions: %w(erb haml slim))
dsl.watch_spec_files_for(rails.app_files)
dsl.watch_spec_files_for(rails.views)
watch(rails.controllers) do |m|
[
rspec.spec.("routing/#{m[1]}_routing"),
rspec.spec.("controllers/#{m[1]}_controller"),
rspec.spec.("acceptance/#{m[1]}")
]
end
# Rails config changes
watch(rails.spec_helper) { rspec.spec_dir }
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
# Capybara features specs
watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
watch(rails.layouts) { |m| rspec.spec.("features/#{m[1]}") }
# Turnip features and steps
watch(%r{^spec/acceptance/(.+)\.feature$})
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
end
end
================================================
FILE: LICENSE
================================================
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.
================================================
FILE: README.md
================================================
# DSpectrumGUI
The goal of this app is to make it trivial to demodulate common RF signals, and provide a digital worksheet for your reverse engineering efforts.

# Installation
Step by step instructions for Kali Linux (Debian based OS), and MAC OSX, are both available in the wiki:
<https://github.com/tresacton/dspectrumgui/wiki>
# Features
* Community can trivially donate reverse engineering worksheet templates
* Users can trivially import donated reverse engineering worksheet templates
* Ability to store device metadata and transmission binary
* Wraps Inspectrum and uses its "Extract Symbols" feature to help convert pulses into raw binary
* Automatic analysis of the binary to determine the modulation and encoding types (see Supported modulation types)
* Some error detection and verbose comments where the app believes it knows which modulation type would have been valid if the user better aligned the symbols in Inspectrum (particularly where significant whitespace was missed in PWM or where symbols are misaligned for Manchester)
* Reverse Engineering Worksheet to help you visualise the packet structure and comment on sections of the signal
* Binary Generation for RFCat transmission
# Do I need any hardware?
You do if you need to capture transmissiosn from your device. An RTL-SDR, a HackRF, or anything else that will work with tools like osmocom_fft (which is the recommended way to capture your transmission for use with this tool). If you're just here to try it out and have no hardware, find a CFILE/IQ file on the internet for a simple device and give it a shot. As long as its a format supported by Inspectrum, you're good to go.
# How does it work?
Assuming you have already captured some signals (Osmocom_fft is great for this!), and have created a new "Device" and "Unit" in DSpectrumGUI, you can click the link "Add New Capture". The application will then spawn an instance of Inspectrum. Once you've appropriately adjusted your symbol/grid overlay in Inspectrum, and asked it to "extract symbols", DSpectrumGUI will then convert that data into a binary string and attempt to automatically demodulate/decode it for you. It also provides a database for you to store pertinent information such as the frequency, baudrate, and FCC ID of the device for your future reference.
When you have some demodulated signals and navigate to the "Reverse Engineering Worksheet" for the device, DSpectrumGUI will present you with a form that allows you to define your own definitions for each section of the data (e.g. marking the first 'n' bits as the Device Identifier string - if that's what you discover they represent), and record your notes/observations about that section as you are working. This is very useful as you are reverse engineering your device. It allows you to keep all of your notes and observations in once place, in a structured and organised manner. Once you're satisfied with your demodulation and reverse engineering, you can choose to share your section definitions as a template for other DSpectrumGUI users to benefit from.
The reverse engineering worksheet view also helps you to view some common binary to integer translations for your defined sections, and gives you some code you can use to attempt to generate your own signals using RFCat.
# Supported Modulation/Encoding
* Pulse-width Modulation (PWM) - 77/25 duty cycle version, and 66/33 duty cycle version
* Frequency Shift Keying (2FSK) - though the app will treat it as OOK
* On-off Keying (OOK) / Amplitude Shift Keying (ASK)
* Manchester encoding - both "G. E. Thomas" format, and "IEE 802" format
# Usage
The wiki will be updated as I have time. In the interim, there's a high-level PDF guide I developed for a workshop which demonstrates the basic use of this application. It's available here:
[DSpectrumGUI Reverse Engineering Guide](https://github.com/tresacton/dspectrumgui/raw/master/public/DSpectrumGUI%20%E2%80%93%20Reverse%20Engineering%20Guide.pdf)
## License
Licensing is AGPL by default for personal use. An MIT license is available for purchase for commercial use.
================================================
FILE: Rakefile
================================================
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
Rails.application.load_tasks
================================================
FILE: SECURITY.md
================================================
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| Master | :white_check_mark: |
| v1.0.0 | :white_check_mark: |
## Reporting a Vulnerability
Open an issue. This isn't a production / public facing tool, and it can be run in a VM in isolation (with a local only connection) as it doesn't interface directly with any SDR/RF hardware to mitigate risks. If you found a vuln, chances are someone else has too. Add it in as an issue here for all to see so I'm pressured to do something about it =P
That said - this application isn't intended to have a high security maturity. I'll certainly make an effort to fix things where possible.
Feel empowered to help me out by submitting a pull request for a fix. If it seems sound and doesn't break anything, I'll pull it into the codebase.
Thanks xD
================================================
FILE: app/assets/images/.keep
================================================
================================================
FILE: app/assets/javascripts/advisories.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/advisory_comments.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/application.js
================================================
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require jquery.turbolinks
//= require bootstrap-sprockets
//= require_tree .
================================================
FILE: app/assets/javascripts/captures.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/categories.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/challenge_attempts.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/challenges.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/dashboard.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/devices.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/messages.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/product_versions.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/products.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/profile.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/sections.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/submission.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/triage.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/units.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/javascripts/vendors.coffee
================================================
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
================================================
FILE: app/assets/stylesheets/advisories.scss
================================================
// Place all the styles related to the Advisories controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/advisory_comments.scss
================================================
// Place all the styles related to the AdvisoryComments controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/application.scss
================================================
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*/
// "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables"
@import "bootstrap-sprockets";
@import "bootstrap";
@import "bootstrap.min";
@font-face {
font-family: "neuropol";
src: asset-url('neuropol.ttf') format('truetype'),
}
.neuro {
font-family: 'neuropol';
}
.nounderline{text-decoration: none}
================================================
FILE: app/assets/stylesheets/captures.scss
================================================
// Place all the styles related to the Captures controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/categories.scss
================================================
// Place all the styles related to the Categories controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/challenge_attempts.scss
================================================
// Place all the styles related to the ChallengeAttempts controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/challenges.scss
================================================
// Place all the styles related to the Challenges controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/dashboard.scss
================================================
// Place all the styles related to the Dashboard controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.mcontainer {
width: 100%;
height: 10em;
margin: 1em auto;
overflow: hidden;
/*background: grey;*/
position: bottom;
box-sizing: border-box;
}
.right {
float:right;
}
.marquee {
top: 6em;
position: relative;
box-sizing: border-box;
animation: marquee 15s linear infinite;
&:hover {
animation-play-state: paused;
}
}
/* Make it move! */
@keyframes marquee {
0% {
top: 8em;
}
100% {
top: -11em;
}
}
/* Make it look pretty */
.microsoft {
.marquee {
margin: 0;
padding: 0 1em;
line-height: 1.5em;
font: 1em 'Segoe UI', Tahoma, Helvetica, Sans-Serif;
}
&:before, &::before, &:after, &::after {
left: 0;
z-index: 1;
content: '';
position: absolute;
pointer-events: none;
width: 100%;
height: 2em;
background-image: linear-gradient(top, black, rgba(255, 255, 255, 0));
}
&:after, &::after {
bottom: 0;
transform: rotate(180deg);
}
&:before, &::before {
top: 0;
}
}
/* Style the links */
.vanity {
color: black;
text-align: center;
font: .75em 'Segoe UI', Tahoma, Helvetica, Sans-Serif;
a {
color: #1570A6;
transition: color .5s;
text-decoration: none;
}
}
.microsoft a {
color: #1570A6;
transition: color .5s;
text-decoration: none;
}
.vanity a:hover, .microsoft a:hover {
color: #F65314;
}
/* Style toggle button */
.toggle {
display: block;
margin: 2em auto;
}
================================================
FILE: app/assets/stylesheets/devices.scss
================================================
// Place all the styles related to the Devices controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/messages.scss
================================================
// Place all the styles related to the Messages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/product_versions.scss
================================================
// Place all the styles related to the ProductVersions controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/products.scss
================================================
// Place all the styles related to the Products controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/profile.scss
================================================
// Place all the styles related to the profile controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/researcher.scss
================================================
// Place all the styles related to the researcher controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/scaffolds.scss
================================================
body {
background-color: #fff;
color: #333;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
button.plus { background-image: url(image_path('plus.png')); }
p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a {
color: #000;
&:visited {
color: #666;
}
&:hover {
color: #fff;
background-color: #000;
}
}
div {
&.field, &.actions {
margin-bottom: 10px;
}
}
#notice {
color: green;
}
.field_with_errors {
padding: 2px;
background-color: red;
display: table;
}
#error_explanation {
width: 450px;
border: 2px solid red;
padding: 7px;
padding-bottom: 0;
margin-bottom: 20px;
background-color: #f0f0f0;
h2 {
text-align: left;
font-weight: bold;
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: -7px;
margin-bottom: 0px;
background-color: #c00;
color: #fff;
}
ul li {
font-size: 12px;
list-style: square;
}
}
================================================
FILE: app/assets/stylesheets/sections.scss
================================================
// Place all the styles related to the Sections controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/submission.scss
================================================
// Place all the styles related to the submission controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/triage.scss
================================================
// Place all the styles related to the Triage controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/units.scss
================================================
// Place all the styles related to the Units controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/assets/stylesheets/vendors.scss
================================================
// Place all the styles related to the Vendors controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
================================================
FILE: app/controllers/application_controller.rb
================================================
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :authenticate_user!
end
================================================
FILE: app/controllers/captures_controller.rb
================================================
class CapturesController < ApplicationController
before_action :set_capture, only: [:show, :edit, :update, :destroy, :shift_left, :shift_right]
require 'pty'
# GET /captures
# GET /captures.json
def index
@captures = Capture.all
end
# GET /captures/1
# GET /captures/1.json
def show
end
def shift_right
@capture.shift_right
redirect_to :back
end
def shift_left
@capture.shift_left
redirect_to :back
end
# GET /captures/new
def new
@capture = Capture.new(unit_id:params[:unit_id],device_id:params[:device_id])
# dd
# `inspectrum`
cmd = 'inspectrum'
begin
PTY.spawn(cmd) do |r, stdin, pid|
begin
got_it = false
loop do
if !got_it
line = r.gets
raw = line.chomp.strip.split(',')
puts "\n[*] Data as array: #{raw}"
if raw.count > 1
demod = ''
arr = raw
threshold = arr.inject { |sum, el| sum + el }.to_f / arr.size
raw.to_a.each do |r|
r.to_f > threshold.to_f ? demod << '1' : demod << '0'
end
# threshold safety check start
# threshold_safety_check raw, threshold
# threshold safety check end
# hex = print_results demod
# compare demod
@capture.original_binary = demod
got_it = true unless demod == ''
end
else
break
end
end
Process.kill 'INT', pid
rescue Errno::EIO
puts '[!] Errno:EIO error, this may just mean the process has finished giving output'.colorize(:red)
Process.kill 'INT', pid
end
end
rescue PTY::ChildExited
puts '[!] The child process exited!'.colorize(:red)
end
end
# GET /captures/1/edit
def edit
end
# POST /captures
# POST /captures.json
def create
@capture = Capture.new(capture_params)
respond_to do |format|
if @capture.save
@capture.binary = @capture.original_binary
@capture.save
puts "the above update occured on create..."
format.html { redirect_to @capture.unit, notice: 'Capture was successfully created.' }
format.json { render :show, status: :created, location: @capture }
else
format.html { render :new }
format.json { render json: @capture.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /captures/1
# PATCH/PUT /captures/1.json
def update
respond_to do |format|
if @capture.update(capture_params)
format.html { redirect_to @capture, notice: 'Capture was successfully updated.' }
format.json { render :show, status: :ok, location: @capture }
else
format.html { render :edit }
format.json { render json: @capture.errors, status: :unprocessable_entity }
end
end
end
# DELETE /captures/1
# DELETE /captures/1.json
def destroy
@capture.destroy
respond_to do |format|
format.html { redirect_to captures_url, notice: 'Capture was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_capture
begin
@capture = Capture.find(params[:id])
rescue
@capture = Capture.find(params[:capture_id])
end
end
# Never trust parameters from the scary internet, only allow the white list through.
def capture_params
params.require(:capture).permit(:unit_id, :device_id, :name, :notes, :binary, :original_binary)
end
end
================================================
FILE: app/controllers/concerns/.keep
================================================
================================================
FILE: app/controllers/dashboard_controller.rb
================================================
class DashboardController < ApplicationController
skip_before_filter :authenticate_user!, only: [:about]
def about
`git fetch`
@tags = `git describe --tags`
@version = `git log -n 1 --pretty=format:"%H"`
@count_behind_origin = `git rev-list master..origin/master --count`.to_i
end
def temp
end
def contribute
@cont = `cat #{Rails.root.join('mcs', 'contribution.md').to_s}`
end
end
================================================
FILE: app/controllers/devices_controller.rb
================================================
class DevicesController < ApplicationController
require 'csv'
before_action :set_device, only: [:show, :edit, :update, :destroy]
# GET /devices
# GET /devices.json
def index
@devices = Device.all
end
# GET /devices/1
# GET /devices/1.json
def show
@unit = Unit.new(device_id:params[:id])
@without_baseline = params[:without_baseline].present? ? true : false
end
# GET /devices/new
def new
@device = Device.new
end
# GET /devices/1/edit
def edit
end
# POST /devices
# POST /devices.json
def create
@device = Device.new(device_params)
respond_to do |format|
if @device.save
format.html { redirect_to @device, notice: 'Device was successfully created.' }
format.json { render :show, status: :created, location: @device }
else
format.html { render :new }
format.json { render json: @device.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /devices/1
# PATCH/PUT /devices/1.json
def update
respond_to do |format|
if @device.update(device_params)
format.html { redirect_to @device, notice: 'Device was successfully updated.' }
format.json { render :show, status: :ok, location: @device }
else
format.html { render :edit }
format.json { render json: @device.errors, status: :unprocessable_entity }
end
end
end
# DELETE /devices/1
# DELETE /devices/1.json
def destroy
@device.destroy
respond_to do |format|
format.html { redirect_to :back, notice: 'Device was successfully destroyed.' }
format.json { head :no_content }
end
end
def apply_template
@device = Device.find params[:device_id]
@template = SectionTemplate.find params[:template][:template_id]
the_csv = CSV.parse(@template.sections, :headers => true, :encoding => 'ISO-8859-1')
the_csv.each do |row|
s = Section.new
s.device_id = @device.id
s.start_pos = row['start_pos']
s.end_pos = row['end_pos']
s.name = row['name']
s.notes = row['notes']
s.colour = row['colour']
s.save
end
redirect_to :back, :notice => "Successfully imported sections"
end
private
# Use callbacks to share common setup or constraints between actions.
def set_device
@device = Device.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def device_params
params.require(:device).permit(:fcc_id, :baudrate, :frequency, :modulation, :encoding, :name, :notes, :flip_pwm)
end
end
================================================
FILE: app/controllers/registrations_controller.rb
================================================
class RegistrationsController < Devise::RegistrationsController
skip_before_filter :authenticate_user!
private
def sign_up_params
params.require(:user).permit(:full_name, :email, :password, :password_confirmation)
end
def account_update_params
params.require(:user).permit(:full_name, :email, :password, :password_confirmation, :current_password)
end
end
================================================
FILE: app/controllers/section_templates_controller.rb
================================================
class SectionTemplatesController < ApplicationController
before_action :set_section_template, only: [:show]
# GET /section_templates
# GET /section_templates.json
def index
@section_templates = SectionTemplate.all
end
# GET /section_templates/1
# GET /section_templates/1.json
def show
end
def create
@device = Device.find params[:section_template][:device_id]
@device.sections_to_csv params[:section_template][:name], params[:section_template][:added_by]
redirect_to controller: 'dashboard', action: 'contribute'
end
private
# Use callbacks to share common setup or constraints between actions.
def set_section_template
@section_template = SectionTemplate.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def section_template_params
params.require(:section_template).permit(:name, :sections, :added_by)
end
end
================================================
FILE: app/controllers/sections_controller.rb
================================================
class SectionsController < ApplicationController
before_action :set_section, only: [:show, :edit, :update, :destroy]
# GET /sections
# GET /sections.json
def index
@device = Device.find params[:device_id]
@sections = @device.sections.sort_by(&:start_pos)
@section = Section.new(device_id: @device.id)
end
# GET /sections/1
# GET /sections/1.json
def show
end
# GET /sections/new
def new
@section = Section.new
end
# GET /sections/1/edit
def edit
end
# POST /sections
# POST /sections.json
def create
@section = Section.new(section_params)
respond_to do |format|
if @section.save
format.html { redirect_to device_sections_path(@section.device,@section), notice: 'Section was successfully created.' }
format.json { render :show, status: :created, location: @section }
else
format.html { render :new }
format.json { render json: @section.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /sections/1
# PATCH/PUT /sections/1.json
def update
respond_to do |format|
if @section.update(section_params)
format.html { redirect_to device_sections_path(@section.device,@section), notice: 'Section was successfully updated.' }
format.json { render :show, status: :ok, location: @section }
else
format.html { render :edit }
format.json { render json: @section.errors, status: :unprocessable_entity }
end
end
end
# DELETE /sections/1
# DELETE /sections/1.json
def destroy
@section.destroy
respond_to do |format|
format.html { redirect_to device_sections_path(@section.device,@section), notice: 'Section was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_section
@section = Section.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def section_params
params.require(:section).permit(:device_id, :name, :notes, :start_pos, :end_pos, :colour)
end
end
================================================
FILE: app/controllers/units_controller.rb
================================================
class UnitsController < ApplicationController
before_action :set_unit, only: [:show, :edit, :update, :destroy]
# GET /units
# GET /units.json
def index
@units = Unit.all
end
# GET /units/1
# GET /units/1.json
def show
@manchester_format = params[:manchester_format]
@pwm_format = params[:pwm_format]
end
# GET /units/new
def new
@unit = Unit.new(device_id:params[:device_id])
end
# GET /units/1/edit
def edit
end
# POST /units
# POST /units.json
def create
@unit = Unit.new(unit_params)
respond_to do |format|
if @unit.save
format.html { redirect_to @unit.device, notice: 'Unit was successfully created.' }
format.json { render :show, status: :created, location: @unit }
else
format.html { render :new }
format.json { render json: @unit.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /units/1
# PATCH/PUT /units/1.json
def update
respond_to do |format|
if @unit.update(unit_params)
format.html { redirect_to @unit, notice: 'Unit was successfully updated.' }
format.json { render :show, status: :ok, location: @unit }
else
format.html { render :edit }
format.json { render json: @unit.errors, status: :unprocessable_entity }
end
end
end
# DELETE /units/1
# DELETE /units/1.json
def destroy
@unit.destroy
respond_to do |format|
format.html { redirect_to :back, notice: 'Unit was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_unit
@unit = Unit.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def unit_params
params.require(:unit).permit(:device_id, :name, :notes)
end
end
================================================
FILE: app/helpers/application_helper.rb
================================================
module ApplicationHelper
end
================================================
FILE: app/helpers/captures_helper.rb
================================================
module CapturesHelper
end
================================================
FILE: app/helpers/dashboard_helper.rb
================================================
module DashboardHelper
end
================================================
FILE: app/helpers/devices_helper.rb
================================================
module DevicesHelper
end
================================================
FILE: app/helpers/section_templates_helper.rb
================================================
module SectionTemplatesHelper
end
================================================
FILE: app/helpers/sections_helper.rb
================================================
module SectionsHelper
end
================================================
FILE: app/helpers/units_helper.rb
================================================
module UnitsHelper
end
================================================
FILE: app/models/.keep
================================================
================================================
FILE: app/models/capture.rb
================================================
class Capture < ActiveRecord::Base
belongs_to :unit
belongs_to :device
def flip bin
flipped = ""
bin.scan(/./).each do |b|
b == '1' ? flipped << '0' : flipped << '1'
end
flipped
end
def check_signals shift=false
if shift
manchester_failures = {}
shifted_bin = '0' << original_binary
shifted_bin.scan(/../).each do |pair|
manchester_failures[pair]='invalid manchester' if (pair != "10") and (pair != "01")
end
else
manchester_failures = {}
original_binary.scan(/../).each do |pair|
manchester_failures[pair]='invalid manchester' if (pair != "10") and (pair != "01")
end
end
manchester_failures
end
def pwm_decode # 66/33
# 66/33 Format PWM
symbols = ""
the_bin = original_binary
while ((the_bin.size % 3) != 0)
the_bin+='0'
end
the_bin.scan(/.../).each do |s|
# 100 == 0
# 110 == 1
symbols << "1" if s.to_i == 110
symbols << "0" if s.to_i == 100
end
symbols = (device.flip_pwm ? (flip symbols) : symbols)
end
def pwm_decode_7525
# 66/33 Format PWM
symbols = ""
the_bin = original_binary
while ((the_bin.size % 3) != 0)
the_bin+='0'
end
the_bin.scan(/..../).each do |s|
# 100 == 0
# 110 == 1
symbols << "1" if s.to_i == 1110
symbols << "0" if s.to_i == 1000
end
symbols = (device.flip_pwm ? (flip symbols) : symbols)
end
def valid_pwm? human=false
pwm_errors = {}
the_bin = original_binary
fixed_incomplete = false
pre_padded_zero_alignment_error = false # The Dr Nick Edge Case
if the_bin.scan(/./)[0] == '0'
pre_padded_zero_alignment_error = true
pwm_errors[the_bin.last]='shifted and possibly irrepairably incomplete pwm'
the_bin = the_bin[1..-1]
end
if ((the_bin.size % 3) != 0)
pwm_errors[the_bin.last]='incomplete pwm'
while ((the_bin.size % 4) != 0)
the_bin+='0'
end
end
the_bin.scan(/.../).each do |set|
pwm_errors[set]='invalid pwm' if (set != "110") and (set != "100")
end
shared_pwm_valid_response pwm_errors, the_bin, fixed_incomplete, pre_padded_zero_alignment_error, human
end
def valid_pwm_7525? human=false
pwm_errors = {}
the_bin = original_binary
fixed_incomplete = false
pre_padded_zero_alignment_error = false # The Dr Nick Edge Case
if the_bin.scan(/./)[0] == '0'
pre_padded_zero_alignment_error = true
pwm_errors[the_bin.last]='shifted and possibly irrepairably incomplete pwm'
the_bin = the_bin[1..-1]
end
if ((the_bin.size % 4) != 0)
pwm_errors[the_bin.last]='incomplete pwm'
while ((the_bin.size % 4) != 0)
the_bin+='0'
end
end
the_bin.scan(/..../).each do |set|
pwm_errors[set]='invalid pwm' if (set != "1110") and (set != "1000")
end
shared_pwm_valid_response pwm_errors, the_bin, fixed_incomplete, pre_padded_zero_alignment_error, human
end
def shared_pwm_valid_response pwm_errors, the_bin, fixed_incomplete, pre_padded_zero_alignment_error, human
message = nil
if pwm_errors.present?
if pwm_errors.count == 1
if pwm_errors.has_value? 'incomplete pwm'
#message = "Valid PWM if padding at end was captured. Re-capture with padding and delete this item for best results."
message = "This was valid PWM but significant whitespace at the end was missed by you. I have added 0s to the end and saved the change."
fixed_incomplete = true
end
if (pwm_errors.has_value? "shifted and possibly irrepairably incomplete pwm") && (!pwm_errors.has_value? "invalid pwm")
message = "This is likely to be a PWM capture but there was an unexpected '0' at the beginning which suggests the last cell was also chopped off. It is STRONGLY recommended that you re-create this capture but this time start one cell later, and add an extra cell at the end even if it is empty. This is an edge-case that seems to occur rarely with rtl-sdr captures. We don't know why exactly."
end
end
end
if human == false
if fixed_incomplete && pwm_errors.size == 1
return true
else
return pwm_errors.blank?
end
else
response = ""
if pwm_errors.blank?
response = "Yes"
elsif pwm_errors.present?
if message.blank?
response << "No"
else
self.original_binary = self.binary = the_bin
self.save unless pwm_errors.has_value? "shifted and possibly irrepairably incomplete pwm"
response << message # message will only show first time. gone from subsequent attempts due to being corrected and saved
end
end
response
end
end
def manchester_decode
symbols = ""
original_binary.scan(/../).each do |s|
symbols += '1' if s.to_i == 10
symbols += '0' if s.to_i == 01
end
symbols
end
def valid_manchester? human=false
if human == false
check_signals.blank?
else
response = ""
if check_signals.blank? then
response = "Yes"
else
check_signals(shift=true).blank? ? response << "\n If you add a 0 at the start it is... re-capture the signal with an empty cell at the beginning" : response << "No"
end
response
end
end
def to_hexcode bin=nil
hex = ''
f_hex = '\x'
if bin
hex << '%02x' % bin.to_i(2)
f_hex << hex.scan(/.{2}|.+/).join('\x')
else
hex << '%02x' % original_binary.to_i(2)
f_hex << hex.scan(/.{2}|.+/).join('\x')
end
f_hex
end
def to_ascii manchester=false, pwm=false
if manchester
f_hex = to_hexcode manchester_decode.gsub("\\x","")
"#{f_hex.gsub(/../) { |pair| pair.hex.chr }}".force_encoding(Encoding::UTF_8).encode('utf-8', :invalid=>:replace, :replace=>"?")
elsif pwm
f_hex = to_hexcode pwm_decode.gsub("\\x","")
"#{f_hex.gsub(/../) { |pair| pair.hex.chr }}".force_encoding(Encoding::UTF_8).encode('utf-8', :invalid=>:replace, :replace=>"?")
else
f_hex = to_hexcode
"#{f_hex.gsub(/../) { |pair| pair.hex.chr }}".force_encoding(Encoding::UTF_8).encode('utf-8', :invalid=>:replace, :replace=>"?")
end
end
def bin_to_ascii bin
f_hex = to_hexcode bin
"#{f_hex.gsub(/../) { |pair| pair.hex.chr }}".force_encoding(Encoding::UTF_8).encode('utf-8', :invalid=>:replace, :replace=>"?")
end
def shift_right
update_attribute(:binary, binary.scan(/\w/).unshift('p'))
save
end
def shift_left
if binary.scan(/\w/).first == 'p'
update_attribute(:binary, binary.scan(/\w/).drop(1))
save
end
end
def self.to_hexcode bin
hex = ''
f_hex = '\x'
hex << '%02x' % bin.to_i(2)
f_hex << hex.scan(/.{2}|.+/).join('\x')
if f_hex.split("\\x").last.size == 1
f_hex << "0"
end
f_hex
end
end
================================================
FILE: app/models/concerns/.keep
================================================
================================================
FILE: app/models/cons.rb
================================================
class Cons
# this isn't an active record model. it's soley here to help with console commands for usability
def self.live_capture_seed_file device_id, unit_id, capture_name, stop_at_first=false
first_bin = ""
last_bin = ""
d = Device.find device_id
u = Unit.find unit_id
loop.with_index do |_, i|
c = Capture.new
c.unit_id = u.id
c.device_id = d.id
c.name = "#{capture_name}_#{i+1}"
until !c.new_record?
bin = `cat "#{Rails.root}/tmp/test_change.tmp"`.gsub("\\n","")
if (bin.to_s != last_bin) && (bin.to_s.present?)
break if (bin.to_s == first_bin) && (stop_at_first == true)
c.original_binary = bin.to_s
c.binary = c.original_binary
c.save
last_bin = c.original_binary
end
end
end
end
end
================================================
FILE: app/models/device.rb
================================================
class Device < ActiveRecord::Base
require 'csv'
has_many :units, dependent: :destroy
has_many :captures
has_many :sections
def could_be_manchester?
captures.map(&:valid_manchester?).any?
end
def could_be_pwm?
captures.map(&:valid_pwm?).any?
end
def could_be_pwm_7525?
captures.map(&:valid_pwm_7525?).any?
end
def update_modulation
if (modulation == "OOK" && encoding == "n/a") || (modulation.blank? && encoding.blank?)
if could_be_pwm?
update_attribute(:modulation,"PWM")
update_attribute(:encoding,"66/33")
elsif could_be_pwm_7525?
update_attribute(:modulation,"PWM")
update_attribute(:encoding,"75/25")
elsif could_be_manchester?
update_attribute(:modulation,"OOK")
update_attribute(:encoding,"Manchester")
else
update_attribute(:modulation,"OOK")
update_attribute(:encoding,"n/a")
end
end
end
def format_frequency
number_of_decimals = decimals(frequency)
pad = 5 - number_of_decimals
frequency.to_s.gsub(".","") + ("0"*pad)
end
def decimals(a)
num = 0
while(a != a.to_i)
num += 1
a *= 10
end
num
end
# export a section template
def sections_to_csv template_name, added_by
column_names = "name", "start_pos", "end_pos", "colour", "notes"
the_csv = CSV.generate(headers: true) do |csv_text|
csv_text << column_names
sections.each do |section|
csv_text << section.attributes.values_at(*column_names)
end
end
the_csv.gsub('"',"'")
open(Rails.root.join('mcs', 'contribution.md').to_s, 'w') {|f|
f.puts "```ruby"
f.puts "SectionTemplate.find_or_create_by(:name => \"#{template_name}\") do |st|"
f.puts " st.sections = \"#{the_csv}\" "
f.puts " st.added_by = '#{added_by}' "
f.puts "end"
f.puts "```"
}
end
end
================================================
FILE: app/models/section.rb
================================================
class Section < ActiveRecord::Base
belongs_to :device
def section_range
start_pos..end_pos
end
end
================================================
FILE: app/models/section_template.rb
================================================
class SectionTemplate < ActiveRecord::Base
end
================================================
FILE: app/models/unit.rb
================================================
class Unit < ActiveRecord::Base
belongs_to :device
has_many :captures, dependent: :destroy
end
================================================
FILE: app/models/user.rb
================================================
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable, :rememberable, :trackable
end
================================================
FILE: app/views/application/_favicon.html.erb
================================================
<link rel="apple-touch-icon" sizes="57x57" href="<%= asset_path 'favicon/apple-touch-icon-57x57.png' %>">
<link rel="apple-touch-icon" sizes="60x60" href="<%= asset_path 'favicon/apple-touch-icon-60x60.png' %>">
<link rel="apple-touch-icon" sizes="72x72" href="<%= asset_path 'favicon/apple-touch-icon-72x72.png' %>">
<link rel="apple-touch-icon" sizes="76x76" href="<%= asset_path 'favicon/apple-touch-icon-76x76.png' %>">
<link rel="apple-touch-icon" sizes="114x114" href="<%= asset_path 'favicon/apple-touch-icon-114x114.png' %>">
<link rel="apple-touch-icon" sizes="120x120" href="<%= asset_path 'favicon/apple-touch-icon-120x120.png' %>">
<link rel="apple-touch-icon" sizes="144x144" href="<%= asset_path 'favicon/apple-touch-icon-144x144.png' %>">
<link rel="apple-touch-icon" sizes="152x152" href="<%= asset_path 'favicon/apple-touch-icon-152x152.png' %>">
<link rel="apple-touch-icon" sizes="180x180" href="<%= asset_path 'favicon/apple-touch-icon-180x180.png' %>">
<link rel="icon" type="image/png" href="<%= asset_path 'favicon/favicon-32x32.png' %>" sizes="32x32">
<link rel="icon" type="image/png" href="<%= asset_path 'favicon/android-chrome-192x192.png' %>" sizes="192x192">
<link rel="icon" type="image/png" href="<%= asset_path 'favicon/favicon-96x96.png' %>" sizes="96x96">
<link rel="icon" type="image/png" href="<%= asset_path 'favicon/favicon-16x16.png' %>" sizes="16x16">
<link rel="manifest" href="<%= asset_path 'favicon/manifest.json' %>">
<link rel="mask-icon" href="<%= asset_path 'favicon/safari-pinned-tab.svg' %>" color="#5bbad5">
<link rel="shortcut icon" href="<%= asset_path 'favicon/favicon.ico' %>">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="<%= asset_path 'favicon/mstile-144x144.png' %>">
<meta name="msapplication-config" content="<%= asset_path 'favicon/browserconfig.xml' %>">
<meta name="theme-color" content="#ffffff">
================================================
FILE: app/views/captures/_form.html.haml
================================================
= simple_form_for(@capture) do |f|
= f.error_notification
= f.hidden_field :device_id
= f.hidden_field :unit_id
= f.hidden_field :original_binary
.form-group
%label.col-lg-2.control-label{:for => "inputEmail"} Name
.col-lg-10
= f.input :name, label: false, input_html: { class: 'form-control' }
%br
.form-group
.col-lg-10.col-lg-offset-2
/-#%button.btn.btn-default{:type => "reset"} Cancel
%button.btn.btn-primary{:type => "submit"} Submit
================================================
FILE: app/views/captures/edit.html.haml
================================================
%h1 Editing capture
= render 'form'
= link_to 'Show', @capture
\|
= link_to 'Back', captures_path
================================================
FILE: app/views/captures/index.html.haml
================================================
%h1 Listing captures
%table
%thead
%tr
%th Unit
%th Device
%th Name
%th Notes
%th Binary
%th Original binary
%th
%th
%th
%tbody
- @captures.each do |capture|
%tr
%td= capture.unit_id
%td= capture.device_id
%td= capture.name
%td= capture.notes
%td= capture.binary
%td= capture.original_binary
%td= link_to 'Show', capture
%td= link_to 'Edit', edit_capture_path(capture)
%td= link_to 'Destroy', capture, :method => :delete, :data => { :confirm => 'Are you sure?' }
%br
= link_to 'New Capture', new_capture_path
================================================
FILE: app/views/captures/index.json.jbuilder
================================================
json.array!(@captures) do |capture|
json.extract! capture, :id, :unit_id, :device_id, :name, :notes, :binary, :original_binary
json.url capture_url(capture, format: :json)
end
================================================
FILE: app/views/captures/new.html.haml
================================================
%fieldset
%legend Add Capture From Inspectrum
= render 'form'
= link_to 'Back', @capture.unit
================================================
FILE: app/views/captures/show.html.haml
================================================
%p#notice= notice
%p
%b Unit:
= @capture.unit_id
%p
%b Device:
= @capture.device_id
%p
%b Name:
= @capture.name
%p
%b Notes:
= @capture.notes
%p
%b Binary:
= @capture.binary
%p
%b Original binary:
= @capture.original_binary
= link_to 'Edit', edit_capture_path(@capture)
\|
= link_to 'Back', captures_path
================================================
FILE: app/views/captures/show.json.jbuilder
================================================
json.extract! @capture, :id, :unit_id, :device_id, :name, :notes, :binary, :original_binary, :created_at, :updated_at
================================================
FILE: app/views/dashboard/about.html.haml
================================================
%div.container-fluid
%div.row
%div.col-lg-12
%h4 DSpectrumGUI
%br
%p DSpectrumGUI is a locally hosted web application designed to facilitate the rapid reverse engineering of SDR/RF signals.
%hr
%h5 Application Status
%p= "You are currently running: #{@tags} || #{@version}"
- if @count_behind_origin == 0
%p{:style => "color:darkgreen;"}= "This app is up-to-date with master"
- else
- message = "This app is #{@count_behind_origin} " + "commit".pluralize(@count_behind_origin) + " behind origin/master. If you'd like to update it, shutdown this server (ctrl-c in the terminal window you launched it from), and type the following commands in your terminal"
%p{:style => "color:darkred;"}= message
%pre{:style => "white-space: pre-line;background-color:grey;"}
cd ~/dspectrum_gui # update this if you've clone DSpectrumGUI somewhere else
git fetch
git checkout master
git pull origin master
rake db:migrate # just incase a change to the database was made
%br
\# launch the app again
rails s -p 3001
%br
%br
%p.vanity
%a="Want to stay in touch? ".html_safe
%a= "- ".html_safe
%a{:href => "https://twitter.com/tresacton"}=" @tresacton (on twitter) ".html_safe
%a= "- ".html_safe
%a="@nullwolf (on slack) ".html_safe
/ %a
/ © AdvisoryDB
/ =Time.now.year
================================================
FILE: app/views/dashboard/contribute.html.haml
================================================
%div.container-fluid
%div.row
%div.col-lg-12
%h4 DSpectrumGUI
%br
%p Please follow the instructions below to contribute
%hr
%p
="Navigate to "
=link_to('https://github.com/tresacton/dspectrumgui','https://github.com/tresacton/dspectrumgui').html_safe
%p= "Create a new issue with the title: [SectionTemplate] <name of your template>"
%p= "Copy and paste the below text into the Issue description field, and hit submit"
%pre{:style => "white-space: pre-line;background-color:grey;"}
=@cont
%br
%p Thank you for donating this to our template library.
%br
%p.vanity
%a="Want to stay in touch? ".html_safe
%a= "- ".html_safe
%a{:href => "https://twitter.com/tresacton"}=" @tresacton (on twitter) ".html_safe
%a= "- ".html_safe
%a="@nullwolf (on slack) ".html_safe
/ %a
/ © AdvisoryDB
/ =Time.now.year
================================================
FILE: app/views/dashboard/temp.html.haml
================================================
%div.container-fluid
%div.row
%div.col-lg-12
%h3 Analysis Helper
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
- zero = [1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1]
- one = [nil,1,0,1,0,1,0,1,0,1,0,1,0,1,0]
- two = [nil,1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0]
- x1 = [zero,one,two]
- x = x1.sort_by {|y|y.size}
- baseline = x.last
%thead
%tr
%th
-x.last.each_with_index do |it,index|
%th{:style => "color:grey;"}= index
%th
%tbody
- x.each do |barray|
%tr
%td <
- barray.each_with_index do |b, index|
- if b == baseline[index]
%td{:style => "color:green"}= b
-else
%td{:style => "color:red"}= b
%td >
%td b
-baseline.each do |b|
%td{:style => "color:blue"}= b
%td
= form_for '' do | f |
=f.label 'notes'
%br
=f.text_area 'd', :cols => 140
%br
================================================
FILE: app/views/devices/_add_unit.html.haml
================================================
%div.col-lg-12
%hr
%h4 Units
= simple_form_for(unit) do |f|
= f.error_notification
= f.hidden_field :device_id
.form-group
.col-lg-2
%h5 Add new
.col-lg-8
= f.input :name, placeholder: 'name', label: false, input_html: { class: 'form-control' }
.col-lg-2
/-#%button.btn.btn-default{:type => "reset"} Cancel
%button.btn.btn-primary{:type => "submit", :style => "float:right;"} Create
================================================
FILE: app/views/devices/_form.html.haml
================================================
= simple_form_for(@device) do |f|
= f.error_notification
.form-group
%label.col-lg-2.control-label{:for => "inputEmail"} Name
.col-lg-10
= f.input :name, label: false, input_html: { class: 'form-control' }
%br
.form-group
%label.col-lg-2.control-label{:for => "inputPassword"} FCC ID
.col-lg-10
= f.input :fcc_id, label: false, input_html: { class: 'form-control' }
%br
.form-group
%label.col-lg-2.control-label{:for => "inputPassword"} Modulation
.col-lg-10
= f.input :modulation, label: false, input_html: { class: 'form-control' }
%br
.form-group
%label.col-lg-2.control-label{:for => "inputPassword"} Encoding
.col-lg-10
= f.input :encoding, label: false, input_html: { class: 'form-control' }
%br
.form-group
%label.col-lg-2.control-label{:for => "inputPassword"} Frequency
.col-lg-10
= f.input :frequency, label: false, input_html: { class: 'form-control' }
%br
.form-group
%label.col-lg-2.control-label{:for => "inputPassword"} Baudrate
.col-lg-10
= f.input :baudrate, label: false, input_html: { class: 'form-control' }
%br
.form-group
%label.col-lg-2.control-label{:for => "inputPassword"} Flip Decoding Assumption
.col-lg-10
%span{:style => "float:right;"}
= f.input :flip_pwm, label: false, as: :boolean, checked_value: true, unchecked_value: false
%br
%br
%br
.form-group
%label.col-lg-2.control-label{:for => "notes"} Notes
.col-lg-10
= f.input :notes, label: false, type: 'text-area', input_html: { class: 'form-control textArea', rows: 10 }
%br
.form-group
.col-lg-10.col-lg-offset-2
/-#%button.btn.btn-default{:type => "reset"} Cancel
%button.btn.btn-primary{:type => "submit"} Submit
================================================
FILE: app/views/devices/_manchester_analysis.html.haml
================================================
- if device.units.map(&:captures).flatten.present?
- if device.could_be_manchester?
%div.col-lg-12
%hr
%h4 Manchester Bit Position Analysis Tool
%p The longest binary string is used as the comparison baseline (B) below
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
- x1 = device.units.map(&:captures).flatten.each
- x = x1.sort_by {|y|y.manchester_decode.scan(/\w/).count}
- baseline = x.last.manchester_decode.scan(/\w/)
- x.each do |xx|
- diff = baseline.count - xx.manchester_decode.scan(/\w/).count
- if diff > 0
- diff.times do |i|
- xx.binary = xx.manchester_decode << 'p'
%thead
%tr
%th
-baseline.flatten.each_with_index do |it,index|
%th{:style => "color:grey;"}= index
%tbody
- x.each do |barray|
%tr
%td
= link_to "#{barray.unit.name}: ",barray.unit, :style => "color:#2a9fd6;"
%br
= barray.name
- barray.manchester_decode.scan(/\w/).each_with_index do |b, index|
- if b == baseline[index]
- if b != 'p'
%td.text-success= b
- else
%td
-else
- if b != 'p'
%td.text-danger= b
- else
%td
%td{style:"text-align:center;"} B
-baseline.each do |b|
- if b != 'p'
%td.text-primary= b
- else
%td
%br
/ Taken from line 13 under flatten
/ - device.units.map(&:captures).flatten.each do |c|
/ - c.update_attribute(:binary, c.manchester_decode) if c.binary.blank?
================================================
FILE: app/views/devices/_pwm_analysis.html.haml
================================================
- if device.units.map(&:captures).flatten.present?
- if device.could_be_pwm?
%div.col-lg-12
%hr
%h4 PWM Bit Position Analysis Tool (66/33)
%p The longest binary string is used as the comparison baseline (B) below
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
- x1 = device.units.map(&:captures).flatten.each
- x = x1.sort_by {|y|y.pwm_decode.scan(/\w/).count}
- baseline = x.last.pwm_decode.scan(/\w/)
- x.each do |xx|
- diff = baseline.count - xx.pwm_decode.scan(/\w/).count
- if diff > 0
- diff.times do |i|
- xx.binary = xx.pwm_decode << 'p'
%thead
%tr
%th
-baseline.flatten.each_with_index do |it,index|
%th{:style => "color:grey;"}= index
%tbody
- x.each do |barray|
%tr
%td
= link_to "#{barray.unit.name}: ",barray.unit, :style => "color:#2a9fd6;"
%br
= barray.name
- barray.pwm_decode.scan(/\w/).each_with_index do |b, index|
- if b == baseline[index]
- if b != 'p'
%td.text-success= b
- else
%td
-else
- if b != 'p'
%td.text-danger= b
- else
%td
%td{style:"text-align:center;"} B
-baseline.each do |b|
- if b != 'p'
%td.text-primary= b
- else
%td
%br
- if device.could_be_pwm_7525?
%div.col-lg-12
%hr
%h4 PWM Bit Position Analysis Tool (75/25)
%p The longest binary string is used as the comparison baseline (B) below
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
- x1 = device.units.map(&:captures).flatten.each
- x = x1.sort_by {|y|y.pwm_decode_7525.scan(/\w/).count}
- baseline = x.last.pwm_decode_7525.scan(/\w/)
- x.each do |xx|
- diff = baseline.count - xx.pwm_decode_7525.scan(/\w/).count
- if diff > 0
- diff.times do |i|
- xx.binary = xx.pwm_decode_7525 << 'p'
%thead
%tr
%th
-baseline.flatten.each_with_index do |it,index|
%th{:style => "color:grey;"}= index
%tbody
- x.each do |barray|
%tr
%td
= link_to "#{barray.unit.name}: ",barray.unit, :style => "color:#2a9fd6;"
%br
= barray.name
- barray.pwm_decode_7525.scan(/\w/).each_with_index do |b, index|
- if b == baseline[index]
- if b != 'p'
%td.text-success= b
- else
%td
-else
- if b != 'p'
%td.text-danger= b
- else
%td
%td{style:"text-align:center;"} B
-baseline.each do |b|
- if b != 'p'
%td.text-primary= b
- else
%td
%br
================================================
FILE: app/views/devices/_raw_analysis.html.haml
================================================
- if device.units.map(&:captures).flatten.any?
%div.col-lg-12
%hr
%h4 Analysis Helper
%p The longest binary string is used as the comparison baseline (B)
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
- x1 = device.units.map(&:captures).flatten.each
- device.units.map(&:captures).flatten.each do |c|
- c.update_attribute(:binary, c.original_binary) if c.binary.blank?
- x = x1.sort_by {|y|y.original_binary.scan(/\w/).count}
- baseline = x.last.original_binary.scan(/\w/)
- x.each do |xx|
- diff = baseline.count - xx.original_binary.scan(/\w/).count
- xx.binary = xx.original_binary
- if diff > 0
- diff.times do |i|
- xx.binary = xx.binary << 'p'
%thead
%tr
%th
-baseline.flatten.each_with_index do |it,index|
%th{:style => "color:grey;"}= index
%tbody
- x.each do |barray|
%tr
%td
= link_to "#{barray.unit.name}: ",barray.unit, :style => "color:#2a9fd6;"
%br
= barray.name
- barray.binary.scan(/\w/).each_with_index do |b, index|
- if without_baseline == false
- if b == baseline[index]
- if b != 'p'
%td.text-success= b
- else
%td
-else
- if b != 'p'
%td.text-danger= b
- else
%td
- elsif without_baseline == true
- if b.to_s == '1'
%td.text-success= b
- else
%td.text-danger= b
- if without_baseline == false
%td{style:"text-align:center;"} B
-baseline.each do |b|
- if b != 'p'
%td.text-primary= b
- else
%td
%br
================================================
FILE: app/views/devices/_show_units.html.haml
================================================
%div.col-lg-12
%br
%table.table.table-bordered.table.hover
%thead
%tr.bg-primary
%th Name
%th Notes
%th Captures
%th Actions
%tbody
- device.units.each do |u|
%tr
%td= link_to u.name, u, :style => "color:#2a9fd6;"
%td= u.notes
%td= u.captures.count
-#- u.captures.each do |c|
-# = "#{c.name} "
-# %br
-# =" #{c.original_binary}\n"
-# %hr
%td{:style => "width:15%;"}
= link_to 'Destroy', u, :method => :delete, :data => { :confirm => 'Are you sure?' }, :style => "color:red;"
================================================
FILE: app/views/devices/edit.html.haml
================================================
%h1 Editing device
= render 'form'
= link_to 'Show', @device
\|
= link_to 'Back', devices_path
================================================
FILE: app/views/devices/index.html.haml
================================================
%div.container-fluid
%div.row
%div.col-lg-12
%h3
Devices
%p A device is effectively a category. It should have at least one unit. If you have multiple units of the same type (e.g. 3 identical garage door remotes), they are best represented as multiple units of the same device.
%br
%table.table.table-bordered.table-hover
%thead
%tr.bg-primary
%th Name
%th FCC ID
%th Modulation
%th Encoding
%th Baudrate
%th Frequency
%th Notes
%th
%tbody
- @devices.each do |device|
%tr
%td= link_to device.name, device
%td= device.fcc_id
%td= device.modulation
%td= device.encoding
%td= device.baudrate
%td= device.frequency
%td= device.notes.truncate(100)
%td
= link_to 'Edit', edit_device_path(device)
= link_to 'Destroy', device, :method => :delete, :data => { :confirm => 'Are you sure?' }
%br
= link_to 'New Device', new_device_path
================================================
FILE: app/views/devices/index.json.jbuilder
================================================
json.array!(@devices) do |device|
json.extract! device, :id, :fcc_id, :baudrate, :frequency, :modulation, :encoding, :name, :notes
json.url device_url(device, format: :json)
end
================================================
FILE: app/views/devices/new.html.haml
================================================
%fieldset
%legend New Device
= render 'form'
= link_to 'Back', devices_path
================================================
FILE: app/views/devices/show.html.haml
================================================
%div.container-fluid
%div.row
%div.col-lg-12
%h3
Device:
= @device.name
- @device.update_modulation
%p A device is effectively a category. It should have at least one unit. If you have multiple units of the same type (e.g. 3 identical garage door remotes), they are best represented as multiple units of the same device.
%br
%div.col-lg-8
%table.table.table-bordered
%tr
%th.bg-primary{style:"width:15%;"} Name
%td= @device.name
%tr
%th.bg-primary FCC ID
%td= @device.fcc_id
%tr
%th.bg-primary Modulation
%td
= @device.modulation
%tr
%th.bg-primary Encoding
%td= @device.encoding
%tr
%th.bg-primary Frequency
%td
= @device.frequency
= ' Mhz'
%tr
%th.bg-primary Baudrate
%td= @device.baudrate
%tr
%th.bg-primary Decoding Rules
%td= @device.flip_pwm == true ? "Bits flipped after demodulation" : "Bits not flipped (Default State)"
%tr
%th.bg-primary Notes
%td= @device.notes
%div.col-lg-3
.well.well-lg
%h5 Actions
= link_to 'View Reversing Worksheet', device_sections_path(@device), :style => "color:#2a9fd6;"
%br
=link_to 'Edit Device', edit_device_path(@device), :style => "color:#2a9fd6;"
%br
= link_to 'Go Back to Devices', devices_path, :style => "color:#2a9fd6;"
=render "manchester_analysis", device: @device, without_baseline: @without_baseline
/ =render "manchester_analysis", unit: @unit
=render "pwm_analysis", device: @device, without_baseline: @without_baseline
/ =render "raw_analysis", unit: @unit
=render "raw_analysis", device: @device, without_baseline: @without_baseline
=render "add_unit", unit: @unit
=render "show_units", device: @device
%br
-#Vertical text style for TH
-#%th{:style => "color:grey;-webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg);-ms-transform: rotate(-90deg);-o-transform: rotate(-90deg);filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);color: #FFF;text-transform: uppercase;"} 0
================================================
FILE: app/views/devices/show.json.jbuilder
================================================
json.extract! @device, :id, :fcc_id, :baudrate, :frequency, :modulation, :encoding, :name, :notes, :created_at, :updated_at
================================================
FILE: app/views/devise/confirmations/new.html.erb
================================================
<h2>Resend confirmation instructions</h2>
<%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<%= f.error_notification %>
<%= f.full_error :confirmation_token %>
<div class="form-inputs">
<%= f.input :email, required: true, autofocus: true %>
</div>
<div class="form-actions">
<%= f.button :submit, "Resend confirmation instructions" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
================================================
FILE: app/views/devise/mailer/confirmation_instructions.html.erb
================================================
<p>Welcome <%= @email %>!</p>
<p>You can confirm your account email through the link below:</p>
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
================================================
FILE: app/views/devise/mailer/password_change.html.erb
================================================
<p>Hello <%= @resource.full_name %>!</p>
<p>We're contacting you to notify you that your password has been changed.</p>
================================================
FILE: app/views/devise/mailer/reset_password_instructions.html.erb
================================================
<p>Hello <%= @resource.full_name %>!</p>
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token, :host => (Rails.env == 'production' ? "advisorydb.com" : "localhost")) %></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>
================================================
FILE: app/views/devise/mailer/unlock_instructions.html.erb
================================================
<p>Hello <%= @resource.full_name %>!</p>
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
<p>Click the link below to unlock your account:</p>
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
================================================
FILE: app/views/devise/passwords/edit.html.haml
================================================
%h3 Change your password?
= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
= f.error_notification
= f.full_error :reset_password_token
%table.table.table-bordered{style:'width:57%;'}
%tr
%th{style:"width:30%;padding:10px;"} Password
%td{style:"color:grey;width:60px;padding:10px;"}= f.input :password, label: false, required: true, autofocus: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length)
%tr
%th{style:"width:30%;padding:10px;"} Password Confirmation
%td{style:"color:grey;width:60px;padding:10px;"}=f.input :password_confirmation, label: false, required: true, maxlength:72, size:72
%div.row{style:'padding-top:20px;'}
= f.input :reset_password_token, as: :hidden
%div.col-lg-4
= f.button :submit, "Submit", :class => "btn btn-primary"
%div.col-lg-3.form-action{style:'padding-top:5px;'}
= render "devise/shared/links"
%div.col-lg-5{style:'padding-top:5px;'}
================================================
FILE: app/views/devise/passwords/new.html.haml
================================================
%h3 Forgot your password?
= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
%table.table.table-bordered{style:'width:57%;'}
%tr
%th{style:"width:30%;padding:10px;"} Email
%td{style:"color:black;;width:60px;padding:10px;"}= f.text_field :email, required: true, autofocus: true, label: false, size: 40
%div.row{style:'padding-top:20px;'}
%div.col-lg-4
= f.button :submit, "Submit", :class => "btn btn-primary"
%div.col-lg-3.form-action{style:'padding-top:5px;'}
= render "devise/shared/links"
%div.col-lg-5{style:'padding-top:5px;'}
================================================
FILE: app/views/devise/registrations/edit.html.erb
================================================
<h2>Edit <%= resource_name.to_s.humanize %></h2>
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :email, required: true, autofocus: true %>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
<% end %>
<%= f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false %>
<%= f.input :password_confirmation, required: false %>
<%= f.input :current_password, hint: "we need your current password to confirm your changes", required: true %>
</div>
<div class="form-actions">
<%= f.button :submit, "Update" %>
</div>
<% end %>
<h3>Cancel my account</h3>
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
<%= link_to "Back", :back %>
================================================
FILE: app/views/devise/registrations/new.html.haml
================================================
%h3 Sign Up
%div.row
%div.col-lg-8
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
= f.error_notification
= devise_error_messages!
%table.table.table-bordered{style:'width:57%;'}
%tbody
%tr{style:''}
%th{style:"width:30%;padding-top:10px;padding-left:10px;padding-bottom:10px;"} Name
%td{style:"color:black;width:20%;padding:10px;"}
= f.text_field :full_name, required: true, autofocus: true, label: false, size: 40
%tr
%th{style:"width:30%;padding-top:10px;padding-left:10px;padding-bottom:10px;"} Email
%td{style:"color:black;padding:10px;"}= f.text_field :email, required: true, label: false, size: 40
%tr
%th{style:"width:30%;padding-top:10px;padding-left:10px;padding-bottom:10px;"} Password
%td{style:"color:black;padding:10px;"}= f.password_field :password, required: true, label: false, autocomplete: false, size: 40
%tr
%th{style:"width:30%;padding-top:10px;padding-left:10px;padding-bottom:10px;"} Password Confirmation
%td{style:"color:black;padding:10px;"}= f.password_field :password_confirmation, label: false, required: true, size: 40
%div.row{style:'padding-top:20px;'}
%div.col-lg-6
= f.button :submit, "Submit", :class => "btn btn-primary"
%div.col-lg-3.form-action{style:'padding-top:5px;'}
= render "devise/shared/links"
%div.col-lg-4{style:'padding-top:5px;'}
%div.col-lg-4
%strong Things you need to know:
%ul
%li Registration is required to access challenge information and to allow you to check your challenge solutions.
%li We won't email you or give your email address to others. Other participants will not see your email address in the application interface. If you're super concerned, use a fake email address (just make sure you remember it for today).
%li This app is hosted in a VM, which will be reset at the end of today. So the data within will be destroyed or de-anonymised.
%li{:style => "color:red;"} OBLIGATORY DISCLAIMER: Neither myself (Très Acton), or the Platypus hosts, condone criminal activity. By registering, you agree that you will not interpret the simulation challenges as instructions or suggestions to break any state or federal laws. I'm no legal expert, but "I learned it at a hacker con" is probably not going to be a suitable defence if you break into someone's garage without the proper owner's consent...
================================================
FILE: app/views/devise/sessions/new.html.haml
================================================
%h3 Authenticate
= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
%table.table.table-bordered{style:'width:57%;'}
%tr
%th{style:"width:30%;padding:10px;"} Email
%td{style:"color:black;width:60px;padding:10px;"}= f.text_field :email, required: true, autofocus: true, label: false, size: 40
%tr
%th{style:"width:30%;padding-top:10px;padding-left:10px;padding-bottom:10px;"} Password
%td{style:"color:black;padding:10px;"}=f.password_field :password, required: true, label: false, autocomplete: false, size: 40
%div.row{style:'padding-top:20px;'}
%div.col-lg-4
= f.button :submit, "Submit", :class => "btn btn-primary"
%div.col-lg-3.form-action{style:'padding-top:5px;'}
= render "devise/shared/links"
%div.col-lg-5{style:'padding-top:5px;'}
================================================
FILE: app/views/devise/shared/_links.html.erb
================================================
<div style="text-align:right;">
<%- if controller_name != 'sessions' %>
<%= link_to "Log in", new_session_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %><br />
<% end -%>
<% end -%>
</div>
================================================
FILE: app/views/devise/unlocks/new.html.haml
================================================
<h2>Resend unlock instructions</h2>
= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
%table.table.table-bordered{style:'width:57%;'}
%tr
%th{style:"width:30%;padding:10px;"} Email
%td{style:"color:black;width:60px;padding:10px;"}= f.text_field :email, required: true, autofocus: true, label: false, size: 40
%div.row{style:'padding-top:20px;'}
%div.col-lg-6
= f.button :submit, "Resend unlock instructions", :class => "btn btn-primary"
%div.col-lg-3.form-action{style:'padding-top:5px;'}
= render "devise/shared/links"
%div.col-lg-5{style:'padding-top:5px;'}
================================================
FILE: app/views/layouts/_footer.html.erb
================================================
<!-- Footer -->
<div class="container">
<hr>
<footer>
<div class="row">
<div class="col-lg-12">
<p>Copyright © nullwolf 2016</p>
</div>
</div>
</footer>
</div>
<!-- /.container -->
================================================
FILE: app/views/layouts/_messages.html.haml
================================================
-# Rails flash messages styled for Bootstrap 3.0
- flash.each do |name, msg|
- if msg.is_a?(String)
%div{:class => "alert alert-#{name.to_s == 'notice' ? 'success' : 'danger'}"}
%button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "button"} ×
= content_tag :div, msg, :id => "flash_#{name}"
================================================
FILE: app/views/layouts/_navigation.html.haml
================================================
-# navigation styled for Bootstrap 3.0
%nav.navbar.navbar-default.navbar-fixed-top
%a.nounderline{:href => "/",style:'float:left;padding-right:20px;padding-left:15px;'}
%div{style:'float:left;padding-right:20px;padding-left:15px;'}
%h3.neuro /dspectrum/
%span.right by nullwolf
%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", :type => "button"}
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
/ %a.navbar-brand{:href => "/", :rel => "/", :title => ""}
%div{style:'float:right;'}
================================================
FILE: app/views/layouts/_navigation_links.html.erb
================================================
<%# add navigation links to this file %>
================================================
FILE: app/views/layouts/application.html.haml
================================================
!!!
%html
%head
= render 'favicon'
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0"}
%title= content_for?(:title) ? yield(:title) : '/dspectrum/'
= stylesheet_link_tag 'application', media: 'all'
= javascript_include_tag 'bootstrap.min'
= javascript_include_tag 'application'
= csrf_meta_tags
%body
%header
= render 'layouts/navigation'
%main{:role => "main",style:"padding-top:35px;"}
#banner.page-header
.row
.col-lg-4
%br
%br
%br
.col-sm-2
.list-group.table-of-contents.navbar-collapse
-if current_user.present?
%a.list-group-item{:style => "background-color:black;color:white;"}= "Welcome, #{current_user.full_name}"
=link_to("Devices", devices_path, :class => "a list-group-item", :style => "background-color:black;")
=link_to("About", '/about', :class => "a list-group-item", :style => "background-color:black;")
-else
%a.list-group-item{:style => "background-color:black;",:href => new_user_registration_path, :style => "background-color:black;"} Create an account
%a.list-group-item{:style => "background-color:black;",:href => new_session_path('user'), :style => "background-color:black;"} Log in
- if @current_user.present? || current_user.present?
=link_to("Logout", destroy_user_session_path, :method => :delete, :class => "a list-group-item", :style => "background-color:black;")
.col-lg-8.col-md-7.col-sm-6
= render 'layouts/messages'
= yield
================================================
FILE: app/views/layouts/mailer.html.haml
================================================
%hmtl
%body
= yield
================================================
FILE: app/views/layouts/mailer.text.haml
================================================
= yield
================================================
FILE: app/views/profile/edit.html.haml
================================================
%h1 Profile#edit
%p Find me in app/views/profile/edit.html.haml
================================================
FILE: app/views/profile/index.html.haml
================================================
%h1 Profile#index
%p Find me in app/views/profile/index.html.haml
================================================
FILE: app/views/profile/show.html.haml
================================================
- if @myprofile
%table.table.table-bordered.table-hover
%tr
%th{style:'width:20%;'} Name
%td= @profile.full_name
%tr
%th Email Address
%td= "#{@profile.email} - (this is not visible to other users)"
%tr
%th Became a Member
%td= "#{time_ago_in_words(@profile.created_at)} ago"
%tr
%th Sharing your Profile
- my_url = root_url + 'profile/' + @profile.id.to_s
- link = link_to my_url, my_url
%td= "Your profile can be accessed by others at: #{link}".html_safe
%br
%hr
%h4 Submissions - (this is not visible to other users)
- if @submissions.any?
%table.table.table-bordered.table-hover
%tr
%th{style:'width:20%;'} ADB ID
%th.visible-lg.visible-md Title
%th.visible-lg.visible-md Description
%th Status
%th Submitted
%th Interactions
%tr
-@submissions.each do |s|
%tr
%td= s.adb_id
%td.visible-lg.visible-md= s.title
%td.visible-lg.visible-md= s.description
%td= s.status.titleize
%td= "#{time_ago_in_words(s.created_at)} ago"
-if s.advisory_comments.count > 0
%td
= "#{s.advisory_comments.count} - "
= link_to 'View', "/submission/#{s.adb_id}/interactions"
-else
%td= "#{s.advisory_comments.count}"
-else
None
%hr
%h4
Published Advisories
%span.badge{style:"float:right;font-size:16px;"}= @advisories.count
- if @advisories.any?
%table.table.table-striped.table-bordered
%thead
%tr
%th ADB ID
%th Submitted
%th.visible-lg.visible-md Category
%th Title
%th{style:'text-align:center;'} ADBS
%tbody
- @advisories.each do |advisory|
%tr
%td{style:'width:170px;'}= link_to advisory.adb_id,advisory
%td= "#{time_ago_in_words(advisory.created_at)} ago"
%td.visible-lg.visible-md= advisory.category.try(:name)
%td= advisory.title
%td{style:'text-align:center;'}
%p
- if advisory.score
- if advisory.score < 5
%span.label.label-success{style:'font-size:100%;'}= "ADBS: #{advisory.score}"
- if advisory.score >= 5 && advisory.score < 7
%span.label.label-warning{style:'font-size:100%;'}= "ADBS: #{advisory.score}"
- if advisory.score >= 7
%span.label.label-danger{style:'font-size:100%;'}= "ADBS: #{advisory.score}"
/ ADD CVE to model also add notion of production category
- else
None
- else
%h3= @profile.full_name
%table.table.table-bordered.table-hover
%tr
%th{style:'width:20%;'} Name
%td= @profile.full_name
%tr
%th Became a Member
%td= "#{time_ago_in_words(@profile.created_at)} ago"
%hr
%h4
Published Advisories
%span.badge{style:"float:right;font-size:16px;"}= @advisories.count
- if @advisories.any?
%table.table.table-striped.table-bordered
%thead
%tr
%th ADB ID
%th Submitted
%th.visible-lg.visible-md Category
%th Title
%th{style:'text-align:center;'} ADBS
%tbody
- @advisories.each do |advisory|
%tr
%td{style:'width:170px;'}= link_to advisory.adb_id,advisory
%td= "#{time_ago_in_words(advisory.created_at)} ago"
%td.visible-lg.visible-md= advisory.category.try(:name)
%td= advisory.title
%td{style:'text-align:center;'}
%p
- if advisory.score
- if advisory.score < 5
%span.label.label-success{style:'font-size:100%;'}= "ADBS: #{advisory.score}"
- if advisory.score >= 5 && advisory.score < 7
%span.label.label-warning{style:'font-size:100%;'}= "ADBS: #{advisory.score}"
- if advisory.score >= 7
%span.label.label-danger{style:'font-size:100%;'}= "ADBS: #{advisory.score}"
/ ADD CVE to model also add notion of production category
- else
None
================================================
FILE: app/views/section_templates/index.html.haml
================================================
%h1 Listing section_templates
%table
%thead
%tr
%th Name
%th Sections
%th Added by
%th
%th
%th
%tbody
- @section_templates.each do |section_template|
%tr
%td= section_template.name
%td= section_template.sections
%td= section_template.added_by
%td= link_to 'Show', section_template
%td= link_to 'Edit', edit_section_template_path(section_template)
%td= link_to 'Destroy', section_template, :method => :delete, :data => { :confirm => 'Are you sure?' }
%br
= link_to 'New Section template', new_section_template_path
================================================
FILE: app/views/section_templates/show.html.haml
================================================
%p#notice= notice
%p
%b Name:
= @section_template.name
%p
%b Sections:
= @section_template.sections
%p
%b Added by:
= @section_template.added_by
= link_to 'Edit', edit_section_template_path(@section_template)
\|
= link_to 'Back', section_templates_path
================================================
FILE: app/views/sections/_form.html.haml
================================================
= simple_form_for(@section) do |f|
= f.error_notification
/ .form-inputs
/ = f.input :device_id
/ = f.input :name
/ = f.input :notes
/ = f.input :start_pos
/ = f.input :end_pos
/ = f.input :colour
/ .form-actions
/ = f.button :submit
= f.hidden_field :device_id
.form-group
%label.col-lg-2.control-label{:for => "name"} Name
.col-lg-10
= f.input :name, label: false, input_html: { class: 'form-control' }
%br
.form-group
%label.col-lg-2.control-label{:for => "start_pos"} Start Position (bit)
.col-lg-10
= f.input :start_pos, label: false, input_html: { class: 'form-control' }
%br
.form-group
%label.col-lg-2.control-label{:for => "end_pos"} End Position (bit)
.col-lg-10
= f.input :end_pos, label: false, input_html: { class: 'form-control' }
%br
.form-group
%label.col-lg-2.control-label{:for => "notes"} Notes
.col-lg-10
= f.input :notes, label: false, type: 'text-area', input_html: { class: 'form-control textArea', rows: 10 }
%br
.form-group
%label.col-lg-2.control-label{:for => "colour"} Colour
.col-lg-10
- the_options = options_for_select([['gray', 'gray'], ['blue', 'blue'], ['aqua', 'aqua'], ['cadetblue', 'cadetblue'], ['darkblue', 'darkblue'], ['green', 'green'], ['darkgreen', 'darkgreen'], ['red', 'red'], ['darkred', 'darkred'], ['deeppink', 'deeppink'], ['fuchsia', 'fuchsia'], ['indigo', 'indigo'], ['goldenrod', 'goldenrod']],@section.colour)
= f.select :colour, the_options, label: false, input_html: { class: 'form-control' }
%br
%br
.form-group
.col-lg-10.col-lg-offset-2
/-#%button.btn.btn-default{:type => "reset"} Cancel
%button.btn.btn-primary{:type => "submit"} Submit Definition
%br
%br
================================================
FILE: app/views/sections/_manchester_analysis.html.haml
================================================
- if device.units.map(&:captures).flatten.present?
- if device.could_be_manchester?
%div.col-lg-12
%hr
%h4 Manchester Bit Position Analysis Tool
%p The longest binary string is used as the comparison baseline (B) below
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
- x1 = device.units.map(&:captures).flatten.each
- x = x1.sort_by {|y|y.manchester_decode.scan(/\w/).count}
- baseline = x.last.manchester_decode.scan(/\w/)
- x.each do |xx|
- diff = baseline.count - xx.manchester_decode.scan(/\w/).count
- if diff > 0
- diff.times do |i|
- xx.binary = xx.manchester_decode << 'p'
%thead
%tr
%th
-baseline.flatten.each_with_index do |it,index|
- section_bits = []
- device.sections.each do |section|
-if section.section_range.member? index
- section_bits << index
%th{:style => "color:white;background:#{section.colour}"}= index
-if section_bits.exclude? index
%th{:style => "color:white;"}= index
%tbody
- x.each do |barray|
%tr
%td
= link_to "#{barray.unit.name}: ",barray.unit, :style => "color:#2a9fd6;"
%br
= barray.name
- barray.manchester_decode.scan(/\w/).each_with_index do |b, index|
- if b == baseline[index]
- if b != 'p'
%td.text-success= b
- else
%td
-else
- if b != 'p'
%td.text-danger= b
- else
%td
%td{style:"text-align:center;"} B
-baseline.each do |b|
- if b != 'p'
%td.text-primary= b
- else
%td
%br
/ Taken from line 13 under flatten
/ - device.units.map(&:captures).flatten.each do |c|
/ - c.update_attribute(:binary, c.manchester_decode) if c.binary.blank?
================================================
FILE: app/views/sections/_no_sections.html.haml
================================================
- unless @sections.present?
%div.col-lg-12
%hr
%h4 Sections Defined
/# %p The longest binary string is used as the comparison baseline (B) below
%p No sections have been defined. You can either define your own in the "Define New Section" form (scroll down), or import a section template from the library.
= simple_form_for(:template, url: device_apply_template_path(:deivce_id => @device_id)) do |f|
/-#%button.btn.btn-default{:type => "reset"} Cancel
.col-lg-10
= f.input :template_id, collection: SectionTemplate.all, label: false, input_html: { class: 'form-control' }
%br
.form-group
.col-lg-10.col-lg-offset-0
%button.btn.btn-primary{:type => "submit"} Add sections from template
%br
================================================
FILE: app/views/sections/_pwm_analysis.html.haml
================================================
- if device.units.map(&:captures).flatten.present?
- if device.could_be_pwm?
%div.col-lg-12
%hr
%h4 PWM Bit Position Analysis Tool (66/33) - with Sections
%p The longest binary string is used as the comparison baseline (B) below
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
- x1 = device.units.map(&:captures).flatten.each
- x = x1.sort_by {|y|y.pwm_decode.scan(/\w/).count}
- baseline = x.last.pwm_decode.scan(/\w/)
- x.each do |xx|
- diff = baseline.count - xx.pwm_decode.scan(/\w/).count
- if diff > 0
- diff.times do |i|
- xx.binary = xx.pwm_decode << 'p'
%thead
%tr
%th
-baseline.flatten.each_with_index do |it,index|
- section_bits = []
- device.sections.each do |section|
-if section.section_range.member? index
- section_bits << index
%th{:style => "color:white;background:#{section.colour}"}= index
-if section_bits.exclude? index
%th{:style => "color:white;"}= index
%tbody
- x.each do |barray|
%tr
%td
= barray.class
%br
= barray.name
- barray.pwm_decode.scan(/\w/).each_with_index do |b, index|
- if b == baseline[index]
- if b != 'p'
%td.text-success= b
- else
%td
-else
- if b != 'p'
%td.text-danger= b
- else
%td
%td{style:"text-align:center;"} B
-baseline.each do |b|
- if b != 'p'
%td.text-primary= b
- else
%td
%br
- if device.could_be_pwm_7525?
%div.col-lg-12
%hr
%h4 PWM Bit Position Analysis Tool (75/25) - with Sections
%p The longest binary string is used as the comparison baseline (B) below
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
- x1 = device.units.map(&:captures).flatten.each
- x = x1.sort_by {|y|y.pwm_decode_7525.scan(/\w/).count}
- baseline = x.last.pwm_decode_7525.scan(/\w/)
- x.each do |xx|
- diff = baseline.count - xx.pwm_decode_7525.scan(/\w/).count
- if diff > 0
- diff.times do |i|
- xx.binary = xx.pwm_decode_7525 << 'p'
%thead
%tr
%th
-baseline.flatten.each_with_index do |it,index|
- section_bits = []
- device.sections.each do |section|
-if section.section_range.member? index
- section_bits << index
%th{:style => "color:white;background:#{section.colour}"}= index
-if section_bits.exclude? index
%th{:style => "color:white;"}= index
%tbody
- x.each do |barray|
%tr
%td
= barray.unit.name
%br
= barray.name
%br
= "id: #{barray.id}"
- barray.pwm_decode_7525.scan(/\w/).each_with_index do |b, index|
- if b == baseline[index]
- if b != 'p'
%td.text-success= b
- else
%td
-else
- if b != 'p'
%td.text-danger= b
- else
%td
%td{style:"text-align:center;"} B
-baseline.each do |b|
- if b != 'p'
%td.text-primary= b
- else
%td
%br
================================================
FILE: app/views/sections/_raw_analysis.html.haml
================================================
- if device.units.map(&:captures).flatten.any?
- vanilla = true
- if device.could_be_pwm? || device.could_be_pwm_7525? || device.could_be_manchester?
- vanilla = false
- if vanilla
%div.col-lg-12
%hr
%h4 Analysis Helper
%p The longest binary string is used as the comparison baseline (B)
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
- x1 = device.units.map(&:captures).flatten.each
- device.units.map(&:captures).flatten.each do |c|
- c.update_attribute(:binary, c.original_binary) if c.binary.blank?
- x = x1.sort_by {|y|y.original_binary.scan(/\w/).count}
- baseline = x.last.original_binary.scan(/\w/)
- x.each do |xx|
- diff = baseline.count - xx.original_binary.scan(/\w/).count
- xx.binary = xx.original_binary
- if diff > 0
- diff.times do |i|
- xx.binary = xx.binary << 'p'
%thead
%tr
%th
-baseline.flatten.each_with_index do |it,index|
- section_bits = []
- device.sections.each do |section|
-if section.section_range.member? index
- section_bits << index
%th{:style => "color:white;background:#{section.colour}"}= index
-if section_bits.exclude? index
%th{:style => "color:white;"}= index
%tbody
- x.each do |barray|
%tr
%td
= link_to "#{barray.unit.name}: ",barray.unit, :style => "color:#2a9fd6;"
= barray.name
- barray.binary.scan(/\w/).each_with_index do |b, index|
- if b == baseline[index]
- if b != 'p'
%td.text-success= b
- else
%td
-else
- if b != 'p'
%td.text-danger= b
- else
%td
%td{style:"text-align:center;"} B
-baseline.each do |b|
- if b != 'p'
%td.text-primary= b
- else
%td
%br
================================================
FILE: app/views/sections/_rfcat_config.html.haml
================================================
%p="d.setFreq(#{device.format_frequency})"
%p="d.setMdmDRate(#{device.baudrate})"
%p="d.setMdmModulation(MOD_ASK_OOK)"
%p="d.setMdmSyncMode(0)"
/%p="d.setMaxPower(0)"
%p
================================================
FILE: app/views/sections/_section_transformations.html.haml
================================================
%div.col-lg-12
%hr
%h4 Transformation Scratchpad
/# %p The longest binary string is used as the comparison baseline (B) below
%br
/ -`inspectrum`
- @sections.each do |section|
%h5= section.name
%table.table.table-hover.table-bordered{style:'background-color:black;'}
%thead
%tr
%th{:style => "color:grey;"} Capture
%th{:style => "color:grey;"} Binary
%th{:style => "color:grey;"} Decimal
%th{:style => "color:grey;"} Flipped Decimal
%tbody
- captures.each do |capture|
%tr
%th{style:"background-color:#{section.colour};"}
= capture.unit.name
%br
= capture.name
%br
= "id: #{capture.id}"
%td{:style=>"min-width:200px;"}
- if device.could_be_pwm_7525?
- b=capture.pwm_decode_7525
- elsif device.could_be_pwm?
- b=capture.pwm_decode
- elsif device.could_be_manchester?
- b=capture.manchester_decode
- else
- b=capture.original_binary
- section_binary = b[section.start_pos..section.end_pos]
= section_binary
%td
= section_binary.to_i(2)
%td
= section_binary.gsub("1","one").gsub("0","zero").gsub("zero","1").gsub("one",'0').to_i(2)
%br
================================================
FILE: app/views/sections/_sections.html.haml
================================================
- if @sections.present?
%div.col-lg-12
%hr
%h4
Sections Defined
/# %p The longest binary string is used as the comparison baseline (B) below
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
%thead
%tr
%th{:style => "color:grey;"} Name
%th{:style => "color:grey;"} Start Position
%th{:style => "color:grey;"} End Position
%th{:style => "color:grey;"} Colour
%th{:style => "color:grey;"} Notes
%th{:style => "color:grey;"}
%tbody
- @sections.each do |section|
%tr
%th{style:"background-color:#{section.colour};"}
= section.name
%td
= section.start_pos
%td
= section.end_pos
%td
= section.colour
%td
= section.notes
%td
= link_to 'Edit', edit_section_path(section), :style => "color:#2a9fd6;"
%br
= link_to 'Destroy', section, :method => :delete, :data => { :confirm => 'Are you sure?' }, :style => "color:red;"
%br
================================================
FILE: app/views/sections/edit.html.haml
================================================
%h1 Editing section
= render 'form'
= link_to 'Show', @section
\|
= link_to 'Back', sections_path
================================================
FILE: app/views/sections/generate.html.haml
================================================
%div.container-fluid
%div.row
%div.col-lg-12
%div.col-lg-12{:style=>" max-width:700px;"}
%h3{:style => "padding-left:3px;"}
Generated Binary
%br
-device = nil
.well.well-lg{:style=>" max-width:700px;"}
%h5 Generation Configuration
- params.to_a.each do |p|
- if p[0].include? "section"
- sect_id = p[0].gsub("section_","")
- s = Section.find(sect_id)
- c = Capture.find(p[1])
- d = device = c.unit.device
%p{:style=>" max-width:500px; word-wrap:break-word;"}
%span= "Section: "
%span{:style=>" color:white;"}= "#{s.name} "
%span= "(bits #{s.start_pos} to #{s.end_pos})"
%span= "from: "
%span{:style=>" color:white;"}= "#{c.unit.name}"
%span= " - "
%span{:style=>" color:white;"}= "#{c.name}"
%br
.well.well-lg{:style=>" max-width:700px;"}
%h4 Original Format
%br
%h5 Binary
-bin = ""
-type = ""
- params.to_a.each do |p|
- if p[0].include? "section"
- sect_id = p[0].gsub("section_","")
- s = Section.find(sect_id)
- c = Capture.find(p[1])
- d = c.unit.device
- device = d
// CHECK MODULATION
- if d.could_be_pwm_7525?
- type = "pwm7525"
- b = c.pwm_decode_7525
- bin << b[s.start_pos..s.end_pos]
- elsif d.could_be_pwm?
- type = "pwm"
- b = c.pwm_decode
- bin << b[s.start_pos..s.end_pos]
- elsif d.could_be_manchester?
- type = "manchester"
- b = c.manchester_decode
- bin << b[s.start_pos..s.end_pos]
- else
- type = "ook"
- b = c.original_binary
- bin << b[s.start_pos..s.end_pos]
%p{:style=>" max-width:500px; word-wrap:break-word;"}=bin
%br
%span="Size: "
%span= bin.size
%span="bits "
%br
%br
.well.well-lg{:style=>" max-width:700px;"}
%h4 OOK Format
%br
%h5 Binary
- ook_bin = ""
// CHECK MODULATION
- if device.flip_pwm
- if type == "pwm7525"
-bin.scan(/./).each do |bit|
- ook_bin << "1000" if bit.to_s == '1'
- ook_bin << "1110" if bit.to_s == '0'
- elsif type == "pwm"
-bin.scan(/./).each do |bit|
- ook_bin << "100" if bit.to_s == '1'
- ook_bin << "110" if bit.to_s == '0'
- elsif type == "manchester"
-bin.scan(/./).each do |bit|
- ook_bin << "01" if bit.to_s == '1'
- ook_bin << "10" if bit.to_s == '0'
- elsif type == "ook"
-ook_bin << bin
- else
- if type == "pwm7525"
-bin.scan(/./).each do |bit|
- ook_bin << "1110" if bit.to_s == '1'
- ook_bin << "1000" if bit.to_s == '0'
- elsif type == "pwm"
-bin.scan(/./).each do |bit|
- ook_bin << "110" if bit.to_s == '1'
- ook_bin << "100" if bit.to_s == '0'
- elsif type == "manchester"
-bin.scan(/./).each do |bit|
- ook_bin << "10" if bit.to_s == '1'
- ook_bin << "01" if bit.to_s == '0'
- elsif type == "ook"
-ook_bin << bin
%p{:style=>" max-width:500px; word-wrap:break-word;"}= ook_bin
%br
%span="Size: "
%span= ook_bin.size
%span="bits "
%br
%br
%hr
%h5 RFCat
=render "rfcat_config", device: device
%p{:style=>" max-width:500px; word-wrap:break-word;"}= "d.RFxmit(\"#{Capture.to_hexcode ook_bin}\")"
%br
%p="# or if you need to repeat the packet:"
%p{:style=>" max-width:500px; word-wrap:break-word;"}= "d.RFxmit(\"\\x00\\x00\\x00\\x00#{Capture.to_hexcode ook_bin}\" * 5)"
%br
-#Vertical text style for TH
-#%th{:style => "color:grey;-webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg);-ms-transform: rotate(-90deg);-o-transform: rotate(-90deg);filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);color: #FFF;text-transform: uppercase;"} 0
================================================
FILE: app/views/sections/index.html.haml
================================================
%div.container-fluid
%div.row
%div.col-lg-12
%h3
Reverse Engineering Worksheet:
= @device.name
%p A Reverse Engineering Worksheet is built around the concept of sections. A section if portion of the binary that you define to have a particular meaning. E.g. if bits 0-7 represent the "Device ID" then you can define a section to reflect that. The worksheet the binary generates below is based on the modulation and encoding type saved for the device.
%br
%div.col-lg-8
%table.table.table-bordered
%tr
%th.bg-primary{style:"width:15%;"} Name
%td= @device.name
%tr
%th.bg-primary FCC ID
%td= @device.fcc_id
%tr
%th.bg-primary Modulation
%td
= @device.modulation
%tr
%th.bg-primary Encoding
%td= @device.encoding
%tr
%th.bg-primary Frequency
%td
= @device.frequency
= ' Mhz'
%tr
%th.bg-primary Baudrate
%td= @device.baudrate
%tr
%th.bg-primary Decoding Rules
%td= @device.flip_pwm == true ? "Bits flipped after demodulation" : "Bits not flipped (Default State)"
%tr
%th.bg-primary Notes
%td= @device.notes
%div.col-lg-3
.well.well-lg
%h5 Actions
= link_to 'Go Back to Device View', @device, :style => "color:#2a9fd6;"
%br
= link_to 'Edit Device', edit_device_path(@device), :style => "color:#2a9fd6;"
=render "sections", sections: @sections
=render "no_sections", sections: @sections, device: @device
=render "pwm_analysis", device: @device, without_baseline: @without_baseline
=render "manchester_analysis", device: @device, without_baseline: @without_baseline
=render "raw_analysis", device: @device, without_baseline: @without_baseline
%div.col-lg-12
%hr
%h4 Define new section
%p Pick and choose which capture to use as a template for each section and generate the binary. Note for this to work as intended, each bit you want to send should be included in a section definition.
%br
= render 'form'
%div.col-lg-12
%hr
%h4 Generate Binary
%p Pick and choose which captures to use as a template for each defined section and generate the binary for RFCat transmission. Note for this to work as intended, each bit in the table above should be included in a section definition or it won't be represented in the generated string.
%br
= form_tag(generate_path, method: "post") do
- @sections.each_with_index do |section|
.form-group
%label.col-lg-6.control-label{:for => "colour"}= "#{section.name} from:"
.col-lg-10
- captures = []
- @device.captures.each do |c|
- captures << ["#{c.unit.name} - #{c.name}",c.id]
- the_options = options_for_select(captures)
= select_tag "section_#{section.id}", the_options, label: false, input_html: { class: 'form-control' }
%br
%hr
.form-group
.col-lg-10.col-lg-offset-0
%button.btn.btn-primary{:type => "submit"} Generate Binary
%br
%br
=render "section_transformations", device: @device, captures: @device.units.map(&:captures).flatten, without_baseline: @without_baseline
- unless @sections.blank?
%div.col-lg-12.well.well-lg
%h4 Share these sections as a template
%p Reverse engineering something that doesn't exist in our template library? Please consider sharing your section template with us all once you've finished reverse engineering this device.
= simple_form_for(SectionTemplate.new(:added_by => "anonymous")) do |f|
= f.hidden_field :device_id, :value => @device.id
/-#%button.btn.btn-default{:type => "reset"} Cancel
%label.col-lg-10.control-label{:for => "name"} Template Name (please be descriptive, but concise. E.g. "Generic Remote SC226x")
.col-lg-10
= f.input :name, label: false, input_html: { class: 'form-control' }
%br
%label.col-lg-10.control-label{:for => "added_by"} Your Name or Handle (or leave this field unchanged and submit anonymously)
.col-lg-10
= f.input :added_by, label: false, input_html: { class: 'form-control' }
%br
.form-group
.col-lg-10.col-lg-offset-0
%button.btn.btn-primary{:type => "submit"} Share as Template
%br
================================================
FILE: app/views/sections/index.json.jbuilder
================================================
json.array!(@sections) do |section|
json.extract! section, :id, :device_id, :name, :notes, :start_pos, :end_pos, :colour
json.url section_url(section, format: :json)
end
================================================
FILE: app/views/sections/new.html.haml
================================================
%h1 New section
= render 'form'
= link_to 'Back', sections_path
================================================
FILE: app/views/sections/show.html.haml
================================================
%p#notice= notice
%p
%b Device:
= @section.device_id
%p
%b Name:
= @section.name
%p
%b Notes:
= @section.notes
%p
%b Start pos:
= @section.start_pos
%p
%b End pos:
= @section.end_pos
%p
%b Colour:
= @section.colour
= link_to 'Edit', edit_section_path(@section)
\|
= link_to 'Back', sections_path
%div.container-fluid
%div.row
%div.col-lg-12
%h3
Device:
= @device.name
%p A device is effectively a category. It should have at least one unit. If you have multiple units of the same type (e.g. 3 identical garage door remotes), they are best represented as multiple units of the same device.
%br
%div.col-lg-8
%table.table.table-bordered
%tr
%th.bg-primary{style:"width:15%;"} Name
%td= @device.name
%tr
%th.bg-primary FCC ID
%td= @device.fcc_id
%tr
%th.bg-primary Modulation
%td
= @device.modulation
%tr
%th.bg-primary Encoding
%td= @device.encoding
%tr
%th.bg-primary Frequency
%td
= @device.frequency
= ' Mhz'
%tr
%th.bg-primary Baudrate
%td= @device.baudrate
%tr
%th.bg-primary Notes
%td= @device.notes
%div.col-lg-3
.well.well-lg
%h5 Actions
-#= link_to 'Add New Unit', edit_device_path(@device), :style => "color:#2a9fd6;"
-#%br
=link_to 'Edit Device', edit_device_path(@device), :style => "color:#2a9fd6;"
%br
= link_to 'Back to Devices', devices_path, :style => "color:#2a9fd6;"
=render "manchester_analysis", device: @device, without_baseline: @without_baseline
/ =render "manchester_analysis", unit: @unit
=render "pwm_analysis", device: @device, without_baseline: @without_baseline
/ =render "raw_analysis", unit: @unit
/ # change raw so only shows if no encoding
=render "raw_analysis", device: @device, without_baseline: @without_baseline
/ # replace with section add ??????
=render "add_unit", unit: @unit
=render "show_units", device: @device
%br
-#Vertical text style for TH
-#%th{:style => "color:grey;-webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg);-ms-transform: rotate(-90deg);-o-transform: rotate(-90deg);filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);color: #FFF;text-transform: uppercase;"} 0
================================================
FILE: app/views/sections/show.json.jbuilder
================================================
json.extract! @section, :id, :device_id, :name, :notes, :start_pos, :end_pos, :colour, :created_at, :updated_at
================================================
FILE: app/views/units/_captures.html.haml
================================================
%h4 Captures
%table.table.table-bordered.table.hover
%thead
%tr.bg-primary
%th ID
%th Name
%th Raw Binary
%th Actions
%tbody
- unit.captures.each do |u|
%tr
%td= u.id
%td= u.name
%td{:style=>"max-width:200px; word-wrap:break-word;"}
/ - u.original_binary.scan(/.{1,40}/).each do |s|
/ ="#{s}"
/ %br
= u.original_binary
%td{:style => "width:15%;"}
= link_to 'Destroy', u, :method => :delete, :data => { :confirm => 'Are you sure?' }
%div.col-lg-12
================================================
FILE: app/views/units/_form.html.haml
================================================
= simple_form_for(@unit) do |f|
= f.error_notification
= f.hidden_field :device_id
.form-group
%label.col-lg-2.control-label{:for => "inputEmail"} Name
.col-lg-10
= f.input :name, label: false, input_html: { class: 'form-control' }
%br
.form-group
.col-lg-10.col-lg-offset-2
/-#%button.btn.btn-default{:type => "reset"} Cancel
%button.btn.btn-primary{:type => "submit"} Submit
================================================
FILE: app/views/units/_manchester_analysis.html.haml
================================================
- if unit.captures.present?
- if unit.device.could_be_manchester?
%div.col-lg-12
%hr
%h4 Manchester Bit Position Analysis Tool
%p The longest binary string is used as the comparison baseline (B) below
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
- x1 = unit.captures.each
- x = x1.sort_by {|y|y.manchester_decode.scan(/\w/).count}
- baseline = x.last.manchester_decode.scan(/\w/)
- x.each do |xx|
- diff = baseline.count - xx.manchester_decode.scan(/\w/).count
- if diff > 0
- diff.times do |i|
- xx.binary = xx.manchester_decode << 'p'
%thead
%tr
%th
-baseline.flatten.each_with_index do |it,index|
%th{:style => "color:grey;"}= index
%tbody
- x.each do |barray|
%tr
%td
= barray.name
- barray.manchester_decode.scan(/\w/).each_with_index do |b, index|
- if b == baseline[index]
- if b != 'p'
%td.text-success= b
- else
%td
-else
- if b != 'p'
%td.text-danger= b
- else
%td
%td{style:"text-align:center;"} B
-baseline.each do |b|
- if b != 'p'
%td.text-primary= b
- else
%td
%br
================================================
FILE: app/views/units/_manchester_decoding.html.haml
================================================
%h5 Manchester Encoding
- if manchester_format.blank?
%span{:style => "float:right;"}= link_to "Switch to IEEE 802 Format", '?manchester_format=802', style:"color:#2a9fd6"
%p Defaulting to Manchester format: "G. E. Thomas"
- else
%span{:style => "float:right;"}= link_to "Switch to G. E. Thomas Format", '?', style:"color:#2a9fd6"
%p Showing as Manchester format: "IEE 802"
%table.table.table-bordered.table.hover
%thead
%tr.bg-primary
%th ID
%th Name
%th Valid?
%th Manchester Binary
%th Hex
%th Ascii
%th Actions
%tbody
- unit.captures.each do |u|
%tr
%td= u.id
%td= u.name
%td{:style=>"word-wrap:break-word;"}
- if u.valid_manchester?
%p{:style => "color:green;"}= "#{u.valid_manchester? human=true}"
- else
%p{:style => "color:red;"}= "#{u.valid_manchester? human=true}"
%td
- manchester = (manchester_format.blank? ? manchester = u.manchester_decode : u.flip(u.manchester_decode))
- manchester.scan(/.{1,40}/).each do |s|
="#{s}"
%br
%td{:style=>"word-wrap:break-word;"}="#{u.to_hexcode manchester}"
%td{:style=>"word-wrap:break-word;"}="#{u.bin_to_ascii(manchester)}"
%td{:style => "width:15%;"}
= link_to 'show', u
\|
= link_to 'Destroy', u, :method => :delete, :data => { :confirm => 'Are you sure?' }
================================================
FILE: app/views/units/_pwm_analysis.html.haml
================================================
- if unit.captures.present?
- if unit.device.could_be_pwm?
%div.col-lg-12
%hr
%h4 PWM Bit Position Analysis Tool (66/33)
%p The longest binary string is used as the comparison baseline (B) below
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
- x1 = unit.captures.each
- x = x1.sort_by {|y|y.pwm_decode.scan(/\w/).count}
- baseline = x.last.pwm_decode.scan(/\w/)
- x.each do |xx|
- diff = baseline.count - xx.pwm_decode.scan(/\w/).count
- if diff > 0
- diff.times do |i|
- xx.binary = xx.pwm_decode << 'p'
%thead
%tr
%th
-baseline.flatten.each_with_index do |it,index|
%th{:style => "color:grey;"}= index
%tbody
- x.each do |barray|
%tr
%td
= barray.name
- barray.pwm_decode.scan(/\w/).each_with_index do |b, index|
- if b == baseline[index]
- if b != 'p'
%td.text-success= b
- else
%td
-else
- if b != 'p'
%td.text-danger= b
- else
%td
%td{style:"text-align:center;"} B
-baseline.each do |b|
- if b != 'p'
%td.text-primary= b
- else
%td
%br
- if unit.device.could_be_pwm_7525?
%div.col-lg-12
%hr
%h4 PWM Bit Position Analysis Tool (75/25)
%p The longest binary string is used as the comparison baseline (B) below
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
- x1 = unit.captures.each
- x = x1.sort_by {|y|y.pwm_decode_7525.scan(/\w/).count}
- baseline = x.last.pwm_decode_7525.scan(/\w/)
- x.each do |xx|
- diff = baseline.count - xx.pwm_decode_7525.scan(/\w/).count
- if diff > 0
- diff.times do |i|
- xx.binary = xx.pwm_decode_7525 << 'p'
%thead
%tr
%th
-baseline.flatten.each_with_index do |it,index|
%th{:style => "color:grey;"}= index
%tbody
- x.each do |barray|
%tr
%td
= barray.name
- barray.pwm_decode_7525.scan(/\w/).each_with_index do |b, index|
- if b == baseline[index]
- if b != 'p'
%td.text-success= b
- else
%td
-else
- if b != 'p'
%td.text-danger= b
- else
%td
%td{style:"text-align:center;"} B
-baseline.each do |b|
- if b != 'p'
%td.text-primary= b
- else
%td
%br
================================================
FILE: app/views/units/_pwm_decoding.html.haml
================================================
%h5 PWM Encoding
- if pwm_format.blank?
%span{:style => "float:right;"}= link_to "Flip bits", '?pwm_format=flipped', style:"color:#2a9fd6"
%p Attempts to decode as PWM 66/33 Format (i.e. a 1 is 110, and a 0 is 100)
- else
%span{:style => "float:right;"}= link_to "Undo flip bits", '?', style:"color:#2a9fd6"
%p Attempts to decode as PWM 66/33 Format, with bits flipped (i.e. a 1 is 100, and a 0 is 110)
%table.table.table-bordered.table.hover
%thead
%tr.bg-primary
%th ID
%th Name
%th Valid?
%th PWM Binary
%th Hex
%th Ascii
%th Actions
%tbody
- unit.captures.each do |u|
%tr
%td= u.id
%td= u.name
%td
- if u.valid_pwm?
%p{:style => "color:green;"}= "#{u.valid_pwm? human=true}"
- else
%p{:style => "color:red;"}= "#{u.valid_pwm? human=true}"
%td{:style=>"word-wrap:break-word;"}
- pwm = (pwm_format.blank? ? u.pwm_decode : u.flip(u.pwm_decode))
- pwm.scan(/.{1,40}/).each do |s|
="#{s}"
%br
%td{:style=>"word-wrap:break-word;"}="#{u.to_hexcode pwm}"
%td{:style=>"word-wrap:break-word;"}="#{u.bin_to_ascii(pwm)}"
%td{:style => "width:15%;"}
= link_to 'show', u
\|
= link_to 'Destroy', u, :method => :delete, :data => { :confirm => 'Are you sure?' }
/ # 75/25
%h5 PWM Encoding
- if pwm_format.blank?
%span{:style => "float:right;"}= link_to "Flip bits", '?pwm_format=flipped', style:"color:#2a9fd6"
%p Attempts to decode as PWM 75/25 Format (i.e. a 1 is 1110, and a 0 is 1000)
- else
%span{:style => "float:right;"}= link_to "Undo flip bits", '?', style:"color:#2a9fd6"
%p Attempts to decode as PWM 75/25 Format, with bits flipped (i.e. a 1 is 1000, and a 0 is 1110)
%table.table.table-bordered.table.hover
%thead
%tr.bg-primary
%th ID
%th Name
%th Valid?
%th PWM Binary
%th Hex
%th Ascii
%th Actions
%tbody
- unit.captures.each do |u|
%tr
%td= u.id
%td= u.name
%td
- if u.valid_pwm_7525?
%p{:style => "color:green;"}= "#{u.valid_pwm_7525? human=true}"
- else
%p{:style => "color:red;"}= "#{u.valid_pwm_7525? human=true}"
%td{:style=>"word-wrap:break-word;"}
- pwm = (pwm_format.blank? ? u.pwm_decode_7525 : u.flip(u.pwm_decode_7525))
- pwm.scan(/.{1,40}/).each do |s|
="#{s}"
%br
%td{:style=>"word-wrap:break-word;"}="#{u.to_hexcode pwm}"
%td{:style=>"word-wrap:break-word;"}="#{u.bin_to_ascii(pwm)}"
%td{:style => "width:15%;"}
= link_to 'show', u
\|
= link_to 'Destroy', u, :method => :delete, :data => { :confirm => 'Are you sure?' }
================================================
FILE: app/views/units/_raw_analysis.html.haml
================================================
- if unit.captures.present?
%div.col-lg-12
%hr
%h4 Raw Bit Position Analysis Tool
%p The longest binary string is used as the comparison baseline (B) below
%br
/ -`inspectrum`
%table.table.table-hover.table-bordered{style:'background-color:black;'}
- x1 = unit.captures.each
- x = x1.sort_by {|y|y.original_binary.scan(/\w/).count}
- baseline = x.last.original_binary.scan(/\w/)
- x.each do |xx|
- diff = baseline.count - xx.original_binary.scan(/\w/).count
- xx.binary = xx.original_binary
- if diff > 0
- diff.times do |i|
- xx.binary = xx.binary << 'p'
%thead
%tr
%th
-baseline.flatten.each_with_index do |it,index|
%th{:style => "color:grey;"}= index
%tbody
- x.each do |barray|
%tr
%td
= barray.name
- barray.binary.scan(/\w/).each_with_index do |b, index|
- if b == baseline[index]
- if b != 'p'
%td.text-success= b
- else
%td
-else
- if b != 'p'
%td.text-danger= b
- else
%td
%td{style:"text-align:center;"} B
-baseline.each do |b|
- if b != 'p'
%td.text-primary= b
- else
%td
%br
================================================
FILE: app/views/units/_raw_decoding.html.haml
================================================
%h5 Raw (No special encoding)
%table.table.table-bordered.table.hover
%thead
%tr.bg-primary
%th ID
%th Name
%th Raw Binary To Hex
%th Raw Binary To Ascii
%th Actions
%tbody
- unit.captures.each do |u|
%tr
%td= u.id
%td= u.name
%td{:style=>"word-wrap:break-word;"}="#{u.to_hexcode }"
%td{:style=>"word-wrap:break-word;"}="#{u.to_ascii(manchester=false)}"
%td{:style => "width:15%;"}
= link_to 'show', u
\|
= link_to 'Destroy', u, :method => :delete, :data => { :confirm => 'Are you sure?' }
================================================
FILE: app/views/units/edit.html.haml
================================================
%h1 Editing unit
= render 'form'
= link_to 'Show', @unit
\|
= link_to 'Back', units_path
================================================
FILE: app/views/units/index.html.haml
================================================
%h1 Listing units
%table
%thead
%tr
%th Device
%th Name
%th Notes
%th
%th
%th
%tbody
- @units.each do |unit|
%tr
%td= unit.device_id
%td= unit.name
%td= unit.notes
%td= link_to 'Show', unit
%td= link_to 'Edit', edit_unit_path(unit)
%td= link_to 'Destroy', unit, :method => :delete, :data => { :confirm => 'Are you sure?' }
%br
= link_to 'New Unit', new_unit_path
================================================
FILE: app/views/units/index.json.jbuilder
================================================
json.array!(@units) do |unit|
json.extract! unit, :id, :device_id, :name, :notes
json.url unit_url(unit, format: :json)
end
================================================
FILE: app/views/units/new.html.haml
================================================
%h1 New unit
= render 'form'
= link_to 'Back', units_path
================================================
FILE: app/views/units/show.html.haml
================================================
%div.container-fluid
%div.row
%div.col-lg-12
%h3
Unit:
= @unit.name
%p
This unit is a
= link_to @unit.device.name, @unit.device, style:"color:#2a9fd6"
%br
%div.col-lg-8
%table.table.table-bordered
%tr
%th.bg-primary{style:"width:25%;"} Name
%td= @unit.name
%tr
%th.bg-primary Device ID
%td= @unit.device.id
%tr
%th.bg-primary Device Name
%td
= @unit.device.name
%tr
%th.bg-primary Notes
%td= @unit.notes
%div.col-lg-3
.well.well-lg
%h5 Actions
= link_to 'Add New Capture' , new_device_unit_capture_path(@unit.device.id, @unit.id), style:"color:#2a9fd6"
%br
= link_to 'Edit Unit', edit_unit_path(@unit), style:"color:#2a9fd6"
%br
= link_to 'View Device', @unit.device, style:"color:#2a9fd6"
%div.col-lg-12
%hr
=render "captures", unit: @unit
%hr
%h4 Automated Demodulation Attempts
%br
=render "raw_decoding", unit: @unit
=render "manchester_decoding", unit: @unit, manchester_format: @manchester_format
=render "pwm_decoding", unit: @unit, pwm_format: @pwm_format
=render "manchester_analysis", unit: @unit
=render "pwm_analysis", unit: @unit
=render "raw_analysis", unit: @unit
= simple_form_for(@unit) do |f|
= f.error_notification
.form-group
%label.col-lg-2.control-label{:for => "notes"} Notes
.col-lg-10
= f.input :notes, label: false, type: 'text-area', input_html: { class: 'form-control textArea', rows: 10 }
%br
.form-group
.col-lg-10.col-lg-offset-2
/-#%button.btn.btn-default{:type => "reset"} Cancel
%button.btn.btn-primary{:type => "submit"} Update
================================================
FILE: app/views/units/show.json.jbuilder
================================================
json.extract! @unit, :id, :device_id, :name, :notes, :created_at, :updated_at
================================================
FILE: bin/bundle
================================================
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')
================================================
FILE: bin/rails
================================================
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
================================================
FILE: bin/rake
================================================
#!/usr/bin/env ruby
require_relative '../config/boot'
require 'rake'
Rake.application.run
================================================
FILE: bin/setup
================================================
#!/usr/bin/env ruby
require 'pathname'
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
Dir.chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file:
puts "== Installing dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"
# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# system "cp config/database.yml.sample config/database.yml"
# end
puts "\n== Preparing database =="
system "bin/rake db:setup"
puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"
puts "\n== Restarting application server =="
system "touch tmp/restart.txt"
end
================================================
FILE: config/application.rb
================================================
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module DspectrumGUI
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
end
end
================================================
FILE: config/boot.rb
================================================
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
================================================
FILE: config/database.yml
================================================
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
production:
<<: *default
database: db/production.sqlite3
================================================
FILE: config/environment.rb
================================================
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Rails.application.initialize!
================================================
FILE: config/environments/development.rb
================================================
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true
# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
config.assets.raise_runtime_errors = true
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
end
================================================
FILE: config/environments/production.rb
================================================
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like
# NGINX, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = true
# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
config.log_level = :debug
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
end
================================================
FILE: config/environments/test.rb
================================================
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
# Configure static file server for tests with Cache-Control for performance.
config.serve_static_files = true
config.static_cache_control = 'public, max-age=3600'
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Randomize the order test cases are executed.
config.active_support.test_order = :random
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
end
================================================
FILE: config/favicon.json
================================================
{
"master_picture": "public/adb.png",
"favicon_design": {
"ios": {
"picture_aspect": "no_change"
},
"desktop_browser": [
],
"windows": {
"picture_aspect": "no_change",
"background_color": "#da532c",
"on_conflict": "override"
},
"android_chrome": {
"picture_aspect": "no_change",
"theme_color": "#ffffff",
"manifest": {
"name": "AdvisoryDB",
"display": "browser",
"orientation": "not_set",
"on_conflict": "override",
"declared": true
}
},
"safari_pinned_tab": {
"picture_aspect": "black_and_white",
"threshold": 50,
"theme_color": "#5bbad5"
}
},
"settings": {
"scaling_algorithm": "Mitchell",
"error_on_image_too_small": false
}
}
================================================
FILE: config/initializers/action_mailer.rb
================================================
# Be sure to restart your server when you modify this file.
# /config/initializers/action_mailer.rb..
# ActionMailer email configuration
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.zoho.com", #ENV['SMTP_ADDRESS'],
:port => 465, # ENV['SMTP_PORT'],
:domain => Rails.env == 'production' ? "advisorydb.com" : "localhost", # ENV['SMTP_DOMAIN'],
:user_name => "do-not-reply@advisorydb.com", #ENV['SMTP_USERNAME'],
:password => "ActionMailer!", #ENV['SMTP_PASSWORD'],
:authentication => :login,
:enable_starttls_auto => true,
:ssl => true
}
================================================
FILE: config/initializers/assets.rb
================================================
# Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
Rails.application.config.assets.precompile += %w( bootstrap.min.js )
Rails.application.config.assets.precompile += %w( favicon/.* )
================================================
FILE: config/initializers/backtrace_silencers.rb
================================================
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
# Rails.backtrace_cleaner.remove_silencers!
================================================
FILE: config/initializers/cookies_serializer.rb
================================================
# Be sure to restart your server when you modify this file.
Rails.application.config.action_dispatch.cookies_serializer = :json
================================================
FILE: config/initializers/devise.rb
================================================
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# The secret key used by Devise. Devise uses this key to generate
# random tokens. Changing this key will render invalid all existing
# confirmation, reset password and unlock tokens in the database.
# Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
# by default. You can change it below and use your own secret key.
# config.secret_key = '27ff1e4ffa3ec01fac4d388cd37ea67780a1fbbd936d7e9ba30ba89f289f55ef8a6914dd77b4ef0e60c2b9365c89950f5ae6d45c058c25da2c7977d2d736d49f'
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class
# with default "from" parameter.
config.mailer_sender = 'do-not-reply@advisorydb.com'
# Configure the class responsible to send e-mails.
# config.mailer = 'Devise::Mailer'
# ==> ORM configuration
# Load and configure the ORM. Supports :active_record (default) and
# :mongoid (bson_ext recommended) by default. Other ORMs may be
# available as additional gems.
require 'devise/orm/active_record'
# ==> Configuration for any authentication mechanism
# Configure which keys are used when authenticating a user. The default is
# just :email. You can configure it to use [:username, :subdomain], so for
# authenticating a user, both parameters are required. Remember that those
# parameters are used only when authenticating and not when retrieving from
# session. If you need permissions, you should implement that in a before filter.
# You can also supply a hash where the value is a boolean determining whether
# or not authentication should be aborted when the value is not present.
# config.authentication_keys = [:email]
# Configure parameters from the request object used for authentication. Each entry
# given should be a request
gitextract_do_0u321/
├── .gitignore
├── .rspec
├── .ruby-gemset
├── .ruby-version
├── .well-known/
│ └── .placeholder
├── COMM-LICENSE
├── Gemfile
├── Guardfile
├── LICENSE
├── README.md
├── Rakefile
├── SECURITY.md
├── app/
│ ├── assets/
│ │ ├── images/
│ │ │ └── .keep
│ │ ├── javascripts/
│ │ │ ├── advisories.coffee
│ │ │ ├── advisory_comments.coffee
│ │ │ ├── application.js
│ │ │ ├── captures.coffee
│ │ │ ├── categories.coffee
│ │ │ ├── challenge_attempts.coffee
│ │ │ ├── challenges.coffee
│ │ │ ├── dashboard.coffee
│ │ │ ├── devices.coffee
│ │ │ ├── messages.coffee
│ │ │ ├── product_versions.coffee
│ │ │ ├── products.coffee
│ │ │ ├── profile.coffee
│ │ │ ├── sections.coffee
│ │ │ ├── submission.coffee
│ │ │ ├── triage.coffee
│ │ │ ├── units.coffee
│ │ │ └── vendors.coffee
│ │ └── stylesheets/
│ │ ├── advisories.scss
│ │ ├── advisory_comments.scss
│ │ ├── application.scss
│ │ ├── captures.scss
│ │ ├── categories.scss
│ │ ├── challenge_attempts.scss
│ │ ├── challenges.scss
│ │ ├── dashboard.scss
│ │ ├── devices.scss
│ │ ├── messages.scss
│ │ ├── product_versions.scss
│ │ ├── products.scss
│ │ ├── profile.scss
│ │ ├── researcher.scss
│ │ ├── scaffolds.scss
│ │ ├── sections.scss
│ │ ├── submission.scss
│ │ ├── triage.scss
│ │ ├── units.scss
│ │ └── vendors.scss
│ ├── controllers/
│ │ ├── application_controller.rb
│ │ ├── captures_controller.rb
│ │ ├── concerns/
│ │ │ └── .keep
│ │ ├── dashboard_controller.rb
│ │ ├── devices_controller.rb
│ │ ├── registrations_controller.rb
│ │ ├── section_templates_controller.rb
│ │ ├── sections_controller.rb
│ │ └── units_controller.rb
│ ├── helpers/
│ │ ├── application_helper.rb
│ │ ├── captures_helper.rb
│ │ ├── dashboard_helper.rb
│ │ ├── devices_helper.rb
│ │ ├── section_templates_helper.rb
│ │ ├── sections_helper.rb
│ │ └── units_helper.rb
│ ├── models/
│ │ ├── .keep
│ │ ├── capture.rb
│ │ ├── concerns/
│ │ │ └── .keep
│ │ ├── cons.rb
│ │ ├── device.rb
│ │ ├── section.rb
│ │ ├── section_template.rb
│ │ ├── unit.rb
│ │ └── user.rb
│ └── views/
│ ├── application/
│ │ └── _favicon.html.erb
│ ├── captures/
│ │ ├── _form.html.haml
│ │ ├── edit.html.haml
│ │ ├── index.html.haml
│ │ ├── index.json.jbuilder
│ │ ├── new.html.haml
│ │ ├── show.html.haml
│ │ └── show.json.jbuilder
│ ├── dashboard/
│ │ ├── about.html.haml
│ │ ├── contribute.html.haml
│ │ └── temp.html.haml
│ ├── devices/
│ │ ├── _add_unit.html.haml
│ │ ├── _form.html.haml
│ │ ├── _manchester_analysis.html.haml
│ │ ├── _pwm_analysis.html.haml
│ │ ├── _raw_analysis.html.haml
│ │ ├── _show_units.html.haml
│ │ ├── edit.html.haml
│ │ ├── index.html.haml
│ │ ├── index.json.jbuilder
│ │ ├── new.html.haml
│ │ ├── show.html.haml
│ │ └── show.json.jbuilder
│ ├── devise/
│ │ ├── confirmations/
│ │ │ └── new.html.erb
│ │ ├── mailer/
│ │ │ ├── confirmation_instructions.html.erb
│ │ │ ├── password_change.html.erb
│ │ │ ├── reset_password_instructions.html.erb
│ │ │ └── unlock_instructions.html.erb
│ │ ├── passwords/
│ │ │ ├── edit.html.haml
│ │ │ └── new.html.haml
│ │ ├── registrations/
│ │ │ ├── edit.html.erb
│ │ │ └── new.html.haml
│ │ ├── sessions/
│ │ │ └── new.html.haml
│ │ ├── shared/
│ │ │ └── _links.html.erb
│ │ └── unlocks/
│ │ └── new.html.haml
│ ├── layouts/
│ │ ├── _footer.html.erb
│ │ ├── _messages.html.haml
│ │ ├── _navigation.html.haml
│ │ ├── _navigation_links.html.erb
│ │ ├── application.html.haml
│ │ ├── mailer.html.haml
│ │ └── mailer.text.haml
│ ├── profile/
│ │ ├── edit.html.haml
│ │ ├── index.html.haml
│ │ └── show.html.haml
│ ├── section_templates/
│ │ ├── index.html.haml
│ │ └── show.html.haml
│ ├── sections/
│ │ ├── _form.html.haml
│ │ ├── _manchester_analysis.html.haml
│ │ ├── _no_sections.html.haml
│ │ ├── _pwm_analysis.html.haml
│ │ ├── _raw_analysis.html.haml
│ │ ├── _rfcat_config.html.haml
│ │ ├── _section_transformations.html.haml
│ │ ├── _sections.html.haml
│ │ ├── edit.html.haml
│ │ ├── generate.html.haml
│ │ ├── index.html.haml
│ │ ├── index.json.jbuilder
│ │ ├── new.html.haml
│ │ ├── show.html.haml
│ │ └── show.json.jbuilder
│ └── units/
│ ├── _captures.html.haml
│ ├── _form.html.haml
│ ├── _manchester_analysis.html.haml
│ ├── _manchester_decoding.html.haml
│ ├── _pwm_analysis.html.haml
│ ├── _pwm_decoding.html.haml
│ ├── _raw_analysis.html.haml
│ ├── _raw_decoding.html.haml
│ ├── edit.html.haml
│ ├── index.html.haml
│ ├── index.json.jbuilder
│ ├── new.html.haml
│ ├── show.html.haml
│ └── show.json.jbuilder
├── bin/
│ ├── bundle
│ ├── rails
│ ├── rake
│ └── setup
├── config/
│ ├── application.rb
│ ├── boot.rb
│ ├── database.yml
│ ├── environment.rb
│ ├── environments/
│ │ ├── development.rb
│ │ ├── production.rb
│ │ └── test.rb
│ ├── favicon.json
│ ├── initializers/
│ │ ├── action_mailer.rb
│ │ ├── assets.rb
│ │ ├── backtrace_silencers.rb
│ │ ├── cookies_serializer.rb
│ │ ├── devise.rb
│ │ ├── filter_parameter_logging.rb
│ │ ├── inflections.rb
│ │ ├── kaminari.rb
│ │ ├── mime_types.rb
│ │ ├── session_store.rb
│ │ ├── simple_form.rb
│ │ └── wrap_parameters.rb
│ ├── locales/
│ │ ├── devise.en.yml
│ │ ├── en.yml
│ │ ├── simple_form.en.yml
│ │ ├── social_share_button.en.yml
│ │ ├── social_share_button.zh-CN.yml
│ │ └── social_share_button.zh-TW.yml
│ ├── railscomposer.yml
│ ├── routes.rb
│ └── secrets.yml
├── config.ru
├── db/
│ ├── migrate/
│ │ ├── 20160225071956_devise_create_users.rb
│ │ ├── 20160227015521_add_full_name_to_user.rb
│ │ ├── 20160918060423_create_devices.rb
│ │ ├── 20160918060509_create_units.rb
│ │ ├── 20160918060631_create_captures.rb
│ │ ├── 20170515023720_create_sections.rb
│ │ ├── 20170520033410_add_flip_pwm_to_devices.rb
│ │ └── 20170525084143_create_section_templates.rb
│ ├── schema.rb
│ ├── seeds.rb
│ └── template_seeds/
│ └── user_contributions.rb
├── lib/
│ ├── assets/
│ │ └── .keep
│ ├── tasks/
│ │ ├── .keep
│ │ ├── account_seeds.rake
│ │ └── custom_seed.rake
│ └── templates/
│ └── haml/
│ └── scaffold/
│ └── _form.html.haml
├── public/
│ ├── 404.html
│ ├── 422.html
│ ├── 500.html
│ └── robots.txt
├── spec/
│ ├── controllers/
│ │ ├── captures_controller_spec.rb
│ │ ├── devices_controller_spec.rb
│ │ ├── section_templates_controller_spec.rb
│ │ ├── sections_controller_spec.rb
│ │ └── units_controller_spec.rb
│ ├── factories/
│ │ ├── captures.rb
│ │ ├── devices.rb
│ │ ├── section_templates.rb
│ │ ├── sections.rb
│ │ └── units.rb
│ ├── helpers/
│ │ ├── captures_helper_spec.rb
│ │ ├── devices_helper_spec.rb
│ │ ├── section_templates_helper_spec.rb
│ │ ├── sections_helper_spec.rb
│ │ └── units_helper_spec.rb
│ ├── models/
│ │ ├── capture_spec.rb
│ │ ├── device_spec.rb
│ │ ├── section_spec.rb
│ │ ├── section_template_spec.rb
│ │ └── unit_spec.rb
│ ├── rails_helper.rb
│ ├── requests/
│ │ ├── captures_spec.rb
│ │ ├── devices_spec.rb
│ │ ├── section_templates_spec.rb
│ │ ├── sections_spec.rb
│ │ └── units_spec.rb
│ ├── routing/
│ │ ├── captures_routing_spec.rb
│ │ ├── devices_routing_spec.rb
│ │ ├── section_templates_routing_spec.rb
│ │ ├── sections_routing_spec.rb
│ │ └── units_routing_spec.rb
│ ├── spec_helper.rb
│ └── views/
│ ├── captures/
│ │ ├── edit.html.haml_spec.rb
│ │ ├── index.html.haml_spec.rb
│ │ ├── new.html.haml_spec.rb
│ │ └── show.html.haml_spec.rb
│ ├── devices/
│ │ ├── edit.html.haml_spec.rb
│ │ ├── index.html.haml_spec.rb
│ │ ├── new.html.haml_spec.rb
│ │ └── show.html.haml_spec.rb
│ ├── section_templates/
│ │ ├── edit.html.haml_spec.rb
│ │ ├── index.html.haml_spec.rb
│ │ ├── new.html.haml_spec.rb
│ │ └── show.html.haml_spec.rb
│ ├── sections/
│ │ ├── edit.html.haml_spec.rb
│ │ ├── index.html.haml_spec.rb
│ │ ├── new.html.haml_spec.rb
│ │ └── show.html.haml_spec.rb
│ └── units/
│ ├── edit.html.haml_spec.rb
│ ├── index.html.haml_spec.rb
│ ├── new.html.haml_spec.rb
│ └── show.html.haml_spec.rb
├── test/
│ ├── controllers/
│ │ └── .keep
│ ├── fixtures/
│ │ └── .keep
│ ├── helpers/
│ │ └── .keep
│ ├── integration/
│ │ └── .keep
│ ├── mailers/
│ │ └── .keep
│ ├── models/
│ │ └── .keep
│ └── test_helper.rb
└── vendor/
└── assets/
├── javascripts/
│ └── .keep
└── stylesheets/
└── .keep
SYMBOL INDEX (114 symbols across 32 files)
FILE: app/controllers/application_controller.rb
class ApplicationController (line 1) | class ApplicationController < ActionController::Base
FILE: app/controllers/captures_controller.rb
class CapturesController (line 1) | class CapturesController < ApplicationController
method index (line 8) | def index
method show (line 14) | def show
method shift_right (line 17) | def shift_right
method shift_left (line 22) | def shift_left
method new (line 28) | def new
method edit (line 83) | def edit
method create (line 88) | def create
method update (line 107) | def update
method destroy (line 121) | def destroy
method set_capture (line 131) | def set_capture
method capture_params (line 140) | def capture_params
FILE: app/controllers/dashboard_controller.rb
class DashboardController (line 1) | class DashboardController < ApplicationController
method about (line 6) | def about
method temp (line 15) | def temp
method contribute (line 19) | def contribute
FILE: app/controllers/devices_controller.rb
class DevicesController (line 1) | class DevicesController < ApplicationController
method index (line 7) | def index
method show (line 13) | def show
method new (line 19) | def new
method edit (line 24) | def edit
method create (line 29) | def create
method update (line 45) | def update
method destroy (line 59) | def destroy
method apply_template (line 67) | def apply_template
method set_device (line 88) | def set_device
method device_params (line 93) | def device_params
FILE: app/controllers/registrations_controller.rb
class RegistrationsController (line 1) | class RegistrationsController < Devise::RegistrationsController
method sign_up_params (line 7) | def sign_up_params
method account_update_params (line 11) | def account_update_params
FILE: app/controllers/section_templates_controller.rb
class SectionTemplatesController (line 1) | class SectionTemplatesController < ApplicationController
method index (line 6) | def index
method show (line 12) | def show
method create (line 15) | def create
method set_section_template (line 24) | def set_section_template
method section_template_params (line 29) | def section_template_params
FILE: app/controllers/sections_controller.rb
class SectionsController (line 1) | class SectionsController < ApplicationController
method index (line 6) | def index
method show (line 14) | def show
method new (line 18) | def new
method edit (line 23) | def edit
method create (line 28) | def create
method update (line 44) | def update
method destroy (line 58) | def destroy
method set_section (line 68) | def set_section
method section_params (line 73) | def section_params
FILE: app/controllers/units_controller.rb
class UnitsController (line 1) | class UnitsController < ApplicationController
method index (line 6) | def index
method show (line 12) | def show
method new (line 18) | def new
method edit (line 23) | def edit
method create (line 28) | def create
method update (line 44) | def update
method destroy (line 58) | def destroy
method set_unit (line 68) | def set_unit
method unit_params (line 73) | def unit_params
FILE: app/helpers/application_helper.rb
type ApplicationHelper (line 1) | module ApplicationHelper
FILE: app/helpers/captures_helper.rb
type CapturesHelper (line 1) | module CapturesHelper
FILE: app/helpers/dashboard_helper.rb
type DashboardHelper (line 1) | module DashboardHelper
FILE: app/helpers/devices_helper.rb
type DevicesHelper (line 1) | module DevicesHelper
FILE: app/helpers/section_templates_helper.rb
type SectionTemplatesHelper (line 1) | module SectionTemplatesHelper
FILE: app/helpers/sections_helper.rb
type SectionsHelper (line 1) | module SectionsHelper
FILE: app/helpers/units_helper.rb
type UnitsHelper (line 1) | module UnitsHelper
FILE: app/models/capture.rb
class Capture (line 1) | class Capture < ActiveRecord::Base
method flip (line 6) | def flip bin
method check_signals (line 14) | def check_signals shift=false
method pwm_decode (line 30) | def pwm_decode # 66/33
method pwm_decode_7525 (line 48) | def pwm_decode_7525
method valid_pwm? (line 65) | def valid_pwm? human=false
method valid_pwm_7525? (line 94) | def valid_pwm_7525? human=false
method shared_pwm_valid_response (line 124) | def shared_pwm_valid_response pwm_errors, the_bin, fixed_incomplete, p...
method manchester_decode (line 163) | def manchester_decode
method valid_manchester? (line 172) | def valid_manchester? human=false
method to_hexcode (line 187) | def to_hexcode bin=nil
method to_ascii (line 200) | def to_ascii manchester=false, pwm=false
method bin_to_ascii (line 213) | def bin_to_ascii bin
method shift_right (line 218) | def shift_right
method shift_left (line 223) | def shift_left
method to_hexcode (line 230) | def self.to_hexcode bin
FILE: app/models/cons.rb
class Cons (line 1) | class Cons
method live_capture_seed_file (line 4) | def self.live_capture_seed_file device_id, unit_id, capture_name, stop...
FILE: app/models/device.rb
class Device (line 1) | class Device < ActiveRecord::Base
method could_be_manchester? (line 7) | def could_be_manchester?
method could_be_pwm? (line 11) | def could_be_pwm?
method could_be_pwm_7525? (line 15) | def could_be_pwm_7525?
method update_modulation (line 19) | def update_modulation
method format_frequency (line 37) | def format_frequency
method decimals (line 43) | def decimals(a)
method sections_to_csv (line 53) | def sections_to_csv template_name, added_by
FILE: app/models/section.rb
class Section (line 1) | class Section < ActiveRecord::Base
method section_range (line 4) | def section_range
FILE: app/models/section_template.rb
class SectionTemplate (line 1) | class SectionTemplate < ActiveRecord::Base
FILE: app/models/unit.rb
class Unit (line 1) | class Unit < ActiveRecord::Base
FILE: app/models/user.rb
class User (line 1) | class User < ActiveRecord::Base
FILE: config/application.rb
type DspectrumGUI (line 9) | module DspectrumGUI
class Application (line 10) | class Application < Rails::Application
FILE: db/migrate/20160225071956_devise_create_users.rb
class DeviseCreateUsers (line 1) | class DeviseCreateUsers < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20160227015521_add_full_name_to_user.rb
class AddFullNameToUser (line 1) | class AddFullNameToUser < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20160918060423_create_devices.rb
class CreateDevices (line 1) | class CreateDevices < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20160918060509_create_units.rb
class CreateUnits (line 1) | class CreateUnits < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20160918060631_create_captures.rb
class CreateCaptures (line 1) | class CreateCaptures < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20170515023720_create_sections.rb
class CreateSections (line 1) | class CreateSections < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20170520033410_add_flip_pwm_to_devices.rb
class AddFlipPwmToDevices (line 1) | class AddFlipPwmToDevices < ActiveRecord::Migration
method change (line 2) | def change
FILE: db/migrate/20170525084143_create_section_templates.rb
class CreateSectionTemplates (line 1) | class CreateSectionTemplates < ActiveRecord::Migration
method change (line 2) | def change
FILE: test/test_helper.rb
class ActiveSupport::TestCase (line 5) | class ActiveSupport::TestCase
Condensed preview — 267 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (310K chars).
[
{
"path": ".gitignore",
"chars": 1762,
"preview": "#----------------------------------------------------------------------------\n# Ignore these files when commiting to a g"
},
{
"path": ".rspec",
"chars": 45,
"preview": "--require spec_helper\n--format Fuubar\n--color"
},
{
"path": ".ruby-gemset",
"chars": 13,
"preview": "dspectrumgui\n"
},
{
"path": ".ruby-version",
"chars": 11,
"preview": "ruby-2.5.5\n"
},
{
"path": ".well-known/.placeholder",
"chars": 1,
"preview": "\n"
},
{
"path": "COMM-LICENSE",
"chars": 1067,
"preview": "MIT License\n\nCopyright (c) 2017 Très Acton\n\nPermission is hereby granted, free of charge, to any person obtaining a copy"
},
{
"path": "Gemfile",
"chars": 2584,
"preview": "source 'https://rubygems.org'\n\n\n# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'\nruby '2.5.5' \ngem 'rails"
},
{
"path": "Guardfile",
"chars": 2423,
"preview": "# A sample Guardfile\n# More info at https://github.com/guard/guard#readme\n\n## Uncomment and set this to only include dir"
},
{
"path": "LICENSE",
"chars": 34520,
"preview": " GNU AFFERO GENERAL PUBLIC LICENSE\n Version 3, 19 November 2007\n\n Copyright (C)"
},
{
"path": "README.md",
"chars": 4220,
"preview": "# DSpectrumGUI\n\nThe goal of this app is to make it trivial to demodulate common RF signals, and provide a digital worksh"
},
{
"path": "Rakefile",
"chars": 249,
"preview": "# Add your own tasks in files placed in lib/tasks ending in .rake,\n# for example lib/tasks/capistrano.rake, and they wil"
},
{
"path": "SECURITY.md",
"chars": 853,
"preview": "# Security Policy\n\n## Supported Versions\n\n| Version | Supported |\n| ------- | ------------------ |\n| Master | "
},
{
"path": "app/assets/images/.keep",
"chars": 0,
"preview": ""
},
{
"path": "app/assets/javascripts/advisories.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/advisory_comments.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/application.js",
"chars": 722,
"preview": "// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//"
},
{
"path": "app/assets/javascripts/captures.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/categories.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/challenge_attempts.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/challenges.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/dashboard.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/devices.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/messages.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/product_versions.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/products.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/profile.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/sections.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/submission.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/triage.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/units.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/javascripts/vendors.coffee",
"chars": 211,
"preview": "# Place all the behaviors and hooks related to the matching controller here.\n# All this logic will automatically be avai"
},
{
"path": "app/assets/stylesheets/advisories.scss",
"chars": 181,
"preview": "// Place all the styles related to the Advisories controller here.\n// They will automatically be included in application"
},
{
"path": "app/assets/stylesheets/advisory_comments.scss",
"chars": 187,
"preview": "// Place all the styles related to the AdvisoryComments controller here.\n// They will automatically be included in appli"
},
{
"path": "app/assets/stylesheets/application.scss",
"chars": 1025,
"preview": "/*\n * This is a manifest file that'll be compiled into application.css, which will include all the files\n * listed below"
},
{
"path": "app/assets/stylesheets/captures.scss",
"chars": 179,
"preview": "// Place all the styles related to the Captures controller here.\n// They will automatically be included in application.c"
},
{
"path": "app/assets/stylesheets/categories.scss",
"chars": 181,
"preview": "// Place all the styles related to the Categories controller here.\n// They will automatically be included in application"
},
{
"path": "app/assets/stylesheets/challenge_attempts.scss",
"chars": 188,
"preview": "// Place all the styles related to the ChallengeAttempts controller here.\n// They will automatically be included in appl"
},
{
"path": "app/assets/stylesheets/challenges.scss",
"chars": 181,
"preview": "// Place all the styles related to the Challenges controller here.\n// They will automatically be included in application"
},
{
"path": "app/assets/stylesheets/dashboard.scss",
"chars": 1608,
"preview": "// Place all the styles related to the Dashboard controller here.\n// They will automatically be included in application."
},
{
"path": "app/assets/stylesheets/devices.scss",
"chars": 178,
"preview": "// Place all the styles related to the Devices controller here.\n// They will automatically be included in application.cs"
},
{
"path": "app/assets/stylesheets/messages.scss",
"chars": 179,
"preview": "// Place all the styles related to the Messages controller here.\n// They will automatically be included in application.c"
},
{
"path": "app/assets/stylesheets/product_versions.scss",
"chars": 186,
"preview": "// Place all the styles related to the ProductVersions controller here.\n// They will automatically be included in applic"
},
{
"path": "app/assets/stylesheets/products.scss",
"chars": 179,
"preview": "// Place all the styles related to the Products controller here.\n// They will automatically be included in application.c"
},
{
"path": "app/assets/stylesheets/profile.scss",
"chars": 178,
"preview": "// Place all the styles related to the profile controller here.\n// They will automatically be included in application.cs"
},
{
"path": "app/assets/stylesheets/researcher.scss",
"chars": 181,
"preview": "// Place all the styles related to the researcher controller here.\n// They will automatically be included in application"
},
{
"path": "app/assets/stylesheets/scaffolds.scss",
"chars": 1093,
"preview": "body {\n background-color: #fff;\n color: #333;\n font-family: verdana, arial, helvetica, sans-serif;\n font-size: 13px;"
},
{
"path": "app/assets/stylesheets/sections.scss",
"chars": 179,
"preview": "// Place all the styles related to the Sections controller here.\n// They will automatically be included in application.c"
},
{
"path": "app/assets/stylesheets/submission.scss",
"chars": 181,
"preview": "// Place all the styles related to the submission controller here.\n// They will automatically be included in application"
},
{
"path": "app/assets/stylesheets/triage.scss",
"chars": 177,
"preview": "// Place all the styles related to the Triage controller here.\n// They will automatically be included in application.css"
},
{
"path": "app/assets/stylesheets/units.scss",
"chars": 176,
"preview": "// Place all the styles related to the Units controller here.\n// They will automatically be included in application.css."
},
{
"path": "app/assets/stylesheets/vendors.scss",
"chars": 178,
"preview": "// Place all the styles related to the Vendors controller here.\n// They will automatically be included in application.cs"
},
{
"path": "app/controllers/application_controller.rb",
"chars": 240,
"preview": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you"
},
{
"path": "app/controllers/captures_controller.rb",
"chars": 3747,
"preview": "class CapturesController < ApplicationController\n before_action :set_capture, only: [:show, :edit, :update, :destroy, :"
},
{
"path": "app/controllers/concerns/.keep",
"chars": 0,
"preview": ""
},
{
"path": "app/controllers/dashboard_controller.rb",
"chars": 422,
"preview": "class DashboardController < ApplicationController\n skip_before_filter :authenticate_user!, only: [:about]\n\n\n\n def abou"
},
{
"path": "app/controllers/devices_controller.rb",
"chars": 2616,
"preview": "class DevicesController < ApplicationController\n require 'csv'\n before_action :set_device, only: [:show, :edit, :updat"
},
{
"path": "app/controllers/registrations_controller.rb",
"chars": 379,
"preview": "class RegistrationsController < Devise::RegistrationsController\n skip_before_filter :authenticate_user!\n\n\n private\n\n "
},
{
"path": "app/controllers/section_templates_controller.rb",
"chars": 954,
"preview": "class SectionTemplatesController < ApplicationController\n before_action :set_section_template, only: [:show]\n\n # GET /"
},
{
"path": "app/controllers/sections_controller.rb",
"chars": 2174,
"preview": "class SectionsController < ApplicationController\n before_action :set_section, only: [:show, :edit, :update, :destroy]\n\n"
},
{
"path": "app/controllers/units_controller.rb",
"chars": 1916,
"preview": "class UnitsController < ApplicationController\n before_action :set_unit, only: [:show, :edit, :update, :destroy]\n\n # GE"
},
{
"path": "app/helpers/application_helper.rb",
"chars": 29,
"preview": "module ApplicationHelper\nend\n"
},
{
"path": "app/helpers/captures_helper.rb",
"chars": 26,
"preview": "module CapturesHelper\nend\n"
},
{
"path": "app/helpers/dashboard_helper.rb",
"chars": 27,
"preview": "module DashboardHelper\nend\n"
},
{
"path": "app/helpers/devices_helper.rb",
"chars": 25,
"preview": "module DevicesHelper\nend\n"
},
{
"path": "app/helpers/section_templates_helper.rb",
"chars": 34,
"preview": "module SectionTemplatesHelper\nend\n"
},
{
"path": "app/helpers/sections_helper.rb",
"chars": 26,
"preview": "module SectionsHelper\nend\n"
},
{
"path": "app/helpers/units_helper.rb",
"chars": 23,
"preview": "module UnitsHelper\nend\n"
},
{
"path": "app/models/.keep",
"chars": 0,
"preview": ""
},
{
"path": "app/models/capture.rb",
"chars": 6971,
"preview": "class Capture < ActiveRecord::Base\n belongs_to :unit\n belongs_to :device\n\n\n def flip bin\n flipped = \"\"\n bin.sca"
},
{
"path": "app/models/concerns/.keep",
"chars": 0,
"preview": ""
},
{
"path": "app/models/cons.rb",
"chars": 837,
"preview": "class Cons \n # this isn't an active record model. it's soley here to help with console commands for usability\n\n def se"
},
{
"path": "app/models/device.rb",
"chars": 1904,
"preview": "class Device < ActiveRecord::Base\n require 'csv'\n has_many :units, dependent: :destroy\n has_many :captures\n has_many"
},
{
"path": "app/models/section.rb",
"chars": 112,
"preview": "class Section < ActiveRecord::Base\n belongs_to :device\n\n def section_range \n start_pos..end_pos\n end\n\nend\n"
},
{
"path": "app/models/section_template.rb",
"chars": 47,
"preview": "class SectionTemplate < ActiveRecord::Base\nend\n"
},
{
"path": "app/models/unit.rb",
"chars": 100,
"preview": "class Unit < ActiveRecord::Base\n belongs_to :device\n has_many :captures, dependent: :destroy\n\nend\n"
},
{
"path": "app/models/user.rb",
"chars": 233,
"preview": "class User < ActiveRecord::Base\n # Include default devise modules. Others available are:\n # :confirmable, :lockable, :"
},
{
"path": "app/views/application/_favicon.html.erb",
"chars": 1919,
"preview": "<link rel=\"apple-touch-icon\" sizes=\"57x57\" href=\"<%= asset_path 'favicon/apple-touch-icon-57x57.png' %>\">\n<link rel=\"app"
},
{
"path": "app/views/captures/_form.html.haml",
"chars": 492,
"preview": "= simple_form_for(@capture) do |f|\n = f.error_notification\n\n = f.hidden_field :device_id\n = f.hidden_field :unit_id\n "
},
{
"path": "app/views/captures/edit.html.haml",
"chars": 100,
"preview": "%h1 Editing capture\n\n= render 'form'\n\n= link_to 'Show', @capture\n\\|\n= link_to 'Back', captures_path\n"
},
{
"path": "app/views/captures/index.html.haml",
"chars": 657,
"preview": "%h1 Listing captures\n\n%table\n %thead\n %tr\n %th Unit\n %th Device\n %th Name\n %th Notes\n %th B"
},
{
"path": "app/views/captures/index.json.jbuilder",
"chars": 180,
"preview": "json.array!(@captures) do |capture|\n json.extract! capture, :id, :unit_id, :device_id, :name, :notes, :binary, :origina"
},
{
"path": "app/views/captures/new.html.haml",
"chars": 101,
"preview": "%fieldset\n %legend Add Capture From Inspectrum\n\n\n = render 'form'\n\n= link_to 'Back', @capture.unit\n"
},
{
"path": "app/views/captures/show.html.haml",
"chars": 331,
"preview": "%p#notice= notice\n\n%p\n %b Unit:\n = @capture.unit_id\n%p\n %b Device:\n = @capture.device_id\n%p\n %b Name:\n = @capture."
},
{
"path": "app/views/captures/show.json.jbuilder",
"chars": 118,
"preview": "json.extract! @capture, :id, :unit_id, :device_id, :name, :notes, :binary, :original_binary, :created_at, :updated_at\n"
},
{
"path": "app/views/dashboard/about.html.haml",
"chars": 1603,
"preview": "%div.container-fluid\n %div.row\n %div.col-lg-12\n %h4 DSpectrumGUI \n %br\n %p DSpectrumGUI is a locally "
},
{
"path": "app/views/dashboard/contribute.html.haml",
"chars": 1094,
"preview": "%div.container-fluid\n %div.row\n %div.col-lg-12\n %h4 DSpectrumGUI \n %br\n %p Please follow the instruct"
},
{
"path": "app/views/dashboard/temp.html.haml",
"chars": 1159,
"preview": "%div.container-fluid\n %div.row\n %div.col-lg-12\n %h3 Analysis Helper\n %br\n / -`inspectrum`\n\n %tab"
},
{
"path": "app/views/devices/_add_unit.html.haml",
"chars": 451,
"preview": "%div.col-lg-12\n %hr\n %h4 Units\n = simple_form_for(unit) do |f|\n = f.error_notification\n\n = f.hidden_field :devi"
},
{
"path": "app/views/devices/_form.html.haml",
"chars": 1820,
"preview": "= simple_form_for(@device) do |f|\n = f.error_notification\n\n .form-group\n %label.col-lg-2.control-label{:for => \"inp"
},
{
"path": "app/views/devices/_manchester_analysis.html.haml",
"chars": 1894,
"preview": "- if device.units.map(&:captures).flatten.present?\n - if device.could_be_manchester?\n %div.col-lg-12\n %hr\n "
},
{
"path": "app/views/devices/_pwm_analysis.html.haml",
"chars": 3292,
"preview": "- if device.units.map(&:captures).flatten.present?\n - if device.could_be_pwm?\n %div.col-lg-12\n %hr\n %h4 PW"
},
{
"path": "app/views/devices/_raw_analysis.html.haml",
"chars": 1965,
"preview": "- if device.units.map(&:captures).flatten.any?\n %div.col-lg-12\n %hr\n %h4 Analysis Helper\n %p The longest binar"
},
{
"path": "app/views/devices/_show_units.html.haml",
"chars": 645,
"preview": "%div.col-lg-12\n %br\n %table.table.table-bordered.table.hover\n %thead\n %tr.bg-primary\n %th Name\n "
},
{
"path": "app/views/devices/edit.html.haml",
"chars": 97,
"preview": "%h1 Editing device\n\n= render 'form'\n\n= link_to 'Show', @device\n\\|\n= link_to 'Back', devices_path\n"
},
{
"path": "app/views/devices/index.html.haml",
"chars": 1109,
"preview": "%div.container-fluid\n %div.row\n %div.col-lg-12\n %h3\n Devices\n %p A device is effectively a category"
},
{
"path": "app/views/devices/index.json.jbuilder",
"chars": 182,
"preview": "json.array!(@devices) do |device|\n json.extract! device, :id, :fcc_id, :baudrate, :frequency, :modulation, :encoding, :"
},
{
"path": "app/views/devices/new.html.haml",
"chars": 83,
"preview": "%fieldset\n %legend New Device\n\n\n = render 'form'\n\n= link_to 'Back', devices_path\n"
},
{
"path": "app/views/devices/show.html.haml",
"chars": 2345,
"preview": "%div.container-fluid\n %div.row\n %div.col-lg-12\n %h3\n Device:\n = @device.name\n - @device.up"
},
{
"path": "app/views/devices/show.json.jbuilder",
"chars": 124,
"preview": "json.extract! @device, :id, :fcc_id, :baudrate, :frequency, :modulation, :encoding, :name, :notes, :created_at, :updated"
},
{
"path": "app/views/devise/confirmations/new.html.erb",
"chars": 485,
"preview": "<h2>Resend confirmation instructions</h2>\n\n<%= simple_form_for(resource, as: resource_name, url: confirmation_path(resou"
},
{
"path": "app/views/devise/mailer/confirmation_instructions.html.erb",
"chars": 198,
"preview": "<p>Welcome <%= @email %>!</p>\n\n<p>You can confirm your account email through the link below:</p>\n\n<p><%= link_to 'Confir"
},
{
"path": "app/views/devise/mailer/password_change.html.erb",
"chars": 121,
"preview": "<p>Hello <%= @resource.full_name %>!</p>\n\n<p>We're contacting you to notify you that your password has been changed.</p>"
},
{
"path": "app/views/devise/mailer/reset_password_instructions.html.erb",
"chars": 467,
"preview": "<p>Hello <%= @resource.full_name %>!</p>\n\n<p>Someone has requested a link to change your password. You can do this throu"
},
{
"path": "app/views/devise/mailer/unlock_instructions.html.erb",
"chars": 280,
"preview": "<p>Hello <%= @resource.full_name %>!</p>\n\n<p>Your account has been locked due to an excessive number of unsuccessful sig"
},
{
"path": "app/views/devise/passwords/edit.html.haml",
"chars": 1047,
"preview": "%h3 Change your password?\n\n= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { met"
},
{
"path": "app/views/devise/passwords/new.html.haml",
"chars": 628,
"preview": "\n%h3 Forgot your password?\n\n= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { me"
},
{
"path": "app/views/devise/registrations/edit.html.erb",
"chars": 1056,
"preview": "<h2>Edit <%= resource_name.to_s.humanize %></h2>\n\n<%= simple_form_for(resource, as: resource_name, url: registration_pat"
},
{
"path": "app/views/devise/registrations/new.html.haml",
"chars": 2460,
"preview": "\n%h3 Sign Up\n\n%div.row\n\t%div.col-lg-8\n\t\t= simple_form_for(resource, as: resource_name, url: registration_path(resource_n"
},
{
"path": "app/views/devise/sessions/new.html.haml",
"chars": 830,
"preview": "%h3 Authenticate\n\n= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| \n\n\t%table.tabl"
},
{
"path": "app/views/devise/shared/_links.html.erb",
"chars": 1207,
"preview": "<div style=\"text-align:right;\">\n\t<%- if controller_name != 'sessions' %>\n\t <%= link_to \"Log in\", new_session_path(resou"
},
{
"path": "app/views/devise/unlocks/new.html.haml",
"chars": 637,
"preview": "\n<h2>Resend unlock instructions</h2>\n\n= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) d"
},
{
"path": "app/views/layouts/_footer.html.erb",
"chars": 238,
"preview": "<!-- Footer -->\n<div class=\"container\">\n <hr>\n <footer>\n <div class=\"row\">\n <div class=\"col-lg-12\">\n "
},
{
"path": "app/views/layouts/_messages.html.haml",
"chars": 337,
"preview": "-# Rails flash messages styled for Bootstrap 3.0\n- flash.each do |name, msg|\n - if msg.is_a?(String)\n %div{:class =>"
},
{
"path": "app/views/layouts/_navigation.html.haml",
"chars": 596,
"preview": "-# navigation styled for Bootstrap 3.0\n%nav.navbar.navbar-default.navbar-fixed-top\n\n\n\n\n %a.nounderline{:href => \"/\",sty"
},
{
"path": "app/views/layouts/_navigation_links.html.erb",
"chars": 41,
"preview": "<%# add navigation links to this file %>\n"
},
{
"path": "app/views/layouts/application.html.haml",
"chars": 1699,
"preview": "!!!\n%html\n %head\n = render 'favicon'\n %meta{:name => \"viewport\", :content => \"width=device-width, initial-scale=1"
},
{
"path": "app/views/layouts/mailer.html.haml",
"chars": 25,
"preview": "%hmtl\n %body\n = yield"
},
{
"path": "app/views/layouts/mailer.text.haml",
"chars": 7,
"preview": "= yield"
},
{
"path": "app/views/profile/edit.html.haml",
"chars": 64,
"preview": "%h1 Profile#edit\n%p Find me in app/views/profile/edit.html.haml\n"
},
{
"path": "app/views/profile/index.html.haml",
"chars": 66,
"preview": "%h1 Profile#index\n%p Find me in app/views/profile/index.html.haml\n"
},
{
"path": "app/views/profile/show.html.haml",
"chars": 3817,
"preview": "- if @myprofile\n\t%table.table.table-bordered.table-hover\n\t\t%tr\n\t\t\t%th{style:'width:20%;'} Name\n\t\t\t%td= @profile.full_nam"
},
{
"path": "app/views/section_templates/index.html.haml",
"chars": 620,
"preview": "%h1 Listing section_templates\n\n%table\n %thead\n %tr\n %th Name\n %th Sections\n %th Added by\n %th\n "
},
{
"path": "app/views/section_templates/show.html.haml",
"chars": 267,
"preview": "%p#notice= notice\n\n%p\n %b Name:\n = @section_template.name\n%p\n %b Sections:\n = @section_template.sections\n%p\n %b Add"
},
{
"path": "app/views/sections/_form.html.haml",
"chars": 1822,
"preview": "= simple_form_for(@section) do |f|\n = f.error_notification\n\n / .form-inputs\n / = f.input :device_id\n / = f.input"
},
{
"path": "app/views/sections/_manchester_analysis.html.haml",
"chars": 2208,
"preview": "- if device.units.map(&:captures).flatten.present?\n - if device.could_be_manchester?\n %div.col-lg-12\n %hr\n "
},
{
"path": "app/views/sections/_no_sections.html.haml",
"chars": 787,
"preview": "- unless @sections.present?\n %div.col-lg-12\n %hr\n %h4 Sections Defined\n\n /# %p The longest binary string is us"
},
{
"path": "app/views/sections/_pwm_analysis.html.haml",
"chars": 3897,
"preview": "- if device.units.map(&:captures).flatten.present?\n - if device.could_be_pwm?\n %div.col-lg-12\n %hr\n %h4 PW"
},
{
"path": "app/views/sections/_raw_analysis.html.haml",
"chars": 2217,
"preview": "- if device.units.map(&:captures).flatten.any?\n - vanilla = true\n - if device.could_be_pwm? || device.could_be_pwm_752"
},
{
"path": "app/views/sections/_rfcat_config.html.haml",
"chars": 170,
"preview": "%p=\"d.setFreq(#{device.format_frequency})\"\n%p=\"d.setMdmDRate(#{device.baudrate})\"\n%p=\"d.setMdmModulation(MOD_ASK_OOK)\"\n%"
},
{
"path": "app/views/sections/_section_transformations.html.haml",
"chars": 1436,
"preview": "%div.col-lg-12\n %hr\n %h4 Transformation Scratchpad\n\n /# %p The longest binary string is used as the comparison baseli"
},
{
"path": "app/views/sections/_sections.html.haml",
"chars": 1194,
"preview": "- if @sections.present?\n %div.col-lg-12\n %hr\n %h4 \n Sections Defined\n \n\n /# %p The longest binary st"
},
{
"path": "app/views/sections/edit.html.haml",
"chars": 100,
"preview": "%h1 Editing section\n\n= render 'form'\n\n= link_to 'Show', @section\n\\|\n= link_to 'Back', sections_path\n"
},
{
"path": "app/views/sections/generate.html.haml",
"chars": 4666,
"preview": "%div.container-fluid\n %div.row\n %div.col-lg-12\n %div.col-lg-12{:style=>\" max-width:700px;\"}\n %h3{:style "
},
{
"path": "app/views/sections/index.html.haml",
"chars": 4741,
"preview": "%div.container-fluid\n %div.row\n %div.col-lg-12\n %h3\n Reverse Engineering Worksheet:\n = @device.na"
},
{
"path": "app/views/sections/index.json.jbuilder",
"chars": 174,
"preview": "json.array!(@sections) do |section|\n json.extract! section, :id, :device_id, :name, :notes, :start_pos, :end_pos, :colo"
},
{
"path": "app/views/sections/new.html.haml",
"chars": 66,
"preview": "%h1 New section\n\n= render 'form'\n\n= link_to 'Back', sections_path\n"
},
{
"path": "app/views/sections/show.html.haml",
"chars": 2535,
"preview": "%p#notice= notice\n\n%p\n %b Device:\n = @section.device_id\n%p\n %b Name:\n = @section.name\n%p\n %b Notes:\n = @section.no"
},
{
"path": "app/views/sections/show.json.jbuilder",
"chars": 112,
"preview": "json.extract! @section, :id, :device_id, :name, :notes, :start_pos, :end_pos, :colour, :created_at, :updated_at\n"
},
{
"path": "app/views/units/_captures.html.haml",
"chars": 585,
"preview": "%h4 Captures\n%table.table.table-bordered.table.hover\n %thead\n %tr.bg-primary\n %th ID\n %th Name\n %th R"
},
{
"path": "app/views/units/_form.html.haml",
"chars": 424,
"preview": "= simple_form_for(@unit) do |f|\n = f.error_notification\n\n = f.hidden_field :device_id\n\n .form-group\n %label.col-lg"
},
{
"path": "app/views/units/_manchester_analysis.html.haml",
"chars": 1543,
"preview": "- if unit.captures.present?\n - if unit.device.could_be_manchester?\n %div.col-lg-12\n %hr\n %h4 Manchester Bi"
},
{
"path": "app/views/units/_manchester_decoding.html.haml",
"chars": 1453,
"preview": "%h5 Manchester Encoding\n- if manchester_format.blank?\n %span{:style => \"float:right;\"}= link_to \"Switch to IEEE 802 For"
},
{
"path": "app/views/units/_pwm_analysis.html.haml",
"chars": 3011,
"preview": "- if unit.captures.present?\n - if unit.device.could_be_pwm?\n %div.col-lg-12\n %hr\n %h4 PWM Bit Position Ana"
},
{
"path": "app/views/units/_pwm_decoding.html.haml",
"chars": 2843,
"preview": "%h5 PWM Encoding\n- if pwm_format.blank?\n %span{:style => \"float:right;\"}= link_to \"Flip bits\", '?pwm_format=flipped', s"
},
{
"path": "app/views/units/_raw_analysis.html.haml",
"chars": 1424,
"preview": "- if unit.captures.present?\n %div.col-lg-12\n %hr\n %h4 Raw Bit Position Analysis Tool\n\n %p The longest binary s"
},
{
"path": "app/views/units/_raw_decoding.html.haml",
"chars": 610,
"preview": "%h5 Raw (No special encoding)\n\n%table.table.table-bordered.table.hover\n %thead\n %tr.bg-primary\n %th ID\n %t"
},
{
"path": "app/views/units/edit.html.haml",
"chars": 91,
"preview": "%h1 Editing unit\n\n= render 'form'\n\n= link_to 'Show', @unit\n\\|\n= link_to 'Back', units_path\n"
},
{
"path": "app/views/units/index.html.haml",
"chars": 469,
"preview": "%h1 Listing units\n\n%table\n %thead\n %tr\n %th Device\n %th Name\n %th Notes\n %th\n %th\n %th"
},
{
"path": "app/views/units/index.json.jbuilder",
"chars": 128,
"preview": "json.array!(@units) do |unit|\n json.extract! unit, :id, :device_id, :name, :notes\n json.url unit_url(unit, format: :js"
},
{
"path": "app/views/units/new.html.haml",
"chars": 60,
"preview": "%h1 New unit\n\n= render 'form'\n\n= link_to 'Back', units_path\n"
},
{
"path": "app/views/units/show.html.haml",
"chars": 1936,
"preview": "%div.container-fluid\n %div.row\n %div.col-lg-12\n %h3\n Unit:\n = @unit.name\n %p\n This un"
},
{
"path": "app/views/units/show.json.jbuilder",
"chars": 78,
"preview": "json.extract! @unit, :id, :device_id, :name, :notes, :created_at, :updated_at\n"
},
{
"path": "bin/bundle",
"chars": 129,
"preview": "#!/usr/bin/env ruby\nENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)\nload Gem.bin_path('bundler', '"
},
{
"path": "bin/rails",
"chars": 145,
"preview": "#!/usr/bin/env ruby\nAPP_PATH = File.expand_path('../../config/application', __FILE__)\nrequire_relative '../config/boot'\n"
},
{
"path": "bin/rake",
"chars": 90,
"preview": "#!/usr/bin/env ruby\nrequire_relative '../config/boot'\nrequire 'rake'\nRake.application.run\n"
},
{
"path": "bin/setup",
"chars": 805,
"preview": "#!/usr/bin/env ruby\nrequire 'pathname'\n\n# path to your application root.\nAPP_ROOT = Pathname.new File.expand_path('../.."
},
{
"path": "config/application.rb",
"chars": 1189,
"preview": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any "
},
{
"path": "config/boot.rb",
"chars": 132,
"preview": "ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)\n\nrequire 'bundler/setup' # Set up gems listed in t"
},
{
"path": "config/database.yml",
"chars": 552,
"preview": "# SQLite version 3.x\n# gem install sqlite3\n#\n# Ensure the SQLite 3 gem is defined in your Gemfile\n# gem 'sqlite3'\n"
},
{
"path": "config/environment.rb",
"chars": 150,
"preview": "# Load the Rails application.\nrequire File.expand_path('../application', __FILE__)\n\n# Initialize the Rails application.\n"
},
{
"path": "config/environments/development.rb",
"chars": 1668,
"preview": "Rails.application.configure do\n # Settings specified here will take precedence over those in config/application.rb.\n\n "
},
{
"path": "config/environments/production.rb",
"chars": 3371,
"preview": "Rails.application.configure do\n # Settings specified here will take precedence over those in config/application.rb.\n\n "
},
{
"path": "config/environments/test.rb",
"chars": 1755,
"preview": "Rails.application.configure do\n # Settings specified here will take precedence over those in config/application.rb.\n\n "
},
{
"path": "config/favicon.json",
"chars": 959,
"preview": "{\n \"master_picture\": \"public/adb.png\",\n \"favicon_design\": {\n \"ios\": {\n \"picture_aspect\": \"no_cha"
},
{
"path": "config/initializers/action_mailer.rb",
"chars": 683,
"preview": "# Be sure to restart your server when you modify this file.\n# /config/initializers/action_mailer.rb..\n\n# ActionMailer em"
},
{
"path": "config/initializers/assets.rb",
"chars": 618,
"preview": "\n# Be sure to restart your server when you modify this file.\n\n# Version of your assets, change this if you want to expir"
},
{
"path": "config/initializers/backtrace_silencers.rb",
"chars": 404,
"preview": "# Be sure to restart your server when you modify this file.\n\n# You can add backtrace silencers for libraries that you're"
},
{
"path": "config/initializers/cookies_serializer.rb",
"chars": 129,
"preview": "# Be sure to restart your server when you modify this file.\n\nRails.application.config.action_dispatch.cookies_serializer"
},
{
"path": "config/initializers/devise.rb",
"chars": 13098,
"preview": "# Use this hook to configure devise mailer, warden hooks and so forth.\n# Many of these configuration options can be set "
},
{
"path": "config/initializers/filter_parameter_logging.rb",
"chars": 194,
"preview": "# Be sure to restart your server when you modify this file.\n\n# Configure sensitive parameters which will be filtered fro"
},
{
"path": "config/initializers/inflections.rb",
"chars": 647,
"preview": "# Be sure to restart your server when you modify this file.\n\n# Add new inflection rules using the following format. Infl"
},
{
"path": "config/initializers/kaminari.rb",
"chars": 115,
"preview": "# config/initializers/kaminari.rb\nKaminari.configure do |config|\n config.page_method_name = :per_page_kaminari\nend"
},
{
"path": "config/initializers/mime_types.rb",
"chars": 156,
"preview": "# Be sure to restart your server when you modify this file.\n\n# Add new mime types for use in respond_to blocks:\n# Mime::"
},
{
"path": "config/initializers/session_store.rb",
"chars": 142,
"preview": "# Be sure to restart your server when you modify this file.\n\nRails.application.config.session_store :cookie_store, key: "
},
{
"path": "config/initializers/simple_form.rb",
"chars": 6398,
"preview": "# Use this setup block to configure all options available in SimpleForm.\nSimpleForm.setup do |config|\n # Wrappers are u"
},
{
"path": "config/initializers/wrap_parameters.rb",
"chars": 517,
"preview": "# Be sure to restart your server when you modify this file.\n\n# This file contains settings for ActionController::ParamsW"
},
{
"path": "config/locales/devise.en.yml",
"chars": 4084,
"preview": "# Additional translations at https://github.com/plataformatec/devise/wiki/I18n\n\nen:\n devise:\n confirmations:\n c"
},
{
"path": "config/locales/en.yml",
"chars": 634,
"preview": "# Files in the config/locales directory are used for internationalization\n# and are automatically loaded by Rails. If yo"
},
{
"path": "config/locales/simple_form.en.yml",
"chars": 838,
"preview": "en:\n simple_form:\n \"yes\": 'Yes'\n \"no\": 'No'\n required:\n text: 'required'\n mark: '*'\n # You can "
},
{
"path": "config/locales/social_share_button.en.yml",
"chars": 408,
"preview": "en:\n social_share_button:\n share_to: Share to %{name}\n weibo: Sina Weibo\n twitter: Twitter\n facebook: Faceb"
},
{
"path": "config/locales/social_share_button.zh-CN.yml",
"chars": 370,
"preview": "'zh-CN':\n social_share_button:\n share_to: 分享到 %{name}\n weibo: 新浪微博\n twitter: Twitter\n facebook: Facebook\n "
},
{
"path": "config/locales/social_share_button.zh-TW.yml",
"chars": 367,
"preview": "'zh-TW':\n social_share_button:\n share_to: 分享到 %{name}\n weibo: 新浪微博\n twitter: Twitter\n facebook: Facebook\n "
},
{
"path": "config/railscomposer.yml",
"chars": 630,
"preview": "# This application was generated with Rails Composer\n\ndevelopment:\n apps4: rails-devise-roles\n announcements: none\n d"
},
{
"path": "config/routes.rb",
"chars": 1162,
"preview": "Rails.application.routes.draw do\n\n\n resources :section_templates \n resources :sections\n resources :captures\n resourc"
},
{
"path": "config/secrets.yml",
"chars": 964,
"preview": "# Be sure to restart your server when you modify this file.\n\n# Your secret key is used for verifying the integrity of si"
},
{
"path": "config.ru",
"chars": 153,
"preview": "# This file is used by Rack-based servers to start the application.\n\nrequire ::File.expand_path('../config/environment',"
},
{
"path": "db/migrate/20160225071956_devise_create_users.rb",
"chars": 1363,
"preview": "class DeviseCreateUsers < ActiveRecord::Migration\n def change\n create_table(:users) do |t|\n ## Database authent"
},
{
"path": "db/migrate/20160227015521_add_full_name_to_user.rb",
"chars": 116,
"preview": "class AddFullNameToUser < ActiveRecord::Migration\n def change\n add_column :users, :full_name, :string\n end\nend\n"
},
{
"path": "db/migrate/20160918060423_create_devices.rb",
"chars": 308,
"preview": "class CreateDevices < ActiveRecord::Migration\n def change\n create_table :devices do |t|\n t.string :fcc_id\n "
},
{
"path": "db/migrate/20160918060509_create_units.rb",
"chars": 206,
"preview": "class CreateUnits < ActiveRecord::Migration\n def change\n create_table :units do |t|\n t.integer :device_id\n "
},
{
"path": "db/migrate/20160918060631_create_captures.rb",
"chars": 288,
"preview": "class CreateCaptures < ActiveRecord::Migration\n def change\n create_table :captures do |t|\n t.integer :unit_id\n "
},
{
"path": "db/migrate/20170515023720_create_sections.rb",
"chars": 289,
"preview": "class CreateSections < ActiveRecord::Migration\n def change\n create_table :sections do |t|\n t.integer :device_id"
},
{
"path": "db/migrate/20170520033410_add_flip_pwm_to_devices.rb",
"chars": 120,
"preview": "class AddFlipPwmToDevices < ActiveRecord::Migration\n def change\n add_column :devices, :flip_pwm, :boolean\n end\nend\n"
},
{
"path": "db/migrate/20170525084143_create_section_templates.rb",
"chars": 230,
"preview": "class CreateSectionTemplates < ActiveRecord::Migration\n def change\n create_table :section_templates do |t|\n t.s"
},
{
"path": "db/schema.rb",
"chars": 3007,
"preview": "# encoding: UTF-8\n# This file is auto-generated from the current state of the database. Instead\n# of editing this file, "
},
{
"path": "db/seeds.rb",
"chars": 419,
"preview": "u = User.find_or_create_by(:email => \"user@example.com\") do |user|\n user.password = \"password\"\n user.password_confirma"
},
{
"path": "db/template_seeds/user_contributions.rb",
"chars": 592,
"preview": "SectionTemplate.find_or_create_by(:name => \"Generic Wireless Alarm System\") do |st|\nst.sections = \"name,start_pos,end_po"
},
{
"path": "lib/assets/.keep",
"chars": 0,
"preview": ""
},
{
"path": "lib/tasks/.keep",
"chars": 0,
"preview": ""
},
{
"path": "lib/tasks/account_seeds.rake",
"chars": 259,
"preview": "namespace :dspectrum do\n\ttask :accounts => :environment do\n\n\t\t#####\n\t\t# User\n\t\t####\n\n\t\tputs \"[!] Seeding user\"\n\n\t\tu = U"
}
]
// ... and 67 more files (download for full content)
About this extraction
This page contains the full source code of the tresacton/dspectrumgui GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 267 files (274.5 KB), approximately 79.7k tokens, and a symbol index with 114 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.