完成stb协议模拟
0 parents
Showing
51 changed files
with
1659 additions
and
0 deletions
.gitignore
0 → 100644
.idea/.gitignore
0 → 100644
.idea/compiler.xml
0 → 100644
.idea/deploymentTargetSelector.xml
0 → 100644
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <project version="4"> | ||
3 | <component name="deploymentTargetSelector"> | ||
4 | <selectionStates> | ||
5 | <SelectionState runConfigName="app"> | ||
6 | <option name="selectionMode" value="DROPDOWN" /> | ||
7 | </SelectionState> | ||
8 | </selectionStates> | ||
9 | </component> | ||
10 | </project> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
.idea/gradle.xml
0 → 100644
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <project version="4"> | ||
3 | <component name="GradleMigrationSettings" migrationVersion="1" /> | ||
4 | <component name="GradleSettings"> | ||
5 | <option name="linkedExternalProjectsSettings"> | ||
6 | <GradleProjectSettings> | ||
7 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> | ||
8 | <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> | ||
9 | <option name="modules"> | ||
10 | <set> | ||
11 | <option value="$PROJECT_DIR$" /> | ||
12 | <option value="$PROJECT_DIR$/app" /> | ||
13 | </set> | ||
14 | </option> | ||
15 | <option name="resolveExternalAnnotations" value="false" /> | ||
16 | </GradleProjectSettings> | ||
17 | </option> | ||
18 | </component> | ||
19 | </project> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
.idea/migrations.xml
0 → 100644
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <project version="4"> | ||
3 | <component name="ProjectMigrations"> | ||
4 | <option name="MigrateToGradleLocalJavaHome"> | ||
5 | <set> | ||
6 | <option value="$PROJECT_DIR$" /> | ||
7 | </set> | ||
8 | </option> | ||
9 | </component> | ||
10 | </project> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
.idea/misc.xml
0 → 100644
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <project version="4"> | ||
3 | <component name="ASMSmaliIdeaPluginConfiguration"> | ||
4 | <asm skipDebug="true" skipFrames="true" skipCode="false" expandFrames="false" /> | ||
5 | <groovy codeStyle="LEGACY" /> | ||
6 | </component> | ||
7 | <component name="ExternalStorageConfigurationManager" enabled="true" /> | ||
8 | <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> | ||
9 | <output url="file://$PROJECT_DIR$/build/classes" /> | ||
10 | </component> | ||
11 | <component name="ProjectType"> | ||
12 | <option name="id" value="Android" /> | ||
13 | </component> | ||
14 | </project> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
app/.gitignore
0 → 100644
1 | /build | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
app/build.gradle
0 → 100644
1 | plugins { | ||
2 | alias(libs.plugins.android.application) | ||
3 | } | ||
4 | |||
5 | android { | ||
6 | namespace 'com.topdraw.iptvlaunchertest' | ||
7 | compileSdk 34 | ||
8 | |||
9 | defaultConfig { | ||
10 | applicationId "com.topdraw.iptvlaunchertest" | ||
11 | minSdk 21 | ||
12 | targetSdk 34 | ||
13 | versionCode 1 | ||
14 | versionName "1.0" | ||
15 | |||
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
17 | } | ||
18 | |||
19 | buildTypes { | ||
20 | release { | ||
21 | minifyEnabled false | ||
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
23 | } | ||
24 | } | ||
25 | compileOptions { | ||
26 | sourceCompatibility JavaVersion.VERSION_1_8 | ||
27 | targetCompatibility JavaVersion.VERSION_1_8 | ||
28 | } | ||
29 | |||
30 | buildFeatures{ | ||
31 | buildConfig true | ||
32 | } | ||
33 | flavorDimensions 'APP' | ||
34 | productFlavors{ | ||
35 | chongqing{ | ||
36 | dimension 'APP' | ||
37 | } | ||
38 | } | ||
39 | } | ||
40 | |||
41 | dependencies { | ||
42 | |||
43 | implementation libs.appcompat | ||
44 | implementation libs.material | ||
45 | implementation libs.activity | ||
46 | implementation libs.constraintlayout | ||
47 | testImplementation libs.junit | ||
48 | androidTestImplementation libs.ext.junit | ||
49 | androidTestImplementation libs.espresso.core | ||
50 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
app/proguard-rules.pro
0 → 100644
1 | # Add project specific ProGuard rules here. | ||
2 | # You can control the set of applied configuration files using the | ||
3 | # proguardFiles setting in build.gradle. | ||
4 | # | ||
5 | # For more details, see | ||
6 | # http://developer.android.com/guide/developing/tools/proguard.html | ||
7 | |||
8 | # If your project uses WebView with JS, uncomment the following | ||
9 | # and specify the fully qualified class name to the JavaScript interface | ||
10 | # class: | ||
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
12 | # public *; | ||
13 | #} | ||
14 | |||
15 | # Uncomment this to preserve the line number information for | ||
16 | # debugging stack traces. | ||
17 | #-keepattributes SourceFile,LineNumberTable | ||
18 | |||
19 | # If you keep the line number information, uncomment this to | ||
20 | # hide the original source file name. | ||
21 | #-renamesourcefileattribute SourceFile | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | package com.topdraw.iptvlaunchertest; | ||
2 | |||
3 | import android.content.Context; | ||
4 | |||
5 | import androidx.test.platform.app.InstrumentationRegistry; | ||
6 | import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
7 | |||
8 | import org.junit.Test; | ||
9 | import org.junit.runner.RunWith; | ||
10 | |||
11 | import static org.junit.Assert.*; | ||
12 | |||
13 | /** | ||
14 | * Instrumented test, which will execute on an Android device. | ||
15 | * | ||
16 | * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
17 | */ | ||
18 | @RunWith(AndroidJUnit4.class) | ||
19 | public class ExampleInstrumentedTest { | ||
20 | @Test | ||
21 | public void useAppContext() { | ||
22 | // Context of the app under test. | ||
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); | ||
24 | assertEquals("com.topdraw.iptvlaunchertest", appContext.getPackageName()); | ||
25 | } | ||
26 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
app/src/main/AndroidManifest.xml
0 → 100644
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:tools="http://schemas.android.com/tools"> | ||
4 | |||
5 | <uses-permission android:name="android.permission.INSTALL_PACKAGES"/> | ||
6 | <uses-permission android:name="android.permission.DELETE_PACKAGES"/> | ||
7 | <uses-permission android:name="android.permission.INTERNET"/> | ||
8 | <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> | ||
9 | <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | ||
10 | |||
11 | <application | ||
12 | android:allowBackup="true" | ||
13 | android:dataExtractionRules="@xml/data_extraction_rules" | ||
14 | android:fullBackupContent="@xml/backup_rules" | ||
15 | android:icon="@mipmap/ic_launcher" | ||
16 | android:label="@string/app_name" | ||
17 | android:roundIcon="@mipmap/ic_launcher_round" | ||
18 | android:supportsRtl="true" | ||
19 | android:theme="@style/Theme.IPTVLauncherTest" | ||
20 | tools:targetApi="31"> | ||
21 | <activity | ||
22 | android:name=".MainActivity" | ||
23 | android:exported="true"> | ||
24 | <intent-filter> | ||
25 | <action android:name="android.intent.action.MAIN" /> | ||
26 | |||
27 | <category android:name="android.intent.category.LAUNCHER" /> | ||
28 | </intent-filter> | ||
29 | </activity> | ||
30 | </application> | ||
31 | |||
32 | </manifest> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | package com.topdraw.iptvlaunchertest; | ||
2 | |||
3 | import android.content.Context; | ||
4 | import android.content.pm.PackageInfo; | ||
5 | import android.content.pm.PackageManager; | ||
6 | import android.os.Build; | ||
7 | import android.util.Log; | ||
8 | import java.io.BufferedReader; | ||
9 | import java.io.IOException; | ||
10 | import java.io.InputStream; | ||
11 | import java.io.InputStreamReader; | ||
12 | import java.io.OutputStream; | ||
13 | import java.util.ArrayList; | ||
14 | import java.util.List; | ||
15 | |||
16 | /* loaded from: classes-dex2jar.jar:com/iflytek/xirihelpersupervisor/util/ApkTool.class */ | ||
17 | public class ApkTool { | ||
18 | private static final String TAG = "ApkTool"; | ||
19 | private ApkTool28 mApkTool28; | ||
20 | private boolean mIsInstallApk; | ||
21 | |||
22 | public static boolean apkInstalled(Context context, String str) { | ||
23 | PackageInfo packageInfo; | ||
24 | boolean z = false; | ||
25 | try { | ||
26 | packageInfo = context.getPackageManager().getPackageInfo(str, 0); | ||
27 | } catch (PackageManager.NameNotFoundException e) { | ||
28 | packageInfo = null; | ||
29 | } | ||
30 | if (packageInfo != null) { | ||
31 | z = true; | ||
32 | } | ||
33 | return z; | ||
34 | } | ||
35 | |||
36 | public boolean execCommand(String str) { | ||
37 | Process process = null; | ||
38 | try { | ||
39 | Process process2 = null; | ||
40 | process = null; | ||
41 | try { | ||
42 | Process exec = Runtime.getRuntime().exec(str); | ||
43 | String readInputStream = readInputStream(exec.getErrorStream()); | ||
44 | String readInputStream2 = readInputStream(exec.getInputStream()); | ||
45 | exec.waitFor(); | ||
46 | if (!readInputStream2.contains("Success")) { | ||
47 | process = exec; | ||
48 | process2 = exec; | ||
49 | if (readInputStream.contains("Failure")) { | ||
50 | if (exec == null) { | ||
51 | return false; | ||
52 | } | ||
53 | try { | ||
54 | exec.destroy(); | ||
55 | return false; | ||
56 | } catch (Exception e) { | ||
57 | return false; | ||
58 | } | ||
59 | } else if (exec == null) { | ||
60 | return false; | ||
61 | } else { | ||
62 | try { | ||
63 | exec.destroy(); | ||
64 | return false; | ||
65 | } catch (Exception e2) { | ||
66 | return false; | ||
67 | } | ||
68 | } | ||
69 | } else if (exec == null) { | ||
70 | return true; | ||
71 | } else { | ||
72 | try { | ||
73 | exec.destroy(); | ||
74 | return true; | ||
75 | } catch (Exception e3) { | ||
76 | return true; | ||
77 | } | ||
78 | } | ||
79 | } catch (Exception e4) { | ||
80 | e4.printStackTrace(); | ||
81 | if (process2 == null) { | ||
82 | return false; | ||
83 | } | ||
84 | try { | ||
85 | process2.destroy(); | ||
86 | return false; | ||
87 | } catch (Exception e5) { | ||
88 | return false; | ||
89 | } | ||
90 | } | ||
91 | } catch (Throwable th) { | ||
92 | if (process != null) { | ||
93 | try { | ||
94 | process.destroy(); | ||
95 | } catch (Exception e6) { | ||
96 | } | ||
97 | } | ||
98 | throw th; | ||
99 | } | ||
100 | } | ||
101 | |||
102 | public boolean execute(String str) { | ||
103 | Throwable th; | ||
104 | OutputStream outputStream = null; | ||
105 | Exception e; | ||
106 | Process process; | ||
107 | try { | ||
108 | outputStream = null; | ||
109 | str = null; | ||
110 | outputStream = null; | ||
111 | } catch (Throwable th2) { | ||
112 | th = th2; | ||
113 | } | ||
114 | try { | ||
115 | Process exec = Runtime.getRuntime().exec(str); | ||
116 | try { | ||
117 | OutputStream outputStream2 = exec.getOutputStream(); | ||
118 | outputStream = outputStream2; | ||
119 | exec.waitFor(); | ||
120 | CloseUtils.closeIO(outputStream2); | ||
121 | if (exec == null) { | ||
122 | return true; | ||
123 | } | ||
124 | exec.destroy(); | ||
125 | return true; | ||
126 | } catch (Exception e2) { | ||
127 | e = e2; | ||
128 | process = exec; | ||
129 | e.printStackTrace(); | ||
130 | CloseUtils.closeIO(outputStream); | ||
131 | if (process == null) { | ||
132 | return false; | ||
133 | } | ||
134 | process.destroy(); | ||
135 | return false; | ||
136 | } | ||
137 | } catch (Exception e3) { | ||
138 | e = e3; | ||
139 | process = null; | ||
140 | } catch (Throwable th3) { | ||
141 | Process process2 = null; | ||
142 | if (0 != 0) { | ||
143 | process2.destroy(); | ||
144 | } | ||
145 | throw th3; | ||
146 | } | ||
147 | return false; | ||
148 | } | ||
149 | |||
150 | private String readInputStream(InputStream inputStream) { | ||
151 | InputStreamReader inputStreamReader = new InputStreamReader(inputStream); | ||
152 | BufferedReader bufferedReader = new BufferedReader(inputStreamReader); | ||
153 | String str = BuildConfig.FLAVOR; | ||
154 | while (true) { | ||
155 | try { | ||
156 | try { | ||
157 | String readLine = bufferedReader.readLine(); | ||
158 | if (readLine == null) { | ||
159 | break; | ||
160 | } | ||
161 | str = str + readLine; | ||
162 | } catch (IOException e) { | ||
163 | e.printStackTrace(); | ||
164 | CloseUtils.closeIOQuietly(bufferedReader, inputStreamReader, inputStream); | ||
165 | } | ||
166 | } catch (Throwable th) { | ||
167 | CloseUtils.closeIOQuietly(bufferedReader, inputStreamReader, inputStream); | ||
168 | throw th; | ||
169 | } | ||
170 | } | ||
171 | CloseUtils.closeIOQuietly(bufferedReader, inputStreamReader, inputStream); | ||
172 | return str; | ||
173 | } | ||
174 | |||
175 | public List<String> getInstalledApk() { | ||
176 | List<PackageInfo> installedPackages = App.getInstance().getPackageManager().getInstalledPackages(0); | ||
177 | ArrayList arrayList = new ArrayList(5); | ||
178 | for (PackageInfo packageInfo : installedPackages) { | ||
179 | if ((packageInfo.applicationInfo.flags & 1) == 0) { | ||
180 | arrayList.add(packageInfo.packageName); | ||
181 | } | ||
182 | } | ||
183 | return arrayList; | ||
184 | } | ||
185 | |||
186 | public boolean isInstalling() { | ||
187 | return this.mIsInstallApk; | ||
188 | } | ||
189 | |||
190 | public boolean isPkgInstalled(String str) { | ||
191 | for (String str2 : getInstalledApk()) { | ||
192 | if (str2.equals(str)) { | ||
193 | return true; | ||
194 | } | ||
195 | } | ||
196 | return false; | ||
197 | } | ||
198 | |||
199 | public boolean silentInstall(String str) { | ||
200 | Log.d(TAG, "silentInstall SDK_INT: " + Build.VERSION.SDK_INT); | ||
201 | if (Build.VERSION.SDK_INT >= 28) { | ||
202 | if (this.mApkTool28 == null) { | ||
203 | this.mApkTool28 = new ApkTool28(); | ||
204 | } | ||
205 | this.mIsInstallApk = true; | ||
206 | boolean install28 = this.mApkTool28.install28(str); | ||
207 | this.mIsInstallApk = false; | ||
208 | return install28; | ||
209 | } | ||
210 | this.mIsInstallApk = true; | ||
211 | execute("chmod 777 " + str + " \n"); | ||
212 | boolean execCommand = execCommand("/system/bin/pm install -r " + str + "\n"); | ||
213 | boolean z = execCommand; | ||
214 | if (!execCommand) { | ||
215 | execute("chmod 666 " + str + " \n"); | ||
216 | z = execCommand("/system/bin/pm install -m -r " + str + "\n"); | ||
217 | } | ||
218 | boolean z2 = z; | ||
219 | if (!z) { | ||
220 | execute("chmod 777 " + str + " \n"); | ||
221 | z2 = execCommand("/system/bin/pm install -r --vendor OVT " + str + "\n"); | ||
222 | } | ||
223 | this.mIsInstallApk = false; | ||
224 | return z2; | ||
225 | } | ||
226 | |||
227 | public void silentUninstall(String str) { | ||
228 | if (Build.VERSION.SDK_INT >= 28) { | ||
229 | if (this.mApkTool28 == null) { | ||
230 | this.mApkTool28 = new ApkTool28(); | ||
231 | } | ||
232 | this.mApkTool28.uninstall28(str); | ||
233 | return; | ||
234 | } | ||
235 | execCommand("/system/bin/pm uninstall " + str); | ||
236 | } | ||
237 | } | ||
238 |
1 | package com.topdraw.iptvlaunchertest; | ||
2 | |||
3 | import android.annotation.TargetApi; | ||
4 | import android.app.PendingIntent; | ||
5 | import android.content.Intent; | ||
6 | import android.content.pm.PackageInstaller; | ||
7 | import java.io.File; | ||
8 | import java.io.FileInputStream; | ||
9 | import java.io.IOException; | ||
10 | import java.io.OutputStream; | ||
11 | |||
12 | /* loaded from: classes-dex2jar.jar:com/iflytek/xirihelpersupervisor/util/ApkTool28.class */ | ||
13 | public class ApkTool28 { | ||
14 | @TargetApi(28) | ||
15 | private boolean copyInstallFile(PackageInstaller packageInstaller, int i, String str) { | ||
16 | IOException e; | ||
17 | OutputStream outputStream; | ||
18 | PackageInstaller.Session session; | ||
19 | FileInputStream fileInputStream; | ||
20 | PackageInstaller.Session session2; | ||
21 | FileInputStream fileInputStream2 = null; | ||
22 | boolean z = true; | ||
23 | try { | ||
24 | File file = new File(str); | ||
25 | PackageInstaller.Session openSession = packageInstaller.openSession(i); | ||
26 | try { | ||
27 | outputStream = openSession.openWrite("base.apk", 0, file.length()); | ||
28 | try { | ||
29 | fileInputStream2 = new FileInputStream(file); | ||
30 | } catch (IOException e2) { | ||
31 | e = e2; | ||
32 | fileInputStream = null; | ||
33 | } catch (Throwable th) { | ||
34 | th = th; | ||
35 | fileInputStream2 = null; | ||
36 | } | ||
37 | try { | ||
38 | byte[] bArr = new byte[65536]; | ||
39 | while (true) { | ||
40 | int read = fileInputStream2.read(bArr); | ||
41 | if (read == -1) { | ||
42 | break; | ||
43 | } | ||
44 | outputStream.write(bArr, 0, read); | ||
45 | } | ||
46 | openSession.fsync(outputStream); | ||
47 | CloseUtils.closeIO(outputStream, fileInputStream2, openSession); | ||
48 | } catch (IOException e3) { | ||
49 | e = e3; | ||
50 | fileInputStream = fileInputStream2; | ||
51 | session = openSession; | ||
52 | try { | ||
53 | e.printStackTrace(); | ||
54 | CloseUtils.closeIO(outputStream, fileInputStream, session); | ||
55 | z = false; | ||
56 | return z; | ||
57 | } catch (Throwable th2) { | ||
58 | session2 = session; | ||
59 | fileInputStream2 = fileInputStream; | ||
60 | CloseUtils.closeIO(outputStream, fileInputStream2, session2); | ||
61 | throw th2; | ||
62 | } | ||
63 | } catch (Throwable th3) { | ||
64 | session2 = openSession; | ||
65 | CloseUtils.closeIO(outputStream, fileInputStream2, session2); | ||
66 | throw th3; | ||
67 | } | ||
68 | } catch (IOException e4) { | ||
69 | e = e4; | ||
70 | fileInputStream = null; | ||
71 | outputStream = null; | ||
72 | session = openSession; | ||
73 | } catch (Throwable th4) { | ||
74 | fileInputStream2 = null; | ||
75 | outputStream = null; | ||
76 | session2 = openSession; | ||
77 | } | ||
78 | } catch (IOException e5) { | ||
79 | e = e5; | ||
80 | fileInputStream = null; | ||
81 | session = null; | ||
82 | outputStream = null; | ||
83 | } catch (Throwable th5) { | ||
84 | fileInputStream2 = null; | ||
85 | session2 = null; | ||
86 | outputStream = null; | ||
87 | } | ||
88 | return z; | ||
89 | } | ||
90 | @TargetApi(28) | ||
91 | private int createSession(PackageInstaller packageInstaller, PackageInstaller.SessionParams sessionParams) { | ||
92 | int i; | ||
93 | try { | ||
94 | i = packageInstaller.createSession(sessionParams); | ||
95 | } catch (IOException e) { | ||
96 | e.printStackTrace(); | ||
97 | i = -1; | ||
98 | } | ||
99 | return i; | ||
100 | } | ||
101 | |||
102 | @TargetApi(28) | ||
103 | private boolean execInstallCommand(PackageInstaller packageInstaller, int i) { | ||
104 | PackageInstaller.Session session = null; | ||
105 | PackageInstaller.Session session2 = null; | ||
106 | try { | ||
107 | try { | ||
108 | PackageInstaller.Session openSession = packageInstaller.openSession(i); | ||
109 | session2 = openSession; | ||
110 | session = openSession; | ||
111 | openSession.commit(PendingIntent.getBroadcast(App.getInstance(), 1, new Intent(App.getInstance(), InstallResultReceiver.class), PendingIntent.FLAG_UPDATE_CURRENT).getIntentSender()); | ||
112 | CloseUtils.closeIO(openSession); | ||
113 | return true; | ||
114 | } catch (Exception e) { | ||
115 | session2 = session; | ||
116 | e.printStackTrace(); | ||
117 | CloseUtils.closeIO(session); | ||
118 | return false; | ||
119 | } | ||
120 | } catch (Throwable th) { | ||
121 | CloseUtils.closeIO(session2); | ||
122 | throw th; | ||
123 | } | ||
124 | } | ||
125 | @TargetApi(28) | ||
126 | public boolean install28(String str) { | ||
127 | File file = new File(str); | ||
128 | PackageInstaller packageInstaller = App.getInstance().getPackageManager().getPackageInstaller(); | ||
129 | PackageInstaller.SessionParams sessionParams = new PackageInstaller.SessionParams(1); | ||
130 | sessionParams.setSize(file.length()); | ||
131 | int createSession = createSession(packageInstaller, sessionParams); | ||
132 | if (createSession == -1 || !copyInstallFile(packageInstaller, createSession, str)) { | ||
133 | return false; | ||
134 | } | ||
135 | return execInstallCommand(packageInstaller, createSession); | ||
136 | } | ||
137 | @TargetApi(28) | ||
138 | public void uninstall28(String str) { | ||
139 | App.getInstance().getPackageManager().getPackageInstaller().uninstall(str, PendingIntent.getBroadcast(App.getInstance(), 1, new Intent(App.getInstance(), InstallResultReceiver.class), PendingIntent.FLAG_UPDATE_CURRENT).getIntentSender()); | ||
140 | } | ||
141 | } | ||
142 |
1 | package com.topdraw.iptvlaunchertest; | ||
2 | import java.io.Closeable; | ||
3 | import java.io.IOException; | ||
4 | |||
5 | public class CloseUtils { | ||
6 | private CloseUtils() { | ||
7 | throw new UnsupportedOperationException("u can't instantiate me..."); | ||
8 | } | ||
9 | |||
10 | public static void closeIO(Closeable... closeableArr) { | ||
11 | if (closeableArr != null) { | ||
12 | try { | ||
13 | for (Closeable closeable : closeableArr) { | ||
14 | if (closeable != null) { | ||
15 | closeable.close(); | ||
16 | continue; | ||
17 | } | ||
18 | } | ||
19 | } catch (IOException e) { | ||
20 | e.printStackTrace(); | ||
21 | } | ||
22 | } | ||
23 | } | ||
24 | |||
25 | public static void closeIOQuietly(Closeable... closeableArr) { | ||
26 | if (closeableArr != null) { | ||
27 | try { | ||
28 | for (Closeable closeable : closeableArr) { | ||
29 | if (closeable != null) { | ||
30 | closeable.close(); | ||
31 | continue; | ||
32 | } | ||
33 | } | ||
34 | } catch (IOException e) { | ||
35 | } | ||
36 | } | ||
37 | } | ||
38 | } |
1 | package com.topdraw.iptvlaunchertest; | ||
2 | |||
3 | import android.util.Log; | ||
4 | |||
5 | import java.io.FileOutputStream; | ||
6 | import java.io.InputStream; | ||
7 | import java.net.HttpURLConnection; | ||
8 | import java.net.URL; | ||
9 | |||
10 | public class HttpDownloader { | ||
11 | private static final String TAG = HttpDownloader.class.getSimpleName(); | ||
12 | public static final int SUCCESS = 1; | ||
13 | public static final int FAILED = -1; | ||
14 | private int iWaitSeconds = 300000; | ||
15 | private String mAddCookie = null; | ||
16 | private int mTimeout = 30000; | ||
17 | |||
18 | public class httpResponseInfo { | ||
19 | final HttpDownloader downloader; | ||
20 | public byte[] data = new byte[0]; | ||
21 | public URL url = null; | ||
22 | |||
23 | public httpResponseInfo(HttpDownloader httpDownloader) { | ||
24 | this.downloader = httpDownloader; | ||
25 | } | ||
26 | } | ||
27 | |||
28 | private HttpURLConnection createDownloadConnection(String str, int i) { | ||
29 | HttpURLConnection httpURLConnection; | ||
30 | try { | ||
31 | httpURLConnection = (HttpURLConnection) new URL(str).openConnection(); | ||
32 | httpURLConnection.setUseCaches(false); | ||
33 | httpURLConnection.setInstanceFollowRedirects(true); | ||
34 | if (i > 0) { | ||
35 | httpURLConnection.setRequestProperty("RANGE", "bytes=" + String.valueOf(i) + "-"); | ||
36 | } | ||
37 | httpURLConnection.setConnectTimeout(this.mTimeout); | ||
38 | httpURLConnection.setReadTimeout(this.mTimeout); | ||
39 | if (this.mAddCookie != null) { | ||
40 | httpURLConnection.setRequestProperty("Cookie", this.mAddCookie); | ||
41 | } | ||
42 | try { | ||
43 | httpURLConnection.connect(); | ||
44 | } catch (Exception e) { | ||
45 | e.printStackTrace(); | ||
46 | httpURLConnection = null; | ||
47 | } | ||
48 | } catch (Exception e2) { | ||
49 | e2.printStackTrace(); | ||
50 | httpURLConnection = null; | ||
51 | } | ||
52 | return httpURLConnection; | ||
53 | } | ||
54 | |||
55 | public int download(String urlString, String saveFilePath) { | ||
56 | FileOutputStream outputStream = null; | ||
57 | try { | ||
58 | // 获取 HTTP 响应信息 | ||
59 | httpResponseInfo responseInfo = getHttpResponse(urlString); | ||
60 | |||
61 | // 检查响应数据是否有效 | ||
62 | if (responseInfo == null || responseInfo.data.length == 0) { | ||
63 | Log.e(TAG, "Failed to get valid HTTP response."); | ||
64 | return FAILED; | ||
65 | } | ||
66 | |||
67 | // 打开输出流 | ||
68 | outputStream = new FileOutputStream(saveFilePath); | ||
69 | |||
70 | // 写入响应数据到文件 | ||
71 | outputStream.write(responseInfo.data); | ||
72 | |||
73 | // 下载成功 | ||
74 | Log.i(TAG, "Download complete: " + saveFilePath); | ||
75 | return SUCCESS; // 返回成功码 | ||
76 | |||
77 | } catch (Exception e) { | ||
78 | e.printStackTrace(); | ||
79 | return FAILED; // 下载失败 | ||
80 | |||
81 | } finally { | ||
82 | // 关闭输出流 | ||
83 | try { | ||
84 | if (outputStream != null) { | ||
85 | outputStream.close(); | ||
86 | } | ||
87 | } catch (Exception e) { | ||
88 | e.printStackTrace(); | ||
89 | } | ||
90 | } | ||
91 | } | ||
92 | |||
93 | public httpResponseInfo getHttpResponse(String str) { | ||
94 | httpResponseInfo httpresponseinfo = new httpResponseInfo(this); | ||
95 | try { | ||
96 | HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str).openConnection(); | ||
97 | httpURLConnection.setUseCaches(false); | ||
98 | httpURLConnection.setInstanceFollowRedirects(true); | ||
99 | httpURLConnection.setConnectTimeout(this.mTimeout); | ||
100 | httpURLConnection.setReadTimeout(this.mTimeout); | ||
101 | if (this.mAddCookie != null) { | ||
102 | httpURLConnection.setRequestProperty("Cookie", this.mAddCookie); | ||
103 | } | ||
104 | try { | ||
105 | httpURLConnection.connect(); | ||
106 | int contentLength = httpURLConnection.getContentLength(); | ||
107 | Log.d(TAG, "contentLength:" + contentLength); | ||
108 | InputStream inputStream = httpURLConnection.getInputStream(); | ||
109 | int i = 0; | ||
110 | httpresponseinfo.url = httpURLConnection.getURL(); | ||
111 | httpresponseinfo.data = new byte[contentLength]; | ||
112 | byte[] bArr = new byte[1024]; | ||
113 | while (i < contentLength) { | ||
114 | try { | ||
115 | int read = inputStream.read(bArr); | ||
116 | if (read <= 0) { | ||
117 | break; | ||
118 | } | ||
119 | System.arraycopy(bArr, 0, httpresponseinfo.data, i, read); | ||
120 | i += read; | ||
121 | } catch (Exception e) { | ||
122 | e.printStackTrace(); | ||
123 | } | ||
124 | } | ||
125 | if (i != contentLength) { | ||
126 | Log.d(TAG,"get http response error. readLen:" + i + ",contentLen:" + contentLength); | ||
127 | httpresponseinfo.data = new byte[0]; | ||
128 | httpresponseinfo.url = null; | ||
129 | } | ||
130 | inputStream.close(); | ||
131 | httpURLConnection.disconnect(); | ||
132 | } catch (Exception e2) { | ||
133 | e2.printStackTrace(); | ||
134 | } | ||
135 | } catch (Exception e3) { | ||
136 | e3.printStackTrace(); | ||
137 | httpresponseinfo.data = new byte[0]; | ||
138 | httpresponseinfo.url = null; | ||
139 | } | ||
140 | return httpresponseinfo; | ||
141 | } | ||
142 | |||
143 | public void setCookie(String str) { | ||
144 | this.mAddCookie = str; | ||
145 | } | ||
146 | } | ||
147 |
1 | package com.topdraw.iptvlaunchertest; | ||
2 | |||
3 | import android.content.BroadcastReceiver; | ||
4 | import android.content.Context; | ||
5 | import android.content.Intent; | ||
6 | import android.util.Log; | ||
7 | |||
8 | public class InstallResultReceiver extends BroadcastReceiver { | ||
9 | private static final String TAG = "InstallResultReceiver"; | ||
10 | |||
11 | @Override | ||
12 | public void onReceive(Context context, Intent intent) { | ||
13 | if (intent == null) { | ||
14 | return; | ||
15 | } | ||
16 | if (intent.getIntExtra("android.content.pm.extra.STATUS", 1) == 0) { | ||
17 | Log.d(TAG, "onReceive: success"); | ||
18 | } else { | ||
19 | Log.e(TAG, intent.getStringExtra("android.content.pm.extra.STATUS_MESSAGE")); | ||
20 | } | ||
21 | } | ||
22 | } |
1 | package com.topdraw.iptvlaunchertest; | ||
2 | |||
3 | import android.Manifest; | ||
4 | import android.content.pm.PermissionInfo; | ||
5 | import android.os.Build; | ||
6 | import android.os.Bundle; | ||
7 | import android.webkit.WebSettings; | ||
8 | import android.webkit.WebView; | ||
9 | |||
10 | import androidx.activity.EdgeToEdge; | ||
11 | import androidx.appcompat.app.AppCompatActivity; | ||
12 | import androidx.core.graphics.Insets; | ||
13 | import androidx.core.view.ViewCompat; | ||
14 | import androidx.core.view.WindowInsetsCompat; | ||
15 | |||
16 | import java.security.acl.Permission; | ||
17 | |||
18 | public class MainActivity extends AppCompatActivity { | ||
19 | private WebView webView; | ||
20 | private STBAppManager stbAppManager; | ||
21 | private String[] permissions = new String[]{ | ||
22 | Manifest.permission.WRITE_EXTERNAL_STORAGE, | ||
23 | Manifest.permission.READ_EXTERNAL_STORAGE, | ||
24 | Manifest.permission.INSTALL_PACKAGES | ||
25 | }; | ||
26 | @Override | ||
27 | protected void onCreate(Bundle savedInstanceState) { | ||
28 | super.onCreate(savedInstanceState); | ||
29 | EdgeToEdge.enable(this); | ||
30 | setContentView(R.layout.activity_main); | ||
31 | ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { | ||
32 | Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); | ||
33 | v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); | ||
34 | return insets; | ||
35 | }); | ||
36 | webView = findViewById(R.id.webview); | ||
37 | initWeb(); | ||
38 | initObject(); | ||
39 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | ||
40 | requestPermissions(permissions,0); | ||
41 | } | ||
42 | webView.loadUrl("http://192.168.12.98:8080/JsAppLaunch/JsAppStartUp.html"); | ||
43 | } | ||
44 | |||
45 | private void initWeb() { | ||
46 | WebSettings settings = webView.getSettings(); | ||
47 | settings.setJavaScriptCanOpenWindowsAutomatically(true); | ||
48 | settings.setJavaScriptEnabled(true); | ||
49 | settings.setAllowContentAccess(true); | ||
50 | settings.setDatabaseEnabled(true); | ||
51 | settings.setAllowFileAccessFromFileURLs(true); | ||
52 | settings.setAllowUniversalAccessFromFileURLs(true); | ||
53 | } | ||
54 | |||
55 | private void initObject(){ | ||
56 | this.stbAppManager = new STBAppManager(this); | ||
57 | webView.addJavascriptInterface(this.stbAppManager,"STBAppManager"); | ||
58 | } | ||
59 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
This diff is collapsed.
Click to expand it.
1 | package com.topdraw.iptvlaunchertest; | ||
2 | |||
3 | import android.os.Handler; | ||
4 | import android.os.Looper; | ||
5 | |||
6 | import java.util.concurrent.Callable; | ||
7 | import java.util.concurrent.ExecutorService; | ||
8 | import java.util.concurrent.Future; | ||
9 | import java.util.concurrent.LinkedBlockingDeque; | ||
10 | import java.util.concurrent.ScheduledFuture; | ||
11 | import java.util.concurrent.ScheduledThreadPoolExecutor; | ||
12 | import java.util.concurrent.ThreadFactory; | ||
13 | import java.util.concurrent.ThreadPoolExecutor; | ||
14 | import java.util.concurrent.TimeUnit; | ||
15 | import java.util.concurrent.atomic.AtomicInteger; | ||
16 | |||
17 | /* loaded from: classes-dex2jar.jar:com/iflytek/xirihelpersupervisor/util/TaskExecutor.class */ | ||
18 | public class TaskExecutor { | ||
19 | private static final int CORE_POOL_SIZE; | ||
20 | private static final int CPU_COUNT; | ||
21 | private static final int KEEP_ALIVE = 1; | ||
22 | private static final int MAX_POOL_SIZE; | ||
23 | private static final int MAX_SCHEDULED_POOL_SIZE = 2; | ||
24 | private static ExecutorService sExecutorService = null; | ||
25 | private static ScheduledThreadPoolExecutor sScheduledThreadPoolExecutor = null; | ||
26 | private static Handler sMainHandler = null; | ||
27 | |||
28 | /* access modifiers changed from: private */ | ||
29 | /* loaded from: classes-dex2jar.jar:com/iflytek/xirihelpersupervisor/util/TaskExecutor$DefaultThreadPoolFactory.class */ | ||
30 | public static class DefaultThreadPoolFactory implements ThreadFactory { | ||
31 | private static final AtomicInteger THREAD_POOL_NUM = new AtomicInteger(1); | ||
32 | private final ThreadGroup group; | ||
33 | private final String namePrefix; | ||
34 | private final AtomicInteger threadNum = new AtomicInteger(1); | ||
35 | private final AtomicInteger totalThreadNum = new AtomicInteger(1); | ||
36 | |||
37 | DefaultThreadPoolFactory() { | ||
38 | SecurityManager securityManager = System.getSecurityManager(); | ||
39 | this.group = securityManager != null ? securityManager.getThreadGroup() : Thread.currentThread().getThreadGroup(); | ||
40 | this.namePrefix = "pool-id-" + THREAD_POOL_NUM.getAndIncrement(); | ||
41 | } | ||
42 | |||
43 | @Override // java.util.concurrent.ThreadFactory | ||
44 | public Thread newThread(Runnable runnable) { | ||
45 | ThreadGroup threadGroup = this.group; | ||
46 | Thread thread = new Thread(threadGroup, runnable, this.namePrefix + " thread-id-" + this.threadNum.getAndIncrement() + " total-thread-num-" + this.totalThreadNum.getAndIncrement()); | ||
47 | thread.setPriority(5); | ||
48 | if (thread.isDaemon()) { | ||
49 | thread.setDaemon(false); | ||
50 | } | ||
51 | return thread; | ||
52 | } | ||
53 | } | ||
54 | |||
55 | static { | ||
56 | int availableProcessors = Runtime.getRuntime().availableProcessors(); | ||
57 | CPU_COUNT = availableProcessors; | ||
58 | CORE_POOL_SIZE = availableProcessors + 1; | ||
59 | MAX_POOL_SIZE = (availableProcessors * 2) + 1; | ||
60 | } | ||
61 | |||
62 | private static void ensureMainHandler() { | ||
63 | synchronized (TaskExecutor.class) { | ||
64 | try { | ||
65 | if (sMainHandler == null) { | ||
66 | sMainHandler = new Handler(Looper.getMainLooper()); | ||
67 | } | ||
68 | } catch (Throwable th) { | ||
69 | throw th; | ||
70 | } | ||
71 | } | ||
72 | } | ||
73 | |||
74 | private static void ensureScheduledThreadPoolExector() { | ||
75 | synchronized (TaskExecutor.class) { | ||
76 | try { | ||
77 | if (sScheduledThreadPoolExecutor == null) { | ||
78 | sScheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(2); | ||
79 | } | ||
80 | } catch (Throwable th) { | ||
81 | throw th; | ||
82 | } | ||
83 | } | ||
84 | } | ||
85 | |||
86 | private static void ensureThreadPoolExecutor() { | ||
87 | synchronized (TaskExecutor.class) { | ||
88 | try { | ||
89 | if (sExecutorService == null) { | ||
90 | sExecutorService = new ThreadPoolExecutor(CORE_POOL_SIZE, MAX_POOL_SIZE, 1, TimeUnit.SECONDS, new LinkedBlockingDeque(), new DefaultThreadPoolFactory(), new ThreadPoolExecutor.DiscardOldestPolicy()); | ||
91 | } | ||
92 | } catch (Throwable th) { | ||
93 | throw th; | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | |||
98 | public static void executeTask(Runnable runnable) { | ||
99 | ensureThreadPoolExecutor(); | ||
100 | sExecutorService.submit(runnable); | ||
101 | } | ||
102 | |||
103 | public static <T> Future<?> executeTaskWithResult(Callable<T> callable) { | ||
104 | ensureThreadPoolExecutor(); | ||
105 | return sExecutorService.submit(callable); | ||
106 | } | ||
107 | |||
108 | public static void runTaskOnUiThread(Runnable runnable) { | ||
109 | ensureMainHandler(); | ||
110 | sMainHandler.post(runnable); | ||
111 | } | ||
112 | |||
113 | public static ScheduledFuture<?> scheduleAtFixedRate(Runnable runnable, long j, long j2) { | ||
114 | ensureScheduledThreadPoolExector(); | ||
115 | return sScheduledThreadPoolExecutor.scheduleAtFixedRate(runnable, j, j2, TimeUnit.MILLISECONDS); | ||
116 | } | ||
117 | |||
118 | public static ScheduledFuture<?> scheduledTask(long j, Runnable runnable) { | ||
119 | ensureScheduledThreadPoolExector(); | ||
120 | return sScheduledThreadPoolExecutor.schedule(runnable, j, TimeUnit.MILLISECONDS); | ||
121 | } | ||
122 | |||
123 | public static void scheduledTaskOnUiThread(long j, Runnable runnable) { | ||
124 | ensureMainHandler(); | ||
125 | sMainHandler.postDelayed(runnable, j); | ||
126 | } | ||
127 | |||
128 | public static void shutdown() { | ||
129 | ExecutorService executorService = sExecutorService; | ||
130 | if (executorService != null) { | ||
131 | executorService.shutdown(); | ||
132 | sExecutorService = null; | ||
133 | } | ||
134 | } | ||
135 | } | ||
136 |
1 | <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | xmlns:aapt="http://schemas.android.com/aapt" | ||
3 | android:width="108dp" | ||
4 | android:height="108dp" | ||
5 | android:viewportWidth="108" | ||
6 | android:viewportHeight="108"> | ||
7 | <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> | ||
8 | <aapt:attr name="android:fillColor"> | ||
9 | <gradient | ||
10 | android:endX="85.84757" | ||
11 | android:endY="92.4963" | ||
12 | android:startX="42.9492" | ||
13 | android:startY="49.59793" | ||
14 | android:type="linear"> | ||
15 | <item | ||
16 | android:color="#44000000" | ||
17 | android:offset="0.0" /> | ||
18 | <item | ||
19 | android:color="#00000000" | ||
20 | android:offset="1.0" /> | ||
21 | </gradient> | ||
22 | </aapt:attr> | ||
23 | </path> | ||
24 | <path | ||
25 | android:fillColor="#FFFFFF" | ||
26 | android:fillType="nonZero" | ||
27 | android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" | ||
28 | android:strokeWidth="1" | ||
29 | android:strokeColor="#00000000" /> | ||
30 | </vector> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | android:width="108dp" | ||
4 | android:height="108dp" | ||
5 | android:viewportWidth="108" | ||
6 | android:viewportHeight="108"> | ||
7 | <path | ||
8 | android:fillColor="#3DDC84" | ||
9 | android:pathData="M0,0h108v108h-108z" /> | ||
10 | <path | ||
11 | android:fillColor="#00000000" | ||
12 | android:pathData="M9,0L9,108" | ||
13 | android:strokeWidth="0.8" | ||
14 | android:strokeColor="#33FFFFFF" /> | ||
15 | <path | ||
16 | android:fillColor="#00000000" | ||
17 | android:pathData="M19,0L19,108" | ||
18 | android:strokeWidth="0.8" | ||
19 | android:strokeColor="#33FFFFFF" /> | ||
20 | <path | ||
21 | android:fillColor="#00000000" | ||
22 | android:pathData="M29,0L29,108" | ||
23 | android:strokeWidth="0.8" | ||
24 | android:strokeColor="#33FFFFFF" /> | ||
25 | <path | ||
26 | android:fillColor="#00000000" | ||
27 | android:pathData="M39,0L39,108" | ||
28 | android:strokeWidth="0.8" | ||
29 | android:strokeColor="#33FFFFFF" /> | ||
30 | <path | ||
31 | android:fillColor="#00000000" | ||
32 | android:pathData="M49,0L49,108" | ||
33 | android:strokeWidth="0.8" | ||
34 | android:strokeColor="#33FFFFFF" /> | ||
35 | <path | ||
36 | android:fillColor="#00000000" | ||
37 | android:pathData="M59,0L59,108" | ||
38 | android:strokeWidth="0.8" | ||
39 | android:strokeColor="#33FFFFFF" /> | ||
40 | <path | ||
41 | android:fillColor="#00000000" | ||
42 | android:pathData="M69,0L69,108" | ||
43 | android:strokeWidth="0.8" | ||
44 | android:strokeColor="#33FFFFFF" /> | ||
45 | <path | ||
46 | android:fillColor="#00000000" | ||
47 | android:pathData="M79,0L79,108" | ||
48 | android:strokeWidth="0.8" | ||
49 | android:strokeColor="#33FFFFFF" /> | ||
50 | <path | ||
51 | android:fillColor="#00000000" | ||
52 | android:pathData="M89,0L89,108" | ||
53 | android:strokeWidth="0.8" | ||
54 | android:strokeColor="#33FFFFFF" /> | ||
55 | <path | ||
56 | android:fillColor="#00000000" | ||
57 | android:pathData="M99,0L99,108" | ||
58 | android:strokeWidth="0.8" | ||
59 | android:strokeColor="#33FFFFFF" /> | ||
60 | <path | ||
61 | android:fillColor="#00000000" | ||
62 | android:pathData="M0,9L108,9" | ||
63 | android:strokeWidth="0.8" | ||
64 | android:strokeColor="#33FFFFFF" /> | ||
65 | <path | ||
66 | android:fillColor="#00000000" | ||
67 | android:pathData="M0,19L108,19" | ||
68 | android:strokeWidth="0.8" | ||
69 | android:strokeColor="#33FFFFFF" /> | ||
70 | <path | ||
71 | android:fillColor="#00000000" | ||
72 | android:pathData="M0,29L108,29" | ||
73 | android:strokeWidth="0.8" | ||
74 | android:strokeColor="#33FFFFFF" /> | ||
75 | <path | ||
76 | android:fillColor="#00000000" | ||
77 | android:pathData="M0,39L108,39" | ||
78 | android:strokeWidth="0.8" | ||
79 | android:strokeColor="#33FFFFFF" /> | ||
80 | <path | ||
81 | android:fillColor="#00000000" | ||
82 | android:pathData="M0,49L108,49" | ||
83 | android:strokeWidth="0.8" | ||
84 | android:strokeColor="#33FFFFFF" /> | ||
85 | <path | ||
86 | android:fillColor="#00000000" | ||
87 | android:pathData="M0,59L108,59" | ||
88 | android:strokeWidth="0.8" | ||
89 | android:strokeColor="#33FFFFFF" /> | ||
90 | <path | ||
91 | android:fillColor="#00000000" | ||
92 | android:pathData="M0,69L108,69" | ||
93 | android:strokeWidth="0.8" | ||
94 | android:strokeColor="#33FFFFFF" /> | ||
95 | <path | ||
96 | android:fillColor="#00000000" | ||
97 | android:pathData="M0,79L108,79" | ||
98 | android:strokeWidth="0.8" | ||
99 | android:strokeColor="#33FFFFFF" /> | ||
100 | <path | ||
101 | android:fillColor="#00000000" | ||
102 | android:pathData="M0,89L108,89" | ||
103 | android:strokeWidth="0.8" | ||
104 | android:strokeColor="#33FFFFFF" /> | ||
105 | <path | ||
106 | android:fillColor="#00000000" | ||
107 | android:pathData="M0,99L108,99" | ||
108 | android:strokeWidth="0.8" | ||
109 | android:strokeColor="#33FFFFFF" /> | ||
110 | <path | ||
111 | android:fillColor="#00000000" | ||
112 | android:pathData="M19,29L89,29" | ||
113 | android:strokeWidth="0.8" | ||
114 | android:strokeColor="#33FFFFFF" /> | ||
115 | <path | ||
116 | android:fillColor="#00000000" | ||
117 | android:pathData="M19,39L89,39" | ||
118 | android:strokeWidth="0.8" | ||
119 | android:strokeColor="#33FFFFFF" /> | ||
120 | <path | ||
121 | android:fillColor="#00000000" | ||
122 | android:pathData="M19,49L89,49" | ||
123 | android:strokeWidth="0.8" | ||
124 | android:strokeColor="#33FFFFFF" /> | ||
125 | <path | ||
126 | android:fillColor="#00000000" | ||
127 | android:pathData="M19,59L89,59" | ||
128 | android:strokeWidth="0.8" | ||
129 | android:strokeColor="#33FFFFFF" /> | ||
130 | <path | ||
131 | android:fillColor="#00000000" | ||
132 | android:pathData="M19,69L89,69" | ||
133 | android:strokeWidth="0.8" | ||
134 | android:strokeColor="#33FFFFFF" /> | ||
135 | <path | ||
136 | android:fillColor="#00000000" | ||
137 | android:pathData="M19,79L89,79" | ||
138 | android:strokeWidth="0.8" | ||
139 | android:strokeColor="#33FFFFFF" /> | ||
140 | <path | ||
141 | android:fillColor="#00000000" | ||
142 | android:pathData="M29,19L29,89" | ||
143 | android:strokeWidth="0.8" | ||
144 | android:strokeColor="#33FFFFFF" /> | ||
145 | <path | ||
146 | android:fillColor="#00000000" | ||
147 | android:pathData="M39,19L39,89" | ||
148 | android:strokeWidth="0.8" | ||
149 | android:strokeColor="#33FFFFFF" /> | ||
150 | <path | ||
151 | android:fillColor="#00000000" | ||
152 | android:pathData="M49,19L49,89" | ||
153 | android:strokeWidth="0.8" | ||
154 | android:strokeColor="#33FFFFFF" /> | ||
155 | <path | ||
156 | android:fillColor="#00000000" | ||
157 | android:pathData="M59,19L59,89" | ||
158 | android:strokeWidth="0.8" | ||
159 | android:strokeColor="#33FFFFFF" /> | ||
160 | <path | ||
161 | android:fillColor="#00000000" | ||
162 | android:pathData="M69,19L69,89" | ||
163 | android:strokeWidth="0.8" | ||
164 | android:strokeColor="#33FFFFFF" /> | ||
165 | <path | ||
166 | android:fillColor="#00000000" | ||
167 | android:pathData="M79,19L79,89" | ||
168 | android:strokeWidth="0.8" | ||
169 | android:strokeColor="#33FFFFFF" /> | ||
170 | </vector> |
app/src/main/res/layout/activity_main.xml
0 → 100644
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:id="@+id/main" | ||
6 | android:layout_width="match_parent" | ||
7 | android:layout_height="match_parent" | ||
8 | tools:context=".MainActivity"> | ||
9 | |||
10 | <WebView | ||
11 | android:id="@+id/webview" | ||
12 | android:layout_width="match_parent" | ||
13 | android:layout_height="match_parent" | ||
14 | app:layout_constraintBottom_toBottomOf="parent" | ||
15 | app:layout_constraintEnd_toEndOf="parent" | ||
16 | app:layout_constraintStart_toStartOf="parent" | ||
17 | app:layout_constraintTop_toTopOf="parent" /> | ||
18 | |||
19 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | <background android:drawable="@drawable/ic_launcher_background" /> | ||
4 | <foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||
5 | <monochrome android:drawable="@drawable/ic_launcher_foreground" /> | ||
6 | </adaptive-icon> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | <background android:drawable="@drawable/ic_launcher_background" /> | ||
4 | <foreground android:drawable="@drawable/ic_launcher_foreground" /> | ||
5 | <monochrome android:drawable="@drawable/ic_launcher_foreground" /> | ||
6 | </adaptive-icon> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
app/src/main/res/values-night/themes.xml
0 → 100644
1 | <resources xmlns:tools="http://schemas.android.com/tools"> | ||
2 | <!-- Base application theme. --> | ||
3 | <style name="Base.Theme.IPTVLauncherTest" parent="Theme.Material3.DayNight.NoActionBar"> | ||
4 | <!-- Customize your dark theme here. --> | ||
5 | <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> | ||
6 | </style> | ||
7 | </resources> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
app/src/main/res/values/colors.xml
0 → 100644
app/src/main/res/values/strings.xml
0 → 100644
app/src/main/res/values/themes.xml
0 → 100644
1 | <resources xmlns:tools="http://schemas.android.com/tools"> | ||
2 | <!-- Base application theme. --> | ||
3 | <style name="Base.Theme.IPTVLauncherTest" parent="Theme.Material3.DayNight.NoActionBar"> | ||
4 | <!-- Customize your light theme here. --> | ||
5 | <!-- <item name="colorPrimary">@color/my_light_primary</item> --> | ||
6 | </style> | ||
7 | |||
8 | <style name="Theme.IPTVLauncherTest" parent="Base.Theme.IPTVLauncherTest" /> | ||
9 | </resources> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
app/src/main/res/xml/backup_rules.xml
0 → 100644
1 | <?xml version="1.0" encoding="utf-8"?><!-- | ||
2 | Sample backup rules file; uncomment and customize as necessary. | ||
3 | See https://developer.android.com/guide/topics/data/autobackup | ||
4 | for details. | ||
5 | Note: This file is ignored for devices older that API 31 | ||
6 | See https://developer.android.com/about/versions/12/backup-restore | ||
7 | --> | ||
8 | <full-backup-content> | ||
9 | <!-- | ||
10 | <include domain="sharedpref" path="."/> | ||
11 | <exclude domain="sharedpref" path="device.xml"/> | ||
12 | --> | ||
13 | </full-backup-content> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?xml version="1.0" encoding="utf-8"?><!-- | ||
2 | Sample data extraction rules file; uncomment and customize as necessary. | ||
3 | See https://developer.android.com/about/versions/12/backup-restore#xml-changes | ||
4 | for details. | ||
5 | --> | ||
6 | <data-extraction-rules> | ||
7 | <cloud-backup> | ||
8 | <!-- TODO: Use <include> and <exclude> to control what is backed up. | ||
9 | <include .../> | ||
10 | <exclude .../> | ||
11 | --> | ||
12 | </cloud-backup> | ||
13 | <!-- | ||
14 | <device-transfer> | ||
15 | <include .../> | ||
16 | <exclude .../> | ||
17 | </device-transfer> | ||
18 | --> | ||
19 | </data-extraction-rules> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | package com.topdraw.iptvlaunchertest; | ||
2 | |||
3 | import org.junit.Test; | ||
4 | |||
5 | import static org.junit.Assert.*; | ||
6 | |||
7 | /** | ||
8 | * Example local unit test, which will execute on the development machine (host). | ||
9 | * | ||
10 | * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
11 | */ | ||
12 | public class ExampleUnitTest { | ||
13 | @Test | ||
14 | public void addition_isCorrect() { | ||
15 | assertEquals(4, 2 + 2); | ||
16 | } | ||
17 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
build.gradle
0 → 100644
gradle.properties
0 → 100644
1 | # Project-wide Gradle settings. | ||
2 | # IDE (e.g. Android Studio) users: | ||
3 | # Gradle settings configured through the IDE *will override* | ||
4 | # any settings specified in this file. | ||
5 | # For more details on how to configure your build environment visit | ||
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html | ||
7 | # Specifies the JVM arguments used for the daemon process. | ||
8 | # The setting is particularly useful for tweaking memory settings. | ||
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 | ||
10 | # When configured, Gradle will run in incubating parallel mode. | ||
11 | # This option should only be used with decoupled projects. For more details, visit | ||
12 | # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects | ||
13 | # org.gradle.parallel=true | ||
14 | # AndroidX package structure to make it clearer which packages are bundled with the | ||
15 | # Android operating system, and which are packaged with your app's APK | ||
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn | ||
17 | android.useAndroidX=true | ||
18 | # Enables namespacing of each library's R class so that its R class includes only the | ||
19 | # resources declared in the library itself and none from the library's dependencies, | ||
20 | # thereby reducing the size of the R class for that library | ||
21 | android.nonTransitiveRClass=true | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
gradle/libs.versions.toml
0 → 100644
1 | [versions] | ||
2 | agp = "8.6.1" | ||
3 | junit = "4.13.2" | ||
4 | junitVersion = "1.2.1" | ||
5 | espressoCore = "3.6.1" | ||
6 | appcompat = "1.7.0" | ||
7 | material = "1.12.0" | ||
8 | activity = "1.9.1" | ||
9 | constraintlayout = "2.1.4" | ||
10 | |||
11 | [libraries] | ||
12 | junit = { group = "junit", name = "junit", version.ref = "junit" } | ||
13 | ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } | ||
14 | espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } | ||
15 | appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } | ||
16 | material = { group = "com.google.android.material", name = "material", version.ref = "material" } | ||
17 | activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } | ||
18 | constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } | ||
19 | |||
20 | [plugins] | ||
21 | android-application = { id = "com.android.application", version.ref = "agp" } | ||
22 |
gradle/wrapper/gradle-wrapper.jar
0 → 100644
No preview for this file type
gradle/wrapper/gradle-wrapper.properties
0 → 100644
gradlew
0 → 100755
1 | #!/usr/bin/env sh | ||
2 | |||
3 | # | ||
4 | # Copyright 2015 the original author or authors. | ||
5 | # | ||
6 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
7 | # you may not use this file except in compliance with the License. | ||
8 | # You may obtain a copy of the License at | ||
9 | # | ||
10 | # https://www.apache.org/licenses/LICENSE-2.0 | ||
11 | # | ||
12 | # Unless required by applicable law or agreed to in writing, software | ||
13 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
15 | # See the License for the specific language governing permissions and | ||
16 | # limitations under the License. | ||
17 | # | ||
18 | |||
19 | ############################################################################## | ||
20 | ## | ||
21 | ## Gradle start up script for UN*X | ||
22 | ## | ||
23 | ############################################################################## | ||
24 | |||
25 | # Attempt to set APP_HOME | ||
26 | # Resolve links: $0 may be a link | ||
27 | PRG="$0" | ||
28 | # Need this for relative symlinks. | ||
29 | while [ -h "$PRG" ] ; do | ||
30 | ls=`ls -ld "$PRG"` | ||
31 | link=`expr "$ls" : '.*-> \(.*\)$'` | ||
32 | if expr "$link" : '/.*' > /dev/null; then | ||
33 | PRG="$link" | ||
34 | else | ||
35 | PRG=`dirname "$PRG"`"/$link" | ||
36 | fi | ||
37 | done | ||
38 | SAVED="`pwd`" | ||
39 | cd "`dirname \"$PRG\"`/" >/dev/null | ||
40 | APP_HOME="`pwd -P`" | ||
41 | cd "$SAVED" >/dev/null | ||
42 | |||
43 | APP_NAME="Gradle" | ||
44 | APP_BASE_NAME=`basename "$0"` | ||
45 | |||
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' | ||
48 | |||
49 | # Use the maximum available, or set MAX_FD != -1 to use that value. | ||
50 | MAX_FD="maximum" | ||
51 | |||
52 | warn () { | ||
53 | echo "$*" | ||
54 | } | ||
55 | |||
56 | die () { | ||
57 | echo | ||
58 | echo "$*" | ||
59 | echo | ||
60 | exit 1 | ||
61 | } | ||
62 | |||
63 | # OS specific support (must be 'true' or 'false'). | ||
64 | cygwin=false | ||
65 | msys=false | ||
66 | darwin=false | ||
67 | nonstop=false | ||
68 | case "`uname`" in | ||
69 | CYGWIN* ) | ||
70 | cygwin=true | ||
71 | ;; | ||
72 | Darwin* ) | ||
73 | darwin=true | ||
74 | ;; | ||
75 | MINGW* ) | ||
76 | msys=true | ||
77 | ;; | ||
78 | NONSTOP* ) | ||
79 | nonstop=true | ||
80 | ;; | ||
81 | esac | ||
82 | |||
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | ||
84 | |||
85 | |||
86 | # Determine the Java command to use to start the JVM. | ||
87 | if [ -n "$JAVA_HOME" ] ; then | ||
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | ||
89 | # IBM's JDK on AIX uses strange locations for the executables | ||
90 | JAVACMD="$JAVA_HOME/jre/sh/java" | ||
91 | else | ||
92 | JAVACMD="$JAVA_HOME/bin/java" | ||
93 | fi | ||
94 | if [ ! -x "$JAVACMD" ] ; then | ||
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | ||
96 | |||
97 | Please set the JAVA_HOME variable in your environment to match the | ||
98 | location of your Java installation." | ||
99 | fi | ||
100 | else | ||
101 | JAVACMD="java" | ||
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
103 | |||
104 | Please set the JAVA_HOME variable in your environment to match the | ||
105 | location of your Java installation." | ||
106 | fi | ||
107 | |||
108 | # Increase the maximum file descriptors if we can. | ||
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then | ||
110 | MAX_FD_LIMIT=`ulimit -H -n` | ||
111 | if [ $? -eq 0 ] ; then | ||
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | ||
113 | MAX_FD="$MAX_FD_LIMIT" | ||
114 | fi | ||
115 | ulimit -n $MAX_FD | ||
116 | if [ $? -ne 0 ] ; then | ||
117 | warn "Could not set maximum file descriptor limit: $MAX_FD" | ||
118 | fi | ||
119 | else | ||
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | ||
121 | fi | ||
122 | fi | ||
123 | |||
124 | # For Darwin, add options to specify how the application appears in the dock | ||
125 | if $darwin; then | ||
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | ||
127 | fi | ||
128 | |||
129 | # For Cygwin or MSYS, switch paths to Windows format before running java | ||
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then | ||
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` | ||
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | ||
133 | |||
134 | JAVACMD=`cygpath --unix "$JAVACMD"` | ||
135 | |||
136 | # We build the pattern for arguments to be converted via cygpath | ||
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | ||
138 | SEP="" | ||
139 | for dir in $ROOTDIRSRAW ; do | ||
140 | ROOTDIRS="$ROOTDIRS$SEP$dir" | ||
141 | SEP="|" | ||
142 | done | ||
143 | OURCYGPATTERN="(^($ROOTDIRS))" | ||
144 | # Add a user-defined pattern to the cygpath arguments | ||
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then | ||
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | ||
147 | fi | ||
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh | ||
149 | i=0 | ||
150 | for arg in "$@" ; do | ||
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | ||
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | ||
153 | |||
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | ||
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | ||
156 | else | ||
157 | eval `echo args$i`="\"$arg\"" | ||
158 | fi | ||
159 | i=`expr $i + 1` | ||
160 | done | ||
161 | case $i in | ||
162 | 0) set -- ;; | ||
163 | 1) set -- "$args0" ;; | ||
164 | 2) set -- "$args0" "$args1" ;; | ||
165 | 3) set -- "$args0" "$args1" "$args2" ;; | ||
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; | ||
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | ||
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | ||
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | ||
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | ||
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | ||
172 | esac | ||
173 | fi | ||
174 | |||
175 | # Escape application args | ||
176 | save () { | ||
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done | ||
178 | echo " " | ||
179 | } | ||
180 | APP_ARGS=`save "$@"` | ||
181 | |||
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules | ||
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" | ||
184 | |||
185 | exec "$JAVACMD" "$@" |
gradlew.bat
0 → 100644
1 | @rem | ||
2 | @rem Copyright 2015 the original author or authors. | ||
3 | @rem | ||
4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | @rem you may not use this file except in compliance with the License. | ||
6 | @rem You may obtain a copy of the License at | ||
7 | @rem | ||
8 | @rem https://www.apache.org/licenses/LICENSE-2.0 | ||
9 | @rem | ||
10 | @rem Unless required by applicable law or agreed to in writing, software | ||
11 | @rem distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | @rem See the License for the specific language governing permissions and | ||
14 | @rem limitations under the License. | ||
15 | @rem | ||
16 | |||
17 | @if "%DEBUG%" == "" @echo off | ||
18 | @rem ########################################################################## | ||
19 | @rem | ||
20 | @rem Gradle startup script for Windows | ||
21 | @rem | ||
22 | @rem ########################################################################## | ||
23 | |||
24 | @rem Set local scope for the variables with windows NT shell | ||
25 | if "%OS%"=="Windows_NT" setlocal | ||
26 | |||
27 | set DIRNAME=%~dp0 | ||
28 | if "%DIRNAME%" == "" set DIRNAME=. | ||
29 | set APP_BASE_NAME=%~n0 | ||
30 | set APP_HOME=%DIRNAME% | ||
31 | |||
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. | ||
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi | ||
34 | |||
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" | ||
37 | |||
38 | @rem Find java.exe | ||
39 | if defined JAVA_HOME goto findJavaFromJavaHome | ||
40 | |||
41 | set JAVA_EXE=java.exe | ||
42 | %JAVA_EXE% -version >NUL 2>&1 | ||
43 | if "%ERRORLEVEL%" == "0" goto execute | ||
44 | |||
45 | echo. | ||
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
47 | echo. | ||
48 | echo Please set the JAVA_HOME variable in your environment to match the | ||
49 | echo location of your Java installation. | ||
50 | |||
51 | goto fail | ||
52 | |||
53 | :findJavaFromJavaHome | ||
54 | set JAVA_HOME=%JAVA_HOME:"=% | ||
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe | ||
56 | |||
57 | if exist "%JAVA_EXE%" goto execute | ||
58 | |||
59 | echo. | ||
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | ||
61 | echo. | ||
62 | echo Please set the JAVA_HOME variable in your environment to match the | ||
63 | echo location of your Java installation. | ||
64 | |||
65 | goto fail | ||
66 | |||
67 | :execute | ||
68 | @rem Setup the command line | ||
69 | |||
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | ||
71 | |||
72 | |||
73 | @rem Execute Gradle | ||
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* | ||
75 | |||
76 | :end | ||
77 | @rem End local scope for the variables with windows NT shell | ||
78 | if "%ERRORLEVEL%"=="0" goto mainEnd | ||
79 | |||
80 | :fail | ||
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of | ||
82 | rem the _cmd.exe /c_ return code! | ||
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 | ||
84 | exit /b 1 | ||
85 | |||
86 | :mainEnd | ||
87 | if "%OS%"=="Windows_NT" endlocal | ||
88 | |||
89 | :omega |
settings.gradle
0 → 100644
1 | pluginManagement { | ||
2 | repositories { | ||
3 | google { | ||
4 | content { | ||
5 | includeGroupByRegex("com\\.android.*") | ||
6 | includeGroupByRegex("com\\.google.*") | ||
7 | includeGroupByRegex("androidx.*") | ||
8 | } | ||
9 | } | ||
10 | mavenCentral() | ||
11 | gradlePluginPortal() | ||
12 | } | ||
13 | } | ||
14 | dependencyResolutionManagement { | ||
15 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) | ||
16 | repositories { | ||
17 | google() | ||
18 | mavenCentral() | ||
19 | } | ||
20 | } | ||
21 | |||
22 | rootProject.name = "IPTVLauncherTest" | ||
23 | include ':app' |
-
Please register or sign in to post a comment