Skip to content

Commit

Permalink
Deprecate xray and alice
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana committed Jun 29, 2017
1 parent 3d823bd commit db4a966
Show file tree
Hide file tree
Showing 861 changed files with 337,965 additions and 0 deletions.
661 changes: 661 additions & 0 deletions alice/COPYING-AGPLV3.txt

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions alice/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Alice
"I see nobody on the road", said Alice.

# Step 1 : Pre-Requisites
* Alice works with Xray Server. Set up Xray Server using [this guide](https://github.com/minio/xray).
* Download & Setup [Android Studio](https://developer.android.com/studio/index.html).

# Step 2 : Development Setup
* Clone this repo locally on your machine.
* Open Android Studio and open an existing android project. Alice android studio project file is available where you cloned the repo in the previous step.
* Run the app to deploy Alice on your android device.


71 changes: 71 additions & 0 deletions alice/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright (c) 2017 Minio, Inc. <https://www.minio.io>
*
* This file is part of Alice.
*
* Alice 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/>.
*
*/

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.minio.io.alice"
minSdkVersion 21

targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [HOCKEYAPP_APP_ID: "d9d896d94c214662bcc8f7c41d019a0b"]
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions{
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}

dependencies {
compile 'com.github.crossbario:autobahn-android:v0.5.2'
compile 'net.hockeyapp.android:HockeySDK:4.1.2'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.1'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
compile 'com.google.android.gms:play-services-vision:10.2.1'
testCompile 'junit:junit:4.12'
}
17 changes: 17 additions & 0 deletions alice/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/Upheus1/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# 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 fqcn.of.javascript.interface.for.webview {
# public *;
#}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2017 Minio, Inc. <https://www.minio.io>
*
* This file is part of Alice.
*
* Alice 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/>.
*
*/

package com.minio.io.alice;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.example.upheus1.xopencv", appContext.getPackageName());
}
}
72 changes: 72 additions & 0 deletions alice/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2017 Minio, Inc. <https://www.minio.io>
~
~ This file is part of Alice.
~
~ Alice 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/>.
~
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.minio.io.alice">

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />


<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature android:name="android.hardware.camera.front" />
<uses-feature android:name="android.hardware.camera.front.autofocus" />
<uses-feature android:name="android.hardware.location.gps" />


<application
android:allowBackup="true"
android:icon="@mipmap/ic_alice"
android:label="@string/app_name"
android:hardwareAccelerated="true"
android:supportsRtl="true"
android:largeHeap="true"
android:theme="@style/AppTheme">


<activity android:name=".MainActivity"
android:screenOrientation="fullSensor">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<receiver
android:name=".IncomingReceiver"
android:enabled="true"
android:exported="false">
<intent-filter>
<action android:name="com.minio.io.alice.xray_broadcast" >
</action>
</intent-filter>
</receiver>


//your activity declarations and other stuff
<meta-data android:name="net.hockeyapp.android.appIdentifier" android:value="${HOCKEYAPP_APP_ID}" />
</application>

</manifest>
79 changes: 79 additions & 0 deletions alice/app/src/main/java/com/minio/io/alice/AliceTask.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* Copyright (c) 2017 Minio, Inc. <https://www.minio.io>
*
* This file is part of Alice.
*
* Alice 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/>.
*
*/

package com.minio.io.alice;

import android.os.AsyncTask;
import android.util.Log;
import android.util.SparseArray;

import com.google.android.gms.vision.Frame;
import com.google.android.gms.vision.barcode.Barcode;
import com.google.android.gms.vision.face.Face;

/**
* AsyncTask that sends the video buffer over to the Xray Server.
*/

public class AliceTask extends AsyncTask<Void, Integer, String> {
byte[] binaryData;
String textData;
boolean textMessage;

public AliceTask(byte[] data) {
this.binaryData = data;
}

public AliceTask(String data) {
this.textMessage = true;
this.textData = data;
}

public AliceTask(Frame.Metadata metadata, SparseArray<Face> faces, SparseArray<Barcode> barcodes) {
this.textMessage = true;
this.textData = new FrameMetadata(metadata, faces, barcodes).toString();
}

@Override
protected void onPreExecute() {}

@Override
protected String doInBackground(Void ... params) {
if(MainActivity.webSocket == null) {
if (XDebug.LOG) {
Log.d(MainActivity.TAG, "Socket not connected");
}
return String.valueOf(R.string.COMPLETE);
}

if (textMessage)
MainActivity.webSocket.sendPayload(textData);
else
MainActivity.webSocket.sendPayload(binaryData);

return String.valueOf(R.string.COMPLETE);

}

@Override
protected void onCancelled() {}

protected void onPostExecute(String finish) {}
}
Loading

0 comments on commit db4a966

Please sign in to comment.