Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bfc45a0
Feat: Modernize build system and update Core submodule
barissalihbabacan Sep 9, 2025
1b848fe
Fix: Add maven-publish plugin to enable JitPack builds
barissalihbabacan Sep 9, 2025
71ffa6b
Fix: Finalize build fixes for JitPack compatibility
barissalihbabacan Sep 9, 2025
881de78
Refactor build.gradle and update dependencies
barissalihbabacan Sep 9, 2025
c40ef4d
Fix: Resolve critical build errors and add missing dependencies
barissalihbabacan Sep 9, 2025
174e9de
Refactor build.gradle for conciseness and modern practices
barissalihbabacan Sep 9, 2025
0df02e2
Remove lgcast-android-lib.jar.jar
barissalihbabacan Sep 9, 2025
82951c4
Add localbroadcastmanager dependency
barissalihbabacan Sep 9, 2025
194f46a
Simplify `sourceSets` and add `useLibrary 'org.apache.http.legacy'`
barissalihbabacan Sep 9, 2025
2649bdb
Enable BuildConfig generation
barissalihbabacan Sep 9, 2025
7b8c342
Refactor: Remove BuildConfig usage and update foreground service start
barissalihbabacan Sep 9, 2025
79615f0
Update dependencies and simplify build.gradle
barissalihbabacan Sep 9, 2025
e09d3a7
Downgrade Java-WebSocket and move dependencies
barissalihbabacan Sep 9, 2025
e96281b
Update test dependencies and `DiscoveryManager` initialization
barissalihbabacan Sep 9, 2025
5c0f65f
Refactor: Update test dependencies and migrate to AndroidX Test APIs
barissalihbabacan Sep 9, 2025
40ba4e2
Add group and version to build scripts
barissalihbabacan Sep 9, 2025
b553dbb
Add Maven publishing configuration
barissalihbabacan Sep 9, 2025
40f2b77
Remove publishing configuration from build.gradle files
barissalihbabacan Sep 10, 2025
6763dbf
Refactor build scripts and add Maven local publishing
barissalihbabacan Sep 10, 2025
8dd7c61
Refactor Gradle setup and update dependencies
barissalihbabacan Sep 11, 2025
9cca30d
Refactor Gradle configuration and update dependencies
barissalihbabacan Sep 11, 2025
aa0b673
Add Maven publishing for core module and update JitPack build
barissalihbabacan Sep 12, 2025
ebce4e5
Update build.gradle
barissalihbabacan Sep 13, 2025
2b65235
Update dependencies and streamline publishing
barissalihbabacan Sep 13, 2025
d381432
Refactor: Modernize Gradle structure and add POM for core module
barissalihbabacan Sep 15, 2025
f2b21c6
Refactor: Streamline source sets and update HttpClient dependency
barissalihbabacan Sep 15, 2025
89fb1e1
Refactor: Standardize build scripts and update dependencies
barissalihbabacan Sep 15, 2025
a53fd42
Refactor: Update Android Gradle Plugin and Apache HTTP Client
barissalihbabacan Sep 15, 2025
c683e4a
Refactor: Streamline build configuration and dependency management
barissalihbabacan Sep 15, 2025
ac32f9d
Update libc++_shared.so for arm64-v8a and armeabi-v7a
barissalihbabacan Sep 20, 2025
b41fffa
Refactor: Update source sets and dependencies for module integration
barissalihbabacan Sep 22, 2025
41f29c8
feat: Integrate official Android 15 (16KB) aligned native binaries
barissalihbabacan Jan 11, 2026
22fc284
Merge remote-tracking branch 'upstream/master'
barissalihbabacan Jan 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.connectsdk.androidcore"
android:versionCode="8"
android:versionName="1.4.2" >
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application android:usesCleartextTraffic="true">
<!-- Class referenced in the manifest, com.connectsdk.androidcore.ScreenOnOffReceiver, was not found in the project or the libraries -->

<uses-library android:name="org.apache.http.legacy" android:required="false" />

<receiver android:name=".ScreenOnOffReceiver"
android:exported="false">
<intent-filter>
Expand Down
140 changes: 91 additions & 49 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,73 +1,115 @@
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
}
}

allprojects {
repositories {
google()
mavenCentral()
}
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'maven-publish'
}

apply plugin: 'com.android.library'
group = 'com.github.Astro-bosss'

android {
compileSdkVersion 31
buildToolsVersion '30.0.3'
namespace 'com.connectsdk'
compileSdk 34

packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
useLibrary 'org.apache.http.legacy'

defaultConfig {
minSdk 24
targetSdk 34
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = [
'src',
'core/src',
'modules/google_cast/src'
'../modules/google_cast/src',
'../modules/firetv/src'
]
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
jniLibs.srcDirs = ['jniLibs']
assets.srcDirs = ['assets']
}
androidTest {
java.srcDirs = [
'core/test/src',
'modules/google_cast/test/src'
]
}
}
buildTypes {
release {
minifyEnabled false
}

buildFeatures {
buildConfig true
}
defaultConfig {
minSdkVersion 24
targetSdkVersion 31

packagingOptions {
resources.excludes += '/META-INF/{AL2.0,LGPL2.1}'
}

useLibrary 'org.apache.http.legacy'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

publishing {
singleVariant('release') {
withSourcesJar()
}
}
}

dependencies {
implementation 'org.java-websocket:Java-WebSocket:1.3.9'
implementation 'javax.jmdns:jmdns:3.4.1'
implementation 'androidx.preference:preference:1.1.1'
implementation 'com.google.android.gms:play-services-cast:19.0.0'
implementation 'com.googlecode.plist:dd-plist:1.23'
implementation 'com.nimbusds:srp6a:2.1.0'
implementation 'net.i2p.crypto:eddsa:0.3.0'
// Projenin diğer tüm bağımlılıkları
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.1.0"
implementation "org.java-websocket:Java-WebSocket:1.5.7"
implementation "org.jmdns:jmdns:3.5.9"
implementation "androidx.preference:preference:1.2.1"
implementation "com.google.android.gms:play-services-cast-framework:21.4.0"
implementation "com.googlecode.plist:dd-plist:1.28"
implementation "com.nimbusds:srp6a:2.1.0"
implementation "net.i2p.crypto:eddsa:0.3.0"
implementation 'androidx.mediarouter:mediarouter:1.6.0'
implementation 'androidx.appcompat:appcompat:1.6.1'

implementation fileTree(dir: '../modules/firetv/libs', include: ['*.jar'])
}

// Manuel 'task sourcesJar' görevine artık ihtiyacımız yok, çünkü yukarıdaki
// 'android.publishing' bloğu bu işi otomatik ve hatasız yapıyor.

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
// 'from components.release' komutu, AGP'nin 'publishing' bloğunda
// hazırladığı hem .aar hem de -sources.jar dosyalarını otomatik olarak alır.
from components.release

// 'group' yukarıda tanımlandığı için buradan okunacak
artifactId = "Connect-SDK-Android"
version = project.findProperty("version") ?: "1.0.0-SNAPSHOT"

// 'artifact(sourcesJar)' satırına artık gerek yok.

// Otomatik olarak oluşturulacak pom.xml dosyasının içeriği
pom {
name = "Connect SDK Android"
description = "Modernized fork of Connect SDK for Android to support AndroidX and modern Gradle."
url = "https://github.com/Astro-bosss/Connect-SDK-Android"
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'Astro-bosss'
name = 'Baris Salih Babacan'
}
}
scm {
connection = 'scm:git:github.com/Astro-bosss/Connect-SDK-Android.git'
developerConnection = 'scm:git:ssh://github.com/Astro-bosss/Connect-SDK-Android.git'
url = 'https://github.com/Astro-bosss/Connect-SDK-Android/tree/master'
}
}
}
}
}
}
Binary file modified jniLibs/armeabi-v7a/libc++_shared.so
Binary file not shown.
Binary file removed libs/lgcast-android-lib.jar.jar
Binary file not shown.
30 changes: 15 additions & 15 deletions src/com/connectsdk/discovery/DiscoveryManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import android.net.wifi.WifiManager.MulticastLock;
import android.util.Log;

import com.connectsdk.DefaultPlatform;
//import com.connectsdk.DefaultPlatform;
import com.connectsdk.core.Util;
import com.connectsdk.device.ConnectableDevice;
import com.connectsdk.device.ConnectableDeviceListener;
Expand Down Expand Up @@ -399,19 +399,19 @@ public boolean deviceIsCompatible(ConnectableDevice device) {
* + AirPlayService
*/
@SuppressWarnings("unchecked")
public void registerDefaultDeviceTypes() {
final HashMap<String, String> devicesList = DefaultPlatform.getDeviceServiceMap();

for (HashMap.Entry<String, String> entry : devicesList.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
try {
registerDeviceService((Class<DeviceService>) Class.forName(key), (Class<DiscoveryProvider>)Class.forName(value));
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}
// public void registerDefaultDeviceTypes() {
// final HashMap<String, String> devicesList = DefaultPlatform.getDeviceServiceMap();
//
// for (HashMap.Entry<String, String> entry : devicesList.entrySet()) {
// String key = entry.getKey();
// String value = entry.getValue();
// try {
// registerDeviceService((Class<DeviceService>) Class.forName(key), (Class<DiscoveryProvider>)Class.forName(value));
// } catch (ClassNotFoundException e) {
// e.printStackTrace();
// }
// }
// }

/**
* Registers a DeviceService with DiscoveryManager and tells it which DiscoveryProvider to use to find it. Each DeviceService has a JSONObject of discovery parameters that its DiscoveryProvider will use to find it.
Expand Down Expand Up @@ -549,7 +549,7 @@ public void start() {
@Override
public void run() {
if (discoveryProviders.size() == 0) {
registerDefaultDeviceTypes();
//registerDefaultDeviceTypes();
}

ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
public class ZeroconfDiscoveryProvider implements DiscoveryProvider {
private static final String HOSTNAME = "connectsdk";

JmDNS jmdns;
JmDNS jmdns; /// Cannot resolve symbol 'JmDNS'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implementation 'javax.jmdns:jmdns:3.4.1'

InetAddress srcAddress;

private Timer scanTimer;
Expand All @@ -59,19 +59,19 @@ public class ZeroconfDiscoveryProvider implements DiscoveryProvider {

boolean isRunning = false;

ServiceListener jmdnsListener = new ServiceListener() {
ServiceListener jmdnsListener = new ServiceListener() { /// Cannot resolve symbol 'ServiceListener'

@Override
public void serviceResolved(ServiceEvent ev) {
public void serviceResolved(ServiceEvent ev) { /// Cannot resolve symbol 'ServiceEvent'
@SuppressWarnings("deprecation")
String ipAddress = ev.getInfo().getHostAddress();
String ipAddress = ev.getInfo().getHostAddress(); /// Cannot resolve method 'getInfo()'
if (!Util.isIPv4Address(ipAddress)) {
// Currently, we only support ipv4
return;
}

String friendlyName = ev.getInfo().getName();
int port = ev.getInfo().getPort();
String friendlyName = ev.getInfo().getName(); /// Cannot resolve method 'getInfo()'
int port = ev.getInfo().getPort(); /// Cannot resolve method 'getInfo()'

ServiceDescription foundService = foundServices.get(ipAddress);

Expand All @@ -81,9 +81,9 @@ public void serviceResolved(ServiceEvent ev) {
if (isNew) {
foundService = new ServiceDescription();
foundService.setUUID(ipAddress);
foundService.setServiceFilter(ev.getInfo().getType());
foundService.setServiceFilter(ev.getInfo().getType()); /// Cannot resolve method 'getInfo()'
foundService.setIpAddress(ipAddress);
foundService.setServiceID(serviceIdForFilter(ev.getInfo().getType()));
foundService.setServiceID(serviceIdForFilter(ev.getInfo().getType())); /// Cannot resolve method 'getInfo()'
foundService.setPort(port);
foundService.setFriendlyName(friendlyName);

Expand All @@ -109,9 +109,9 @@ public void serviceResolved(ServiceEvent ev) {
}

@Override
public void serviceRemoved(ServiceEvent ev) {
public void serviceRemoved(ServiceEvent ev) { /// Cannot resolve symbol 'ServiceEvent'
@SuppressWarnings("deprecation")
String uuid = ev.getInfo().getHostAddress();
String uuid = ev.getInfo().getHostAddress(); /// Cannot resolve method 'getInfo()'
final ServiceDescription service = foundServices.get(uuid);

if (service != null) {
Expand All @@ -128,10 +128,10 @@ public void run() {
}

@Override
public void serviceAdded(ServiceEvent event) {
public void serviceAdded(ServiceEvent event) { /// Cannot resolve symbol 'ServiceEvent'
// Required to force serviceResolved to be called again
// (after the first search)
jmdns.requestServiceInfo(event.getType(), event.getName(), 1);
jmdns.requestServiceInfo(event.getType(), event.getName(), 1); /// Cannot resolve method 'requestServiceInfo(String, String, int)' and Cannot resolve method 'getType()' and Cannot resolve method 'getName()'
}
};

Expand Down Expand Up @@ -159,9 +159,9 @@ public void start() {
scanTimer.schedule(new MDNSSearchTask(), 100, RESCAN_INTERVAL);
}

protected JmDNS createJmDNS() throws IOException {
protected JmDNS createJmDNS() throws IOException { /// Cannot resolve symbol 'JmDNS'
if (srcAddress != null)
return JmDNS.create(srcAddress, HOSTNAME);
return JmDNS.create(srcAddress, HOSTNAME); /// Cannot resolve symbol 'JmDNS'
else
return null;
}
Expand Down Expand Up @@ -216,7 +216,7 @@ public void stop() {
if (jmdns != null) {
for (DiscoveryFilter searchTarget : serviceFilters) {
String filter = searchTarget.getServiceFilter();
jmdns.removeServiceListener(filter, jmdnsListener);
jmdns.removeServiceListener(filter, jmdnsListener); /// Cannot resolve method 'removeServiceListener(String, ServiceListener)'
}
}
}
Expand All @@ -237,15 +237,15 @@ public void reset() {
public void rescan() {
try {
if (jmdns != null) {
jmdns.close();
jmdns.close(); /// Cannot resolve method 'close()'
jmdns = null;
}
jmdns = createJmDNS();

if (jmdns != null) {
for (DiscoveryFilter searchTarget : serviceFilters) {
String filter = searchTarget.getServiceFilter();
jmdns.addServiceListener(filter, jmdnsListener);
jmdns.addServiceListener(filter, jmdnsListener); /// Cannot resolve method 'addServiceListener(String, ServiceListener)'
}
}
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.content.Intent;
import android.content.pm.ServiceInfo;
import android.content.res.Configuration;
import android.os.Build;
import android.os.IBinder;
import android.util.Size;
import android.view.Surface;
Expand Down Expand Up @@ -62,7 +63,7 @@ public class CameraService extends Service {
@Override
public void onCreate() {
super.onCreate();
Logger.showDebug(com.connectsdk.BuildConfig.DEBUG);
//Logger.showDebug(com.connectsdk.BuildConfig.DEBUG);
mServiceHandler = new HandlerThreadEx("CameraService Handler");
mServiceHandler.start();
}
Expand Down Expand Up @@ -276,7 +277,7 @@ private void sendSetParameterResponse(boolean result, @NonNull JSONObject camera

Logger.print("executeStart");
start(intent, connectionListener);
if (com.connectsdk.BuildConfig.DEBUG == true) AppUtil.showToastLong(this, "########## DEBUG version ##########");
//if (com.connectsdk.BuildConfig.DEBUG == true) AppUtil.showToastLong(this, "########## DEBUG version ##########");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add

buildFeatures {
    buildConfig true
}

to gradle

}

private void executeStop() {
Expand Down Expand Up @@ -365,7 +366,9 @@ private void stop() {

private void initializeService(@NonNull Intent intent) {
Logger.print("initializeService (SDK version=%s)", IOUtil.readRawResourceText(this, R.raw.lgcast_version));
startForeground(RemoteCameraConfig.Notification.ID, CameraServiceFunc.createNotification(this), ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(RemoteCameraConfig.Notification.ID, CameraServiceFunc.createNotification(this), ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE);
}
}

private void terminateService() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class MirroringService extends Service {
@Override
public void onCreate() {
super.onCreate();
Logger.showDebug(com.connectsdk.BuildConfig.DEBUG);
//Logger.showDebug(com.connectsdk.BuildConfig.DEBUG);
mServiceHandler = new HandlerThreadEx("MirroringService Handler");
mServiceHandler.start();

Expand Down Expand Up @@ -200,7 +200,7 @@ public void onError(ConnectionManagerError connectionError, String errorMessage)

Logger.print("executeStart");
start(intent, connectionListener);
if (com.connectsdk.BuildConfig.DEBUG == true) AppUtil.showToastLong(this, "########## DEBUG version ##########");
//if (com.connectsdk.BuildConfig.DEBUG == true) AppUtil.showToastLong(this, "########## DEBUG version ##########");
}

private void executeStop() {
Expand Down
Loading