24
1
Fork 0

Merge remote-tracking branch 'origin/vnext' into sw

This commit is contained in:
Danny Coates 2018-07-13 12:22:13 -07:00
commit 3a8172fa63
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
9 changed files with 1044 additions and 433 deletions

View File

@ -42,7 +42,7 @@
</option>
<option name="pluginClasspaths">
<array>
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-android-extensions/1.2.30/680ff8d567db8dec157cd9344f0a1d2b5e4d651b/kotlin-android-extensions-1.2.30.jar" />
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-android-extensions/1.2.50/a5309d96fd097320a75947d2e9673a86c948f605/kotlin-android-extensions-1.2.50.jar" />
</array>
</option>
</compilerArguments>
@ -149,31 +149,32 @@
<orderEntry type="library" name="Gradle: com.android.support:support-annotations:27.1.1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:animated-vector-drawable-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-compat-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.50@jar" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:viewmodel-1.1.0" level="project" />
<orderEntry type="library" name="Gradle: com.android.support.constraint:constraint-layout-solver:1.1.0@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.squareup:javawriter:2.1.1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-vector-drawable-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-core-ui-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: com.android.support.constraint:constraint-layout-1.1.2" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-common:1.2.50@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-core-utils-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.2.50@jar" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains:annotations:13.0@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.google.code.findbugs:jsr305:2.0.1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.github.delight-im:Android-AdvancedWebView-v3.0.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test.espresso:espresso-core-3.0.2" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: javax.inject:javax.inject:1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-fragment-27.1.1" level="project" />
<orderEntry type="library" name="Gradle: com.android.support.constraint:constraint-layout-1.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: junit:junit:4.12@jar" level="project" />
<orderEntry type="library" name="Gradle: android.arch.core:runtime-1.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-core:1.3@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test:monitor-1.0.2" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:appcompat-v7-27.1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test.espresso:espresso-idling-resource-3.0.2" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.2.30@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support.constraint:constraint-layout-solver:1.1.2@jar" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:livedata-core-1.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-library:1.3@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-integration:1.3@jar" level="project" />
<orderEntry type="library" name="Gradle: android.arch.core:common:1.1.0@jar" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.30@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: net.sf.kxml:kxml2:2.3.0@jar" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:runtime-1.1.0" level="project" />
</component>

View File

@ -24,9 +24,9 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

View File

@ -3,6 +3,7 @@
package="com.mozilla.send.sendandroid">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
@ -17,8 +18,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".IntentActivity">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
@ -30,7 +29,6 @@
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -0,0 +1,188 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:title" content="Firefox Send"/>
<meta name="twitter:title" content="Firefox Send"/>
<meta name="description" content="Encrypt and send files with a link that automatically expires to ensure your important documents dont stay online forever."/>
<meta property="og:description" content="Encrypt and send files with a link that automatically expires to ensure your important documents dont stay online forever."/>
<meta name="twitter:description" content="Encrypt and send files with a link that automatically expires to ensure your important documents dont stay online forever."/>
<meta name="twitter:card" content="summary"/>
<meta property="og:image" content="https://send.firefox.com/send-fb.19274ff0.jpg"/>
<meta name="twitter:image" content="https://send.firefox.com/send-twitter.7d5e4200.jpg"/>
<meta property="og:url" content="https://send.firefox.com"/>
<base href="https://send.firefox.com/" />
<title>Firefox Send</title>
<link rel="stylesheet" type="text/css" href="/style.11428181.css" />
<!-- generic favicons -->
<link rel="icon" href="/favicon-32.4efdbe5a.png" sizes="32x32">
<link rel="icon" href="/favicon-96.a2ce7c6e.png" sizes="96x96">
<link rel="icon" href="/favicon-128.58447464.png" sizes="128x128">
<link rel="icon" href="/favicon-228.069d14fe.png" sizes="228x228">
<!-- Android -->
<link rel="shortcut icon" href="/favicon-196.55cef95d.png" sizes="196x196">
<!-- iOS -->
<link rel="apple-touch-icon" href="/favicon-120.a48a3fc0.png" sizes="120x120">
<link rel="apple-touch-icon" href="/favicon-152.10d8b941.png" sizes="152x152">
<link rel="apple-touch-icon" href="/favicon-180.373787f8.png" sizes="180x180">
<!-- Windows 8 IE 10-->
<meta name="msapplication-TileColor" content="#FFFFFF">
<meta name="msapplication-TileImage" content="/favicon-144.909cb064.png">
<!-- Windows 8.1 + IE11 and above -->
<meta name="msapplication-config" content="/browserconfig.xml"/>
<script defer src="/jsconfig.js"></script>
<script defer src="/runtime.44a28e7e.js"></script>
<script defer src="/vendor.ec5b5b1d.js"></script>
<script defer src="/public/locales/en-US/send.6b4f8354.js"></script>
<script defer src="/cryptofill.1315ac9e.js"></script>
<script defer src="/app.baa60a46.js"></script>
</head>
<body>
<header class="header">
<div class="logo">
<a class="logo__link" href="/">
<img
src="/send_logo.5fcfdf0e.svg"
alt="Send"/>
<h1 class="logo__title">Send</h1>
</a>
<div class="logo__subtitle">
<a class="logo__subtitle-link" href="https://testpilot.firefox.com">Firefox Test Pilot</a>
<div>web experiment</div>
</div>
</div>
<a href="https://qsurvey.mozilla.com/s3/txp-firefox-send?ver=2.5.4&amp;browser=unknown"
rel="noreferrer noopener"
class="feedback"
target="_blank">Feedback</a>
</header>
<main class="main">
<noscript>
<div class="noscript">
<h2>Firefox Send requires JavaScript</h2>
<p>
<a class="link" href="https://github.com/mozilla/send/blob/master/docs/faq.md#why-does-firefox-send-require-javascript">
Why does Firefox Send require JavaScript?
</a>
</p>
<p>Please enable JavaScript and try again.</p>
</div>
</noscript>
<div id="page-one" class="">
<div class="title">Private, Encrypted File Sharing</div>
<div class="description">
<div>Send files through a safe, private, and encrypted link that automatically expires to ensure your stuff does not remain online forever.</div>
<a
href="https://testpilot.firefox.com/experiments/send"
class="link">
Learn more
</a>
</div>
<div class="uploadArea"
>
<img
src="/upload.8e2a8bdb.svg"
title="Upload"/>
<div class="uploadArea__msg">
Drop your file here to start uploading
</div>
<span class="uploadArea__sizeMsg">
For the most reliable operation, its best to keep your file under 1GB
</span>
<input id="file-upload"
class="inputFile"
type="file"
name="fileUploaded"
/>
<label for="file-upload"
class="btn btn--file"
title="Select a file to upload">
Select a file to upload
</label>
</div>
</div>
</main>
<footer class="footer">
<div class="legalSection">
<a
href="https://www.mozilla.org"
class="legalSection__link"
role="presentation">
<img
class="legalSection__mozLogo"
src="/mozilla-logo.2538e7d3.svg"
alt="mozilla"/>
</a>
<a
href="https://www.mozilla.org/about/legal"
class="legalSection__link">
Legal
</a>
<a
href="https://testpilot.firefox.com/about"
class="legalSection__link">
About Test Pilot
</a>
<a
href="/legal"
class="legalSection__link">Privacy</a>
<a
href="/legal"
class="legalSection__link">Terms</a>
<a
href="https://www.mozilla.org/privacy/websites/#cookies"
class="legalSection__link">
Cookies
</a>
<a
href="https://www.mozilla.org/about/legal/report-infringement/"
class="legalSection__link">
Report IP Infringement
</a>
</div>
<div class="socialSection">
<a
href="https://github.com/mozilla/send"
class="socialSection__link"
role="presentation">
<img
class="socialSection__icon"
src="/github-icon.74dc24f7.svg"
alt="github"/>
</a>
<a
href="https://twitter.com/FxTestPilot"
class="socialSection__link"
role="presentation">
<img
class="socialSection__icon"
src="/twitter-icon.018c7f54.svg"
alt="twitter"/>
</a>
</div>
</footer>
</body>
</html>

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Firefox Send</title>
</head>
<body>
<div id="output">output</div>
<script>
window.addEventListener("message", (event) => {
fetch(event.data).then(res => res.text()).then(txt => {
document.getElementById('output').textContent = "GOT MESSAGE" + txt;
});
}, false);
</script>
</body>
</html>

View File

@ -1,28 +0,0 @@
package com.mozilla.send.sendandroid
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.content.Intent
import android.util.Log
import android.net.Uri
class IntentActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val intent = getIntent()
val action = intent.getAction()
val type = intent.getType()
if (Intent.ACTION_SEND.equals(action) && type != null) {
if ("text/plain".equals(type)) {
val sharedText = intent.getStringExtra(Intent.EXTRA_TEXT)
Log.w("INTENT", "text/plain " + sharedText);
} else if (type.startsWith("image/")) {
val imageUri = intent.getParcelableExtra(Intent.EXTRA_STREAM) as Uri
Log.w("INTENT", "image/ " + imageUri);
}
}
}
}

View File

@ -7,11 +7,23 @@ import im.delight.android.webview.AdvancedWebView
import android.graphics.Bitmap
import android.content.Intent
import android.annotation.SuppressLint
import android.net.Uri
import android.webkit.WebView
import android.webkit.WebMessage
import android.util.Log
import android.util.Base64
import android.provider.MediaStore
import android.R.attr.data
class MainActivity : AppCompatActivity(), AdvancedWebView.Listener {
private var mWebView: AdvancedWebView? = null
private var mToShare: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@ -23,7 +35,28 @@ class MainActivity : AppCompatActivity(), AdvancedWebView.Listener {
val webSettings = mWebView!!.getSettings()
webSettings.setJavaScriptEnabled(true)
mWebView!!.loadUrl("https://send.firefox.com")
val intent = getIntent()
val action = intent.getAction()
val type = intent.getType()
if (Intent.ACTION_SEND.equals(action) && type != null) {
if (type.equals("text/plain")) {
val sharedText = intent.getStringExtra(Intent.EXTRA_TEXT)
Log.w("INTENT", "text/plain " + sharedText)
mToShare = "data:text/plain;base64," + Base64.encodeToString(sharedText.toByteArray(), 16).trim()
} else if (type.startsWith("image/")) {
val imageUri = intent.getParcelableExtra(Intent.EXTRA_STREAM) as Uri
Log.w("INTENT", "image/ " + imageUri)
mToShare = "data:text/plain;base64," + Base64.encodeToString(imageUri.path.toByteArray(), 16).trim()
// TODO Currently this causes a Permission Denied error
// val stream = contentResolver.openInputStream(imageUri)
}
mWebView!!.loadUrl("file:///android_asset/intent-target.html")
} else {
mWebView!!.loadUrl("file:///android_asset/index.html")
}
}
@SuppressLint("NewApi")
@ -66,6 +99,13 @@ class MainActivity : AppCompatActivity(), AdvancedWebView.Listener {
override fun onPageFinished(url: String) {
Log.w("MAIN", "onPageFinished")
if (mToShare != null) {
Log.w("INTENT", mToShare)
val webView = findViewById<WebView>(R.id.webview) as AdvancedWebView
webView.postWebMessage(WebMessage(mToShare), Uri.EMPTY)
}
}
override fun onPageError(errorCode: Int, description: String, failingUrl: String) {

View File

@ -1,13 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.30'
ext.kotlin_version = '1.2.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong

1176
package-lock.json generated

File diff suppressed because it is too large Load Diff