This commit is contained in:
Gangphon 2026-01-23 15:14:23 +08:00
parent 4211abe679
commit e60923e456
22 changed files with 69 additions and 446 deletions

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
</component>
</project>

View File

@ -1,10 +0,0 @@
<?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>

View File

@ -4,9 +4,10 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="gradleJvm" value="jbr-17" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />

View File

@ -1,10 +0,0 @@
<?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>

View File

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<list size="1">
@ -6,7 +5,7 @@
</list>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="zulu-17" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -1,17 +0,0 @@
<?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>

View File

@ -11,99 +11,10 @@ android {
minSdk 21
targetSdk 34
versionCode 1
versionName "2.2.19-config-lora"
versionName "2.2.19-Y"
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
}
@ -112,6 +23,46 @@ android {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
signingConfigs {
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 {

View File

@ -1,102 +0,0 @@
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
}
}

View File

@ -2,9 +2,6 @@
<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" />

View File

@ -1,175 +0,0 @@
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;
}
}

View File

@ -30,8 +30,6 @@ 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;
@ -135,6 +133,7 @@ public class MainActivity extends Activity implements Choreographer.FrameCallbac
super.onDestroy();
Util.println("==<< MainActivity onDestroy <<<< this "+hashCode());
state = 8;
setContentView(backView);
if(insView!=null) {
insView.release();
insView = null;
@ -193,7 +192,7 @@ public class MainActivity extends Activity implements Choreographer.FrameCallbac
state = 8;
}
static CardService serviCard;
CardService serviCard;
ConnService serviXy;
Intent intenCard;
ServiceConnection connCard;
@ -318,7 +317,6 @@ 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();
@ -338,7 +336,6 @@ 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;
@ -516,47 +513,47 @@ public class MainActivity extends Activity implements Choreographer.FrameCallbac
}
}).start();
}
Util.isAudioLoss = false;
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
audioFocusRequest = new AudioFocusRequest.Builder(AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK).setOnAudioFocusChangeListener((int focusChange)-> {
switch (focusChange) {
case AudioManager.AUDIOFOCUS_GAIN:
Util.println("AUDIOFOCUS_GAIN");
Util.isAudioGain = true;
Util.isAudioLoss = false;
break;
case AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK:
Util.println("AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK");
Util.isAudioGain = true;
Util.isAudioLoss = false;
break;
case AudioManager.AUDIOFOCUS_LOSS:
Util.println("AUDIOFOCUS_LOSS");
Util.isAudioGain = false;
Util.isAudioLoss = true;
break;
case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT:
Util.println("AUDIOFOCUS_LOSS_TRANSIENT"); //短暂失去音频焦点暂停播放等待又一次获得音频焦点
Util.isAudioGain = false;
Util.isAudioLoss = true;
break;
case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK:
Util.println("AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK"); //减少声音就可以
Util.isAudioGain = false;
Util.isAudioLoss = true;
break;
}
View view;
if(Util.isAudioGain) {
if(insView!=null) {
for(int cc=0; cc<insView.getChildCount(); cc++) if((view = insView.getChildAt(cc)) instanceof SrcVideo) ((SrcVideo) view).ijkPlayer.setVolume(((SrcVideo) view).vol, ((SrcVideo) view).vol);
} else if(progView!=null) {
for(int cc=0; cc<progView.getChildCount(); cc++) if((view = progView.getChildAt(cc)) instanceof SrcVideo) ((SrcVideo) view).ijkPlayer.setVolume(((SrcVideo) view).vol, ((SrcVideo) view).vol);
}
} else {
if(Util.isAudioLoss) {
if(insView!=null) {
for(int cc=0; cc<insView.getChildCount(); cc++) if((view = insView.getChildAt(cc)) instanceof SrcVideo) ((SrcVideo) view).ijkPlayer.setVolume(0,0);
} else if(progView!=null) {
for(int cc=0; cc<progView.getChildCount(); cc++) if((view = progView.getChildAt(cc)) instanceof SrcVideo) ((SrcVideo) view).ijkPlayer.setVolume(0,0);
}
} else {
if(insView!=null) {
for(int cc=0; cc<insView.getChildCount(); cc++) if((view = insView.getChildAt(cc)) instanceof SrcVideo) ((SrcVideo) view).ijkPlayer.setVolume(((SrcVideo) view).vol, ((SrcVideo) view).vol);
} else if(progView!=null) {
for(int cc=0; cc<progView.getChildCount(); cc++) if((view = progView.getChildAt(cc)) instanceof SrcVideo) ((SrcVideo) view).ijkPlayer.setVolume(((SrcVideo) view).vol, ((SrcVideo) view).vol);
}
}
}).build();
Util.isAudioGain = true;
Util.println("requestAudioFocus: "+audioManager.requestAudioFocus(audioFocusRequest));
}
}

View File

@ -34,8 +34,8 @@ public class SrcVideo extends TextureView implements TextureView.SurfaceTextureL
try {
ijkPlayer.setDataSource(path);
ijkPlayer.setLooping(true);
if(Util.isAudioGain) ijkPlayer.setVolume(vol, vol);
else ijkPlayer.setVolume(0, 0);
if(Util.isAudioLoss) ijkPlayer.setVolume(0, 0);
else ijkPlayer.setVolume(vol, vol);
ijkPlayer.setOnPreparedListener((IMediaPlayer var1)->{
ijkPlayer.setOnPreparedListener(null);
if(getAlpha() < 0.25) {

View File

@ -3,7 +3,6 @@ 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;
@ -153,11 +152,10 @@ 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)) {

View File

@ -35,8 +35,8 @@ import wseemann.media.FFmpegMediaMetadataRetriever;
public class Util {
enum Custom{Normal, Yishi, LoRa};
public static final Custom custom = Custom.LoRa;
enum Custom{Normal, Yishi};
public static final Custom custom = Custom.Normal;
public static JSMap cfg;
public static SQLiteOpenHelper openHelper;
public static String serverURL;
@ -44,7 +44,7 @@ public class Util {
public static int screenWidth = 1920, screenHeight = 1080;
public static double lat, lng;
public static char cardType = 0;
public static boolean isScreenOn, isAudioGain, logOn;
public static boolean isScreenOn, isAudioLoss, logOn;
public static void initDir(Context ctx) {
var dir = Build.VERSION.SDK_INT < Build.VERSION_CODES.R ? Environment.getExternalStorageDirectory().getAbsolutePath() + "/XixunPlayer" : ctx.getExternalFilesDir(null).getAbsolutePath();

Binary file not shown.