diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000000000000000000000000000000000000..a6d61c48a44e66d33129012046416187debbd36e
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,4 @@
+[submodule "matrix-android-sdk"]
+	path = matrix-android-sdk
+	url = https://gitlab.futo.org/circles/matrix-android-sdk.git
+	branch = main
diff --git a/app/build.gradle b/app/build.gradle
index 8f50bf06490feb4045013850155a47f4da9eabc7..9617344b6b17ece7f1ab7ece041db10194a6435f 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -49,10 +49,7 @@ android {
 }
 
 dependencies {
-    //Matrix
-    implementation 'org.matrix.android:matrix-sdk-android:v1.4.4'
-    implementation 'com.squareup.okhttp3:okhttp:4.9.3'
-
+    implementation project(':matrix-android-sdk:matrix-sdk-android')
     implementation 'androidx.appcompat:appcompat:1.4.1'
     implementation 'com.google.android.material:material:1.5.0'
     implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
diff --git a/matrix-android-sdk b/matrix-android-sdk
new file mode 160000
index 0000000000000000000000000000000000000000..ee9747283a69afe99022f0f2884671bb307f1cc0
--- /dev/null
+++ b/matrix-android-sdk
@@ -0,0 +1 @@
+Subproject commit ee9747283a69afe99022f0f2884671bb307f1cc0
diff --git a/settings.gradle b/settings.gradle
index 99b371d8fc7e428f373bdb30e742c89f0c92cae8..b0b529fa118149cf069151791ad99ed264461bfd 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,7 +1,3 @@
 rootProject.name = "Circles"
 include ':app'
-sourceControl {
-    gitRepository("https://gitlab.futo.org/circles/matrix-android-sdk.git") {
-        producesModule("org.matrix.android:matrix-sdk-android")
-    }
-}
\ No newline at end of file
+include ':matrix-android-sdk:matrix-sdk-android'
\ No newline at end of file