Skip to content

Commit 0a2c32a

Browse files
committed
Initial commit
0 parents  commit 0a2c32a

File tree

21 files changed

+510
-0
lines changed

21 files changed

+510
-0
lines changed

.gitignore

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Built application files
2+
*.apk
3+
*.ap_
4+
5+
# Files for the ART/Dalvik VM
6+
*.dex
7+
8+
# Java class files
9+
*.class
10+
11+
# Generated files
12+
bin/
13+
gen/
14+
out/
15+
16+
# Gradle files
17+
.gradle/
18+
build/
19+
20+
# Local configuration file (sdk path, etc)
21+
local.properties
22+
23+
# Proguard folder generated by Eclipse
24+
proguard/
25+
26+
# Log Files
27+
*.log
28+
29+
# Android Studio Navigation editor temp files
30+
.navigation/
31+
32+
# Android Studio captures folder
33+
captures/
34+
35+
# IntelliJ
36+
*.iml
37+
.idea/workspace.xml
38+
.idea/tasks.xml
39+
.idea/gradle.xml
40+
.idea/assetWizardSettings.xml
41+
.idea/dictionaries
42+
.idea/libraries
43+
.idea/caches
44+
45+
# Keystore files
46+
# Uncomment the following line if you do not want to check your keystore files in.
47+
#*.jks
48+
49+
# External native build folder generated in Android Studio 2.2 and later
50+
.externalNativeBuild
51+
52+
# Google Services (e.g. APIs or Firebase)
53+
google-services.json
54+
55+
# Freeline
56+
freeline.py
57+
freeline/
58+
freeline_project_description.json
59+
60+
# fastlane
61+
fastlane/report.xml
62+
fastlane/Preview.html
63+
fastlane/screenshots
64+
fastlane/test_output
65+
fastlane/readme.md

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Daniel Bartoníček
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Android TV fake Netflix App
2+
Fake Android TV Netflix app to launch Plex using the "Netflix" button.

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 26
5+
defaultConfig {
6+
applicationId "com.netflix.ninja"
7+
minSdkVersion 26
8+
targetSdkVersion 26
9+
versionCode 1
10+
versionName "1.0"
11+
}
12+
buildTypes {
13+
release {
14+
minifyEnabled false
15+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
16+
}
17+
}
18+
}
19+
20+
dependencies {
21+
implementation fileTree(dir: 'libs', include: ['*.jar'])
22+
implementation 'com.android.support:leanback-v17:26.1.0'
23+
implementation 'com.android.support:appcompat-v7:26.1.0'
24+
implementation 'com.github.bumptech.glide:glide:3.8.0'
25+
}

app/src/main/AndroidManifest.xml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.netflix.ninja">
4+
5+
<uses-permission android:name="android.permission.INTERNET" />
6+
7+
<permission
8+
android:name="com.netflix.ninja.permission.NETFLIX_KEY"
9+
android:protectionLevel="signature" />
10+
11+
<uses-feature
12+
android:name="android.hardware.touchscreen"
13+
android:required="false" />
14+
<uses-feature
15+
android:name="android.software.leanback"
16+
android:required="false" />
17+
18+
<application
19+
android:allowBackup="true"
20+
android:icon="@mipmap/ic_launcher"
21+
android:label="@string/app_name"
22+
android:supportsRtl="true"
23+
android:theme="@style/Theme.Leanback">
24+
<activity
25+
android:name=".MainActivity"
26+
android:banner="@drawable/launcher_icon"
27+
android:icon="@drawable/launcher_icon"
28+
android:label="@string/app_name"
29+
android:logo="@drawable/launcher_icon"
30+
android:screenOrientation="landscape">
31+
<intent-filter>
32+
<action android:name="android.intent.action.MAIN" />
33+
34+
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
35+
<category android:name="android.intent.category.LAUNCHER" />
36+
</intent-filter>
37+
</activity>
38+
39+
<receiver
40+
android:name=".NetflixKeyReceiver"
41+
android:enabled="true"
42+
android:exported="true"
43+
android:permission="com.netflix.ninja.permission.NETFLIX_KEY">
44+
<intent-filter>
45+
<action android:name="com.netflix.ninja.intent.action.NETFLIX_KEY" />
46+
</intent-filter>
47+
</receiver>
48+
</application>
49+
50+
</manifest>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.netflix.ninja;
2+
3+
import android.app.Activity;
4+
import android.content.Intent;
5+
import android.os.Bundle;
6+
7+
/*
8+
* MainActivity class that loads {@link MainFragment}.
9+
*/
10+
public class MainActivity extends Activity {
11+
12+
@Override
13+
public void onCreate(Bundle savedInstanceState) {
14+
super.onCreate(savedInstanceState);
15+
16+
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.plexapp.android");
17+
if (launchIntent != null) {
18+
startActivity(launchIntent);//null pointer check in case package name was not found
19+
}
20+
finish();
21+
}
22+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.netflix.ninja;
2+
3+
import android.content.BroadcastReceiver;
4+
import android.content.Context;
5+
import android.content.Intent;
6+
import android.content.pm.PackageManager;
7+
import android.widget.Toast;
8+
9+
public class NetflixKeyReceiver extends BroadcastReceiver {
10+
11+
@Override
12+
public void onReceive(Context context, Intent intent) {
13+
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage("com.plexapp.android");
14+
if (launchIntent != null) {
15+
context.startActivity(launchIntent);
16+
} else {
17+
Toast.makeText(context, "Unable to launch Plex!", Toast.LENGTH_SHORT).show();
18+
}
19+
}
20+
}
1.06 KB
Loading
3.34 KB
Loading

0 commit comments

Comments
 (0)