-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
1,284 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
plugins { | ||
id 'com.android.application' | ||
} | ||
|
||
android { | ||
compileSdk 31 | ||
|
||
defaultConfig { | ||
applicationId "com.aron.webdemo" | ||
minSdk 28 | ||
targetSdk 31 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_11 | ||
targetCompatibility JavaVersion.VERSION_11 | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation 'androidx.appcompat:appcompat:1.4.1' | ||
implementation 'com.google.android.material:material:1.5.0' | ||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3' | ||
implementation 'androidx.browser:browser:1.4.0' | ||
testImplementation 'junit:junit:4.13.2' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.3' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' | ||
|
||
// WS1 Intelligence SDK (compile directive is deprecated; use implementation instead) | ||
implementation 'com.crittercism:crittercism-android-agent:+' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# 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 *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile | ||
|
||
# WS1 Intelligence | ||
-dontwarn com.crittercism.** | ||
-keep public class com.crittercism.** | ||
-keepclassmembers public class com.crittercism.** | ||
{ | ||
*; | ||
} |
26 changes: 26 additions & 0 deletions
26
app/src/androidTest/java/com/aron/webdemo/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.aron.webdemo; | ||
|
||
import android.content.Context; | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry; | ||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented 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() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); | ||
assertEquals("com.aron.webdemo", appContext.getPackageName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.aron.webdemo"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
|
||
<queries> | ||
<intent> | ||
<action android:name="android.support.customtabs.action.CustomTabsService" /> | ||
</intent> | ||
<intent> | ||
<action android:name="android.intent.action.VIEW" /> | ||
<data android:scheme="http" /> | ||
</intent> | ||
<intent> | ||
<action android:name="android.intent.action.VIEW" /> | ||
<data android:scheme="https" /> | ||
</intent> | ||
</queries> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/Theme.WebDemo"> | ||
<activity | ||
android:name=".MainActivity" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity | ||
android:name=".WebViewActivity" | ||
android:label="@string/title_activity_webview" | ||
android:parentActivityName=".MainActivity"> | ||
<meta-data | ||
android:name="android.support.PARENT_ACTIVITY" | ||
android:value=".MainActivity" /> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.aron.webdemo; | ||
|
||
import android.content.Context; | ||
import android.content.RestrictionsManager; | ||
import android.os.Bundle; | ||
|
||
|
||
public class AppConfig { | ||
private static final String INTELLIGENCE_APP_ID = "INTELLIGENCE_APP_ID"; | ||
private static final String INTELLIGENCE_APP_LOGGING_LEVEL = "INTELLIGENCE_APP_LOGGING_LEVEL"; | ||
private static final String ENROLLMENT_USERNAME = "ENROLLMENT_USERNAME"; | ||
private static final String URL = "URL"; | ||
|
||
private String intelligenceAppId; | ||
private String intelligenceAppLoggingLevel; | ||
private String enrollmentUsername; | ||
private String url; | ||
|
||
|
||
public AppConfig(Context context) { | ||
RestrictionsManager restrictionsManager = (RestrictionsManager) context.getSystemService(Context.RESTRICTIONS_SERVICE); | ||
Bundle appRestrictions = restrictionsManager.getApplicationRestrictions(); | ||
getApplicationRestrictions(appRestrictions); | ||
} | ||
|
||
private void getApplicationRestrictions(Bundle appRestrictions) { | ||
if (appRestrictions.containsKey(INTELLIGENCE_APP_ID)) { | ||
intelligenceAppId = appRestrictions.getString(INTELLIGENCE_APP_ID); | ||
} | ||
|
||
if (appRestrictions.containsKey(INTELLIGENCE_APP_LOGGING_LEVEL)) { | ||
intelligenceAppLoggingLevel = appRestrictions.getString(INTELLIGENCE_APP_LOGGING_LEVEL); | ||
} | ||
|
||
if (appRestrictions.containsKey(ENROLLMENT_USERNAME)) { | ||
enrollmentUsername = appRestrictions.getString(ENROLLMENT_USERNAME); | ||
} | ||
|
||
if (appRestrictions.containsKey(URL)) { | ||
url = appRestrictions.getString(URL); | ||
} | ||
} | ||
|
||
public String getIntelligenceAppId() { | ||
return intelligenceAppId; | ||
} | ||
|
||
public String getIntelligenceAppLoggingLevel() { | ||
return intelligenceAppLoggingLevel; | ||
} | ||
|
||
public String getEnrollmentUsername() { | ||
return enrollmentUsername; | ||
} | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
} |
Oops, something went wrong.