Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eastebry committed Jun 13, 2013
0 parents commit b1f7bbe
Show file tree
Hide file tree
Showing 32 changed files with 1,473 additions and 0 deletions.
59 changes: 59 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.cirg.kioskbrowser"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="11" />
<uses-permission android:name = "android.permission.INTERNET"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name="org.cirg.kioskbrowser.KioskActivity"
android:launchMode="singleTask"
android:label="@string/app_name"
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.Holo.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- set password activity -->
<activity
android:name="org.cirg.kioskbrowser.auth.SetPasswordActivity"
android:exported="false"
android:label="@string/title_set_password_activity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.cirg.kioksbrowser.KioskActivity"/>
</activity>
<!-- admin access activity -->
<activity
android:name="org.cirg.kioskbrowser.admin.AdminActivity"
android:exported="false"
android:label="@string/admin_access">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.cirg.kioksbrowser.KioskActivity"/>
</activity>

<!-- make an activity alias to enable/disable the kiosk mode
TODO this mode on and off is currently not supported
-->
<activity-alias
android:enabled="true"
android:name="org.cirg.kioskbrowser.KioskMode"
android:exported="false"
android:targetActivity="org.cirg.kioskbrowser.KioskActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</activity-alias>
</application>

</manifest>
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Android Kiosk Browser
====================

This application allows for kiosk-mode web browsing, intended for
use with CIRG's PRO systems. This application runs on top of the lock
screen and catches home screen intents.

13 changes: 13 additions & 0 deletions assets/authfailed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Auth Failed</title>
<link rel="stylesheet" media="all" href="noconfig.css"/>
</head>
<body>
<h1 id="header">Authorization failed</h1>
<div id="info">
<p> Press back to reload the page. </p>
</div>
</body>
</html>
20 changes: 20 additions & 0 deletions assets/host_lookup_fail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Setup</title>
<script type="text/javascript" src="android.js"></script>
<script type="text/javascript" src="host_lookup_fail.js"></script>
<link rel="stylesheet" media="all" href="noconfig.css"/>
</head>

<body>
<h1>Error: Host Lookup Failure</h1>
<p>Looks like the webpage you requested was not valid. Would you like
to reload the page, or go back to the previous page</p>
<button type="button" id="close_app">Close App</button>
<button type="button" id="reload">Reload Page</button>
</body>


</html>

10 changes: 10 additions & 0 deletions assets/host_lookup_fail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
window.onload = onLoad;

function onLoad(){
document.getElementById("close_app").onclick = closeApp;
document.getElementById("reload").onclick = reloadPage;
}

function goBack(){
navigateHistory(-2);
}
13 changes: 13 additions & 0 deletions assets/noPassword.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Setup</title>
<link rel="stylesheet" media="all" href="noconfig.css"/>
</head>
<body>
<h1 id="header">No kiosk password set.</h1>
<div id="info">
<p> It looks like this is your first time starting this app. Hold down the back button to set your password.</p>
</div>
</body>
</html>
22 changes: 22 additions & 0 deletions assets/noconfig.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
body {
text-align: center;
background:#e4ebf1;
line-height: 1.5em
}

html {
font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;
color: #333
}

#info{
text-align: left;
margin: auto;
border: 2px solid black;
width: 60%;
padding: 10px;
}
#info.option{
text-align: center;

}
16 changes: 16 additions & 0 deletions assets/noconfig.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<title>Setup</title>
<link rel="stylesheet" media="all" href="noconfig.css"/>
<script type="text/javascript" src="noconfig.js"></script>
</head>
<body>
<h1 id="header">No config file found</h1>
<div id="info">
<p> It looks like this is your first time starting this app. Please enter the URL of the config file you wish to use</p>
<textarea id="configURL" rows="10" cols="50"></textarea>
<button type="button" id="submit_button">Go</button>
</div>
</body>
</html>
22 changes: 22 additions & 0 deletions assets/noconfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

window.onload=onLoad;

function onLoad(){
document.getElementById("submit_button").onclick = createConfig;
}

function createConfig(){
var configFile = document.getElementById("configURL").value;
var xmlHttp = null;
try{
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET",configFile, false );
xmlHttp.send( null );
}
catch(err){
Android.log(err);
}
config_contents = xmlHttp.responseText;
Android.writeConfigFile(config_contents);
}

14 changes: 14 additions & 0 deletions config_files/example.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<config>
<allowed-sites>
<start-url>https://www.google.com</start-url>
<host-regex>^.*google\.com$</host-regex>
<host-regex>^.*slashdot.org$</host-regex>
<host-regex>^.*facebook.com$</host-regex>
</allowed-sites>
<script host-regex="^.*facebook.com.*$">
alert("Domain specific scripts are allowed as well");
</script>
</config>


20 changes: 20 additions & 0 deletions proguard-project.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
class:
-keepclassmembers class org.cirg.kioskbrowser.JavaScriptInterface{
public *;
}
15 changes: 15 additions & 0 deletions project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}\tools\proguard\proguard-android.txt:proguard-project.txt

# Project target.
target=android-14
android.library.reference.1=../../gridlayout_v7
Binary file added res/drawable-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-ldpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions res/layout/admin_tools.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:useDefaultMargins="false" >

<Button
android:id="@+id/continue_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/continue_browsing"
android:onClick="continueBrowsing" />

<Button
android:id="@+id/reset_config_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/reset_config"
android:onClick="resetConfig" />

<Button
android:id="@+id/set_password_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/set_password"
android:onClick="setPassword"/>

</LinearLayout>
18 changes: 18 additions & 0 deletions res/layout/auth_dialog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<EditText
android:id="@+id/auth_password"
android:inputType="textPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="16dp"
android:hint="@string/password"/>

</LinearLayout>
26 changes: 26 additions & 0 deletions res/layout/httpauth_dialog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<EditText
android:id="@+id/httpauth_username"
android:inputType="text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="16dp"
android:hint="@string/username"/>
<EditText
android:id="@+id/httpauth_password"
android:inputType="textPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="16dp"
android:hint="@string/password"/>
</LinearLayout>
17 changes: 17 additions & 0 deletions res/layout/main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
android:orientation="horizontal"
android:layout_width = "fill_parent"
android:layout_height= "fill_parent"
android:scaleType="center"
>
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
/>
</FrameLayout>

Loading

0 comments on commit b1f7bbe

Please sign in to comment.