Compare commits
3 Commits
a1fca9a833
...
4211abe679
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4211abe679 | ||
|
|
3d6a75277b | ||
|
|
f0fb142fea |
6
XixunPlayer/.idea/AndroidProjectSystem.xml
Normal file
6
XixunPlayer/.idea/AndroidProjectSystem.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||
</component>
|
||||
</project>
|
||||
10
XixunPlayer/.idea/deploymentTargetSelector.xml
Normal file
10
XixunPlayer/.idea/deploymentTargetSelector.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -4,10 +4,9 @@
|
|||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="jbr-17" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
|
|
|
|||
10
XixunPlayer/.idea/migrations.xml
Normal file
10
XixunPlayer/.idea/migrations.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EntryPointsManager">
|
||||
<list size="1">
|
||||
|
|
@ -5,7 +6,7 @@
|
|||
</list>
|
||||
</component>
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="zulu-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
|||
17
XixunPlayer/.idea/runConfigurations.xml
Normal file
17
XixunPlayer/.idea/runConfigurations.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -11,10 +11,99 @@ android {
|
|||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "2.2.18-Y-lora"
|
||||
versionName "2.2.19-config-lora"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
// buildTypes {
|
||||
// release {
|
||||
// minifyEnabled false
|
||||
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
// }
|
||||
// }
|
||||
signingConfigs {
|
||||
config { //常用 通用
|
||||
keyAlias 'xy'
|
||||
keyPassword '111111'
|
||||
storeFile file('D:/zp/Android/GitConn/xy_keystore')
|
||||
//storeFile file('/home/yzd/work/sign/xy_keystore')
|
||||
storePassword '111111'
|
||||
}
|
||||
|
||||
|
||||
M {//美格 //A7
|
||||
keyAlias 'xixun'
|
||||
keyPassword '123456'
|
||||
storeFile file('D:/XixunSoftware/ZP/conn/xixun-m.keystore')
|
||||
storePassword '123456'
|
||||
}
|
||||
|
||||
Y5a { //A9
|
||||
keyAlias 'xixun'
|
||||
keyPassword '123456'
|
||||
storeFile file('D:/zp/Android/GitConn/xixun-c.keystore')
|
||||
storePassword '123456'
|
||||
}
|
||||
|
||||
D { //A11 系统签名 卓策 --卓策系统签名+android.uid.system = 播放器常用普通签名
|
||||
keyAlias 'xixun'
|
||||
keyPassword '123456'
|
||||
storeFile file('D:/zp/Android/GitConn/xixun-d.keystore')
|
||||
storePassword '123456'
|
||||
}
|
||||
|
||||
D_3576 { //A11 系统签名-新 雍慧 3576 3566
|
||||
keyAlias 'platform'
|
||||
keyPassword 'youngfeel'
|
||||
storeFile file('D:/zp/Android/GitConn/yf356x_android11_system.jks')
|
||||
storePassword 'youngfeel'
|
||||
}
|
||||
|
||||
Y33 { // 系统签名
|
||||
keyAlias 'xixun'
|
||||
keyPassword '123456'
|
||||
storeFile file('D:/XixunSoftware/ZP/conn/xixun-x.keystore')
|
||||
storePassword '123456'
|
||||
}
|
||||
|
||||
D_3568 {//3568 //恩泰世3568
|
||||
keyAlias 'systemkey'
|
||||
keyPassword '123456'
|
||||
storeFile file('D:/zp/Android/GitConn/platform.jks')
|
||||
storePassword '123456'
|
||||
}
|
||||
D_gt {//3568 //高通
|
||||
keyAlias 'androiddebugkey'
|
||||
keyPassword 'android'
|
||||
storeFile file('D:/zp/Android/GitConn/platform.keystore')
|
||||
storePassword 'android'
|
||||
}
|
||||
|
||||
a133 {//全志 a133
|
||||
keyAlias 'platform'
|
||||
keyPassword 'youngfeel'
|
||||
storeFile file('D:/zp/Android/GitConn/android11_system.jks')
|
||||
storePassword 'youngfeel'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
|
||||
signingConfig signingConfigs.D
|
||||
}
|
||||
debug {
|
||||
signingConfig signingConfigs.D
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
aidl true
|
||||
}
|
||||
|
|
@ -23,61 +112,15 @@ android {
|
|||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
signingConfigs {
|
||||
X {//4418
|
||||
keyAlias 'xixun'
|
||||
keyPassword '123456'
|
||||
storeFile file('D:/develop/xixun/signedFile/keystore/xixun-x.keystore')
|
||||
storePassword '123456'
|
||||
}
|
||||
Y {//210
|
||||
keyAlias 'xixun'
|
||||
keyPassword '123456'
|
||||
storeFile file('D:/develop/xixun/signedFile/keystore/xixun-y.keystore')
|
||||
storePassword '123456'
|
||||
}
|
||||
D_3568a {//3568a 视美泰
|
||||
keyAlias 'keystore'
|
||||
keyPassword 'android'
|
||||
storeFile file('D:/develop/xixun/signedFile/keystore/keystore.jks')
|
||||
storePassword 'android'
|
||||
}
|
||||
D_3568N {//3568 恩泰世
|
||||
keyAlias 'systemkey'
|
||||
keyPassword '123456'
|
||||
storeFile file('D:/_docs/comp/android/keystore/3568D恩泰世 123456.jks')
|
||||
storePassword '123456'
|
||||
}
|
||||
D_YF {//3566 YF
|
||||
keyAlias 'platform'
|
||||
keyPassword 'youngfeel'
|
||||
storeFile file('D:/_docs/comp/android/keystore/yf356x_android11_system.jks')
|
||||
storePassword 'youngfeel'
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
abortOnError false
|
||||
}
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.D_3568N
|
||||
}
|
||||
debug {
|
||||
signingConfig signingConfigs.D_3568N
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.25'
|
||||
implementation 'com.aliyun:imageaudit20191230:2.0.6'
|
||||
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-core:1.0.19'
|
||||
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native-armeabi-v7a:1.0.19'
|
||||
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native-arm64-v8a:1.0.19'
|
||||
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-core:1.0.19'
|
||||
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native-armeabi-v7a:1.0.19'
|
||||
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native-arm64-v8a:1.0.19'
|
||||
implementation files('libs/gnph.jar')
|
||||
implementation files('libs/zip4j-2.10.0.jar')
|
||||
implementation files('libs/xixun_card_settings_1.2.4.jar')
|
||||
|
|
|
|||
102
XixunPlayer/app/build_zp.gradle
Normal file
102
XixunPlayer/app/build_zp.gradle
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.xixun.xixunplayer'
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.xixun.xixunplayer"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "2.2.19-Y-lora"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
aidl true
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
signingConfigs {
|
||||
X {//4418
|
||||
keyAlias 'xixun'
|
||||
keyPassword '123456'
|
||||
storeFile file('D:/develop/xixun/signedFile/keystore/xixun-x.keystore')
|
||||
storePassword '123456'
|
||||
}
|
||||
Y {//210
|
||||
keyAlias 'xixun'
|
||||
keyPassword '123456'
|
||||
storeFile file('D:/develop/xixun/signedFile/keystore/xixun-y.keystore')
|
||||
storePassword '123456'
|
||||
}
|
||||
D_3568a {//3568a 视美泰
|
||||
keyAlias 'keystore'
|
||||
keyPassword 'android'
|
||||
storeFile file('D:/develop/xixun/signedFile/keystore/keystore.jks')
|
||||
storePassword 'android'
|
||||
}
|
||||
D_3568N {//3568 恩泰世
|
||||
keyAlias 'systemkey'
|
||||
keyPassword '123456'
|
||||
storeFile file('D:/_docs/comp/android/keystore/3568D恩泰世 123456.jks')
|
||||
storePassword '123456'
|
||||
}
|
||||
D_YF {//3566 YF
|
||||
keyAlias 'platform'
|
||||
keyPassword 'youngfeel'
|
||||
storeFile file('D:/_docs/comp/android/keystore/yf356x_android11_system.jks')
|
||||
storePassword 'youngfeel'
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
abortOnError false
|
||||
}
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.D_3568N
|
||||
}
|
||||
debug {
|
||||
signingConfig signingConfigs.D_3568N
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.25'
|
||||
implementation 'com.aliyun:imageaudit20191230:2.0.6'
|
||||
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-core:1.0.19'
|
||||
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native-armeabi-v7a:1.0.19'
|
||||
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native-arm64-v8a:1.0.19'
|
||||
implementation files('libs/gnph.jar')
|
||||
implementation files('libs/zip4j-2.10.0.jar')
|
||||
implementation files('libs/xixun_card_settings_1.2.4.jar')
|
||||
implementation files('libs/ijkplayer-java-0.8.8.aar')
|
||||
implementation files('libs/ijkplayer-armv7a-0.8.8.aar')
|
||||
implementation files('libs/ijkplayer-arm64-0.8.8.aar')
|
||||
implementation files('libs/connService2.jar')
|
||||
}
|
||||
|
||||
def getAppName() {
|
||||
def stringsFile = android.sourceSets.main.res.sourceFiles.find { it.name.equals 'strings.xml' }
|
||||
String s = new XmlParser().parse(stringsFile).string.find { it.@name.equals 'app_name' }.text();
|
||||
return s.replaceAll("\"", "");
|
||||
}
|
||||
|
||||
// 修改 Apk 名
|
||||
android.applicationVariants.configureEach { variant ->
|
||||
variant.outputs.configureEach {
|
||||
def fileName = "${getAppName()}-${versionName}.apk"
|
||||
outputFileName = fileName
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,9 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:sharedUserId="android.uid.system">
|
||||
<!-- android:sharedUserId="android.uid.system"-->
|
||||
<!-- android:sharedUserMaxSdkVersion="32">-->
|
||||
|
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,175 @@
|
|||
package com.xixun.xixunplayer;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class AidlUtil {
|
||||
// static final String ACTION_CONN ="xixun.intent.action.CONNECTION_INFO";
|
||||
static final String ACTION_PLAYER ="com.xixun.action.PlayerInfo";
|
||||
static final String ACTION_CARD_SYSTEM ="com.xixun.joey.aidlset.SettingsService";
|
||||
static final String ACTION_LIVE ="xixun.intent.action.Live";
|
||||
static final String ACTION_UPDATE ="xixun.intent.action.UPDATE_APK";
|
||||
static final String ACTION_JIESHUN ="com.xixun.xy.conn.JieShun";
|
||||
static final String ACTION_TaxiAppServer ="com.xixun.xy.conn.aidl.TaxiAppServer";
|
||||
static final String ACTION_CustomServer ="com.xixun.xy.conn.aidl.CustomService";
|
||||
static final String ACTION_ConnServer ="com.xixun.xy.conn.aidl.ConnService";
|
||||
static final String ACTION_AiServer ="com.sysolution.ai.AiAvatarService";
|
||||
public static final String PACKAGE_PLAYER="com.xixun.xixunplayer";
|
||||
public static final String PACKAGE_CARD_SYSTEM="com.xixun.joey.cardsystem";
|
||||
public static final String PACKAGE_LIVE="com.xixun.xy.live";
|
||||
public static final String PACKAGE_UPDATE="com.xixun.xy.update";
|
||||
public static final String PACKAGE_TAXIAPP = "net.sysolution.taxiapp";
|
||||
public static final String PACKAGE_CUSTOMAPP = "com.xixun.xixunledplayer";
|
||||
public static final String PACKAGE_BASICAPP = "net.sysolution.basicapp";
|
||||
public static final String PACKAGE_STARTER = "net.sysolution.starter";
|
||||
public static final String PACKAGE_DISPLAY = "com.xixun.display";
|
||||
public static final String PACKAGE_ORDER_VIDEO = "add.xixun.com.ordervideo";
|
||||
public static final String PACKAGE_JIESHUN = "com.xixun.stopguide";
|
||||
public static final String PACKAGE_TAXIAPP88 = "cn.trans88.taxiappkotlin";
|
||||
public static final String PACKAGE_AI = "com.sysolution.ai";
|
||||
public static final String PACKAGE_CONN = "com.xixun.xy.conn";
|
||||
|
||||
public static Intent newConnIntent(){
|
||||
Intent intent = new Intent(ACTION_ConnServer);
|
||||
intent.setPackage(PACKAGE_CONN);
|
||||
return intent;
|
||||
}
|
||||
public static Intent newAiIntent(){
|
||||
Intent intent = new Intent(ACTION_AiServer);
|
||||
intent.setPackage(PACKAGE_AI);
|
||||
return intent;
|
||||
}
|
||||
|
||||
public static Intent newCustomIntent(){
|
||||
Intent intent = new Intent(ACTION_CustomServer);
|
||||
intent.setPackage(PACKAGE_CUSTOMAPP);
|
||||
return intent;
|
||||
}
|
||||
|
||||
|
||||
public static Intent newTaxiAppIntent(){
|
||||
Intent intent = new Intent(ACTION_TaxiAppServer);
|
||||
intent.setPackage(PACKAGE_TAXIAPP);
|
||||
return intent;
|
||||
}
|
||||
|
||||
public static Intent newPlayerIntent(){
|
||||
Intent intent = new Intent(ACTION_PLAYER);
|
||||
intent.setPackage(PACKAGE_PLAYER);
|
||||
return intent;
|
||||
}
|
||||
public static Intent newCardSystemIntent(){
|
||||
Intent intent = new Intent(ACTION_CARD_SYSTEM);
|
||||
intent.setPackage(PACKAGE_CARD_SYSTEM);
|
||||
return intent;
|
||||
}
|
||||
public static Intent newLiveIntent(){
|
||||
Intent intent = new Intent(ACTION_LIVE);
|
||||
intent.setPackage(PACKAGE_LIVE);
|
||||
return intent;
|
||||
}
|
||||
public static Intent newUpdateIntent(){
|
||||
Intent intent = new Intent(ACTION_UPDATE);
|
||||
intent.setPackage(PACKAGE_UPDATE);
|
||||
return intent;
|
||||
}
|
||||
public static Intent newJieShunIntent(){
|
||||
Intent intent = new Intent(ACTION_JIESHUN);
|
||||
intent.setPackage(PACKAGE_JIESHUN);
|
||||
return intent;
|
||||
}
|
||||
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
IBinder binder = null;
|
||||
private Intent intent;
|
||||
private Context ctx;
|
||||
private int timeout;
|
||||
private IBinder[] container = new IBinder[1];
|
||||
private ServiceConnection conn = new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||
binder =service;
|
||||
ctx.unbindService(this);
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName name) {
|
||||
Log.i("yzd", "aidl disconnected");
|
||||
}
|
||||
};
|
||||
|
||||
public AidlUtil(Context context, Intent intent, int timeout) {
|
||||
ctx = context;
|
||||
this.intent =intent;
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
public AidlUtil(Context context, Intent intent) {
|
||||
this(context, intent, 3000);
|
||||
}
|
||||
static int rate =200;
|
||||
|
||||
public IBinder getIBinder() {
|
||||
ctx.bindService(intent, conn,
|
||||
Context.BIND_AUTO_CREATE);
|
||||
try {
|
||||
latch.await(timeout, TimeUnit.MILLISECONDS);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if(binder==null) {
|
||||
System.out.println("AIDL通讯建立失败");
|
||||
}
|
||||
return binder;
|
||||
}
|
||||
|
||||
/***
|
||||
* Android L (lollipop, API 21) introduced a new problem when trying to invoke implicit intent,
|
||||
* "java.lang.IllegalArgumentException: Service Intent must be explicit"
|
||||
*
|
||||
* If you are using an implicit intent, and know only 1 target would answer this intent,
|
||||
* This method will help you turn the implicit intent into the explicit form.
|
||||
*
|
||||
* Inspired from SO answer: http://stackoverflow.com/a/26318757/1446466
|
||||
* @param context
|
||||
* @param implicitIntent - The original implicit intent
|
||||
* @return Explicit Intent created from the implicit original intent
|
||||
*/
|
||||
public static Intent createExplicitFromImplicitIntent(Context context, Intent implicitIntent) {
|
||||
// Retrieve all services that can match the given intent
|
||||
PackageManager pm = context.getPackageManager();
|
||||
List<ResolveInfo> resolveInfo = pm.queryIntentServices(implicitIntent, 0);
|
||||
|
||||
// Make sure only one match was found
|
||||
if (resolveInfo == null || resolveInfo.size() != 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Get component info and create ComponentName
|
||||
ResolveInfo serviceInfo = resolveInfo.get(0);
|
||||
String packageName = serviceInfo.serviceInfo.packageName;
|
||||
String className = serviceInfo.serviceInfo.name;
|
||||
ComponentName component = new ComponentName(packageName, className);
|
||||
|
||||
// Create a new intent. Use the old one for extras and such reuse
|
||||
Intent explicitIntent = new Intent(implicitIntent);
|
||||
|
||||
// Set the component to be explicit
|
||||
explicitIntent.setComponent(component);
|
||||
|
||||
return explicitIntent;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -30,6 +30,8 @@ import androidx.core.content.ContextCompat;
|
|||
import com.xixun.joey.aidlset.CardService;
|
||||
import com.xixun.xy.conn.aidl.ConnService;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
|
@ -191,7 +193,7 @@ public class MainActivity extends Activity implements Choreographer.FrameCallbac
|
|||
state = 8;
|
||||
}
|
||||
|
||||
CardService serviCard;
|
||||
static CardService serviCard;
|
||||
ConnService serviXy;
|
||||
Intent intenCard;
|
||||
ServiceConnection connCard;
|
||||
|
|
@ -316,6 +318,7 @@ public class MainActivity extends Activity implements Choreographer.FrameCallbac
|
|||
Util.isScreenOn = serviCard.isScreenOpen();
|
||||
Util.screenWidth = serviCard.getScreenWidth();
|
||||
Util.screenHeight = serviCard.getScreenHeight();
|
||||
|
||||
Util.println(" IsScreenOn: "+Util.isScreenOn+" screen: "+Util.screenWidth+" x "+Util.screenHeight);
|
||||
backView.invalidate();
|
||||
if(Util.isScreenOn) initProg();
|
||||
|
|
@ -335,6 +338,7 @@ public class MainActivity extends Activity implements Choreographer.FrameCallbac
|
|||
bindService(intenCard, connCard, Context.BIND_AUTO_CREATE);
|
||||
services.add(connCard);
|
||||
|
||||
|
||||
var connXy = new ServiceConnection() {
|
||||
public void onServiceDisconnected(ComponentName name) {
|
||||
serviXy = null;
|
||||
|
|
|
|||
|
|
@ -7,15 +7,23 @@ import android.content.Intent;
|
|||
import android.content.IntentFilter;
|
||||
import android.os.IBinder;
|
||||
|
||||
import com.xixun.xy.conn.aidl.ConnService;
|
||||
|
||||
import net.lingala.zip4j.ZipFile;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Base64;
|
||||
import java.util.Comparator;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import gnph.util.IOs;
|
||||
import gnph.util.JSList;
|
||||
|
|
@ -56,7 +64,36 @@ public class MainService extends Service {
|
|||
new Thread(()->{
|
||||
try {
|
||||
if(Util.custom == Util.Custom.LoRa) {
|
||||
var id = Util.getCardId();
|
||||
System.out.println("周鹏测试");
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("_id","123456");
|
||||
jo.put("_type","GetCardAlias");
|
||||
String alias = MainActivity.serviCard.executeJsonCommand(jo.toString());
|
||||
JSONObject js = new JSONObject(alias);
|
||||
// 1. 从 JSONObject 中获取待解码的原始字符串(替换为你的 js.getString("alias"))
|
||||
String rawBase64Str = js.getString("alias");
|
||||
// 2. 关键:Base64 字符串预处理(解决大部分格式非法问题)
|
||||
String processedBase64Str = preprocessBase64(rawBase64Str);
|
||||
// 3. 后续正常解码(使用预处理后的字符串)
|
||||
byte[] decodeBytes = Base64.getDecoder().decode(processedBase64Str);
|
||||
String originalStr = new String(decodeBytes, StandardCharsets.UTF_8);
|
||||
System.out.println("周鹏获取别名"+originalStr);
|
||||
|
||||
Util.downId = 0;
|
||||
var ok = new AtomicBoolean(false);
|
||||
if(MainActivity.ins!=null) {
|
||||
var latch = new CountDownLatch(1);
|
||||
MainActivity.ins.runOnUiThread(() -> {
|
||||
ok.set(MainActivity.ins.delProgFile());
|
||||
latch.countDown();
|
||||
});
|
||||
try {
|
||||
latch.await();
|
||||
} catch (InterruptedException ignored) {}
|
||||
}
|
||||
|
||||
// var id = Util.getCardId();
|
||||
var id = originalStr;
|
||||
var dir = new File(path+"/"+id);
|
||||
if(! dir.isDirectory()) {
|
||||
Util.println("MEDIA_MOUNTED can't find "+id);
|
||||
|
|
@ -209,4 +246,34 @@ public class MainService extends Service {
|
|||
public IBinder onBind(Intent intent) {
|
||||
throw new UnsupportedOperationException("Not yet implemented");
|
||||
}
|
||||
/**
|
||||
* Base64 字符串预处理,清洗非法内容、补全合法格式
|
||||
* @param rawStr 原始待解码的 Base64 字符串
|
||||
* @return 符合标准 Base64 格式的预处理字符串
|
||||
*/
|
||||
private static String preprocessBase64(String rawStr) {
|
||||
if (rawStr == null || rawStr.trim().isEmpty()) {
|
||||
throw new IllegalArgumentException("待解码的 Base64 字符串不能为空");
|
||||
}
|
||||
|
||||
// 步骤1:剔除所有不可见字符(空格、换行、制表符等)
|
||||
String cleanStr = rawStr.replaceAll("\\s+", "");
|
||||
|
||||
// 步骤2:剔除 Base64 标准字符之外的非法字符(仅保留 A-Z、a-z、0-9、+、/、=)
|
||||
cleanStr = cleanStr.replaceAll("[^A-Za-z0-9+/=]", "");
|
||||
|
||||
// 步骤3:补全格式,使字符串长度为 4 的整数倍(不足补 =,最多补 3 个,实际只会补 0/1/2 个)
|
||||
int remainder = cleanStr.length() % 4;
|
||||
if (remainder != 0) {
|
||||
int padLength = 4 - remainder;
|
||||
StringBuilder sb = new StringBuilder(cleanStr);
|
||||
for (int i = 0; i < padLength; i++) {
|
||||
sb.append('=');
|
||||
}
|
||||
cleanStr = sb.toString();
|
||||
}
|
||||
|
||||
return cleanStr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.xixun.xixunplayer;
|
|||
import static android.view.View.VISIBLE;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.BitmapFactory;
|
||||
|
|
@ -152,10 +153,11 @@ public class TCPThread extends Thread {
|
|||
MainService.ins.startActivity(intent);
|
||||
}
|
||||
}
|
||||
if(MainService.ins!=null) {
|
||||
if(MainService.ins!=null) { //周鹏注释
|
||||
var intent = new Intent("com.xixun.AccessibilityService");
|
||||
intent.putExtra("newProgram", "TCP");
|
||||
MainService.ins.sendBroadcast(intent);
|
||||
|
||||
}
|
||||
}
|
||||
} else if("playZipTask".equals(_type)) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#Wed Oct 11 11:55:49 CST 2023
|
||||
#Fri Aug 22 14:42:52 CST 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
|
||||
|
|
|
|||
BIN
XixunPlayer/keystore/3568A视美泰.jks
Normal file
BIN
XixunPlayer/keystore/3568A视美泰.jks
Normal file
Binary file not shown.
BIN
XixunPlayer/keystore/3568D卓策 123456.keystore
Normal file
BIN
XixunPlayer/keystore/3568D卓策 123456.keystore
Normal file
Binary file not shown.
BIN
XixunPlayer/keystore/3568D恩泰世 123456.jks
Normal file
BIN
XixunPlayer/keystore/3568D恩泰世 123456.jks
Normal file
Binary file not shown.
BIN
XixunPlayer/keystore/M(美格).keystore
Normal file
BIN
XixunPlayer/keystore/M(美格).keystore
Normal file
Binary file not shown.
BIN
XixunPlayer/keystore/a133_android11_system.jks
Normal file
BIN
XixunPlayer/keystore/a133_android11_system.jks
Normal file
Binary file not shown.
BIN
XixunPlayer/keystore/platform.keystore
Normal file
BIN
XixunPlayer/keystore/platform.keystore
Normal file
Binary file not shown.
BIN
XixunPlayer/keystore/xixuncard
Normal file
BIN
XixunPlayer/keystore/xixuncard
Normal file
Binary file not shown.
BIN
XixunPlayer/keystore/yf356x_android11_system.jks
Normal file
BIN
XixunPlayer/keystore/yf356x_android11_system.jks
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user