From 6a7de5a27b4eb7a0c9e57e7d41944d12b9b517c7 Mon Sep 17 00:00:00 2001 From: LagradOst Date: Tue, 7 Sep 2021 21:16:12 +0200 Subject: [PATCH] bump + legal notice --- app/build.gradle | 4 ++-- .../lagradost/cloudstream3/MainActivity.kt | 12 +++++++++- .../ui/settings/SettingsFragment.kt | 10 ++++++++ .../cloudstream3/utils/ExtensionManager.kt | 24 +++++++++---------- .../res/drawable/ic_baseline_warning_24.xml | 5 ++++ app/src/main/res/values/strings.xml | 13 ++++++++++ app/src/main/res/xml/settings.xml | 6 +++++ 7 files changed, 59 insertions(+), 15 deletions(-) create mode 100644 app/src/main/res/drawable/ic_baseline_warning_24.xml diff --git a/app/build.gradle b/app/build.gradle index 44091bcd..94fcf99d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,8 +31,8 @@ android { applicationId "com.lagradost.cloudstream3" minSdkVersion 21 targetSdkVersion 30 - versionCode 19 - versionName "1.7.5" + versionCode 20 + versionName "1.7.6" resValue "string", "app_version", "${defaultConfig.versionName}${versionNameSuffix ?: ""}" diff --git a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt index 3e02827d..869c4b9c 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/MainActivity.kt @@ -389,11 +389,21 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener { try { val settingsManager = PreferenceManager.getDefaultSharedPreferences(this) val count = settingsManager.getInt(getString(R.string.benene_count), 0) - if (count > 30) + if (count > 30 && restrictedApis.size > 0 && !apis.contains(restrictedApis.first())) apis.addAll(restrictedApis) } catch (e: Exception) { e.printStackTrace() } +/* + val relativePath = (Environment.DIRECTORY_DOWNLOADS) + File.separatorChar + val displayName = "output.dex" //""output.dex" + val file = getExternalFilesDir(null)?.absolutePath + File.separatorChar + displayName//"${Environment.getExternalStorageDirectory()}${File.separatorChar}$relativePath$displayName" + println(file) + val realFile = File(file) + println("REAALFILE: ${realFile.exists()} at ${realFile.length()}" ) + val src = ExtensionManager.getSourceFromDex(this, "com.example.testdex2.TestClassToDex", File(file)) + val output = src?.doMath() + println("MASTER OUTPUT = $output")*/ } } \ No newline at end of file diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt index b9a3d99b..ba086618 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsFragment.kt @@ -2,6 +2,7 @@ package com.lagradost.cloudstream3.ui.settings import android.os.Bundle import android.widget.Toast +import androidx.appcompat.app.AlertDialog import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceManager @@ -39,6 +40,15 @@ class SettingsFragment : PreferenceFragmentCompat() { val localePreference = findPreference(getString(R.string.locale_key))!! val benenePreference = findPreference(getString(R.string.benene_count))!! val watchQualityPreference = findPreference(getString(R.string.quality_pref_key))!! + val legalPreference = findPreference(getString(R.string.legal_notice_key))!! + + legalPreference.setOnPreferenceClickListener { + val builder: AlertDialog.Builder = AlertDialog.Builder(it.context) + builder.setTitle(R.string.legal_notice) + builder.setMessage(R.string.legal_notice_text) + builder.show() + return@setOnPreferenceClickListener true + } watchQualityPreference.setOnPreferenceClickListener { val prefNames = resources.getStringArray(R.array.quality_pref) diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/ExtensionManager.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/ExtensionManager.kt index c4e48536..497c72c1 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/ExtensionManager.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/ExtensionManager.kt @@ -1,23 +1,23 @@ package com.lagradost.cloudstream3.utils +/* import android.content.Context import dalvik.system.PathClassLoader import java.io.File - -class ExtensionManager { - interface TestSource { - fun doMath(): Int +open class TestSource { + open fun doMath(): Int { + return 33 } - +} +object ExtensionManager { fun getSourceFromDex(context: Context, pkgName: String, file: File): TestSource? { - val loader = PathClassLoader(file.absolutePath, null, context.classLoader) - var source: TestSource? = null + val loader = PathClassLoader(file.absolutePath, context.classLoader) - source = when (val obj = Class.forName(pkgName, false, loader).newInstance()) { - is TestSource -> obj - else -> null + val obj = Class.forName(pkgName, false, loader).newInstance() + if (obj is TestSource) { + println("MATH : ${obj.doMath()}") } - return source + return null } -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_baseline_warning_24.xml b/app/src/main/res/drawable/ic_baseline_warning_24.xml new file mode 100644 index 00000000..3c9a4b35 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_warning_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4e10a06b..cec9a6f4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -243,4 +243,17 @@ Don\'t show again Update Preferred watch quality + + Legal Notice + legal_notice_key + Any legal issues regarding the content on this application should be taken up with the actual file hosts and providers themselves as we are not affiliated with them. + + In case of copyright infringement, please directly contact the responsible parties or the streaming websites. + + The app is purely for educational and personal use. + + CloudStream 3 does not host any content on the app, and has no control over what media is put up or taken down. CloudStream 3 functions like any other search engine, such as Google. CloudStream 3 does not host, upload or manage any videos, films or content. It simply crawls, aggregates and displayes links in a convenient, user-friendly interface. + + It merely scrapes 3rd-party websites that are publicly accessable via any regular web browser. It is the responsibility of user to avoid any actions that might violate the laws governing his/her locality. Use CloudStream 3 at your own risk. + diff --git a/app/src/main/res/xml/settings.xml b/app/src/main/res/xml/settings.xml index 13c3964f..e77fc4bc 100644 --- a/app/src/main/res/xml/settings.xml +++ b/app/src/main/res/xml/settings.xml @@ -81,6 +81,12 @@ android:title="@string/settings_info" app:isPreferenceVisible="true" > + + +