Skip to content

Commit 91e35fd

Browse files
v1.0.0+gh.r3
1 parent 6c46131 commit 91e35fd

File tree

1,316 files changed

+75982
-8592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,316 files changed

+75982
-8592
lines changed

.github/workflows/asm_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Rv2
1+
name: Build Android Code Studio
22

33
on:
44
push:
@@ -23,7 +23,7 @@ on:
2323

2424
jobs:
2525
build_release_apk:
26-
name: Build Release APK
26+
name: Build Debug APK
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Cancel previous runs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ clear_runs.py
55
autopush.sh
66
server
77
java/lsp/src/main/java/com/tom/rv2ide/lsp/clang
8+
local.properties
89

910
# Crowdin
1011
crowdin.properties

composite-builds/build-logic/common/src/main/java/com/tom/rv2ide/build/config/ProjectConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ val Project.projectVersionCode: Int
6363
get() {
6464

6565
// I don't like this being hardcoded here, so change it if you want.
66-
val baseVersionCode = System.getenv("PROJECT_CONFIG_KT_BASE_VERSION_CODE")?.toIntOrNull() ?: 1021
66+
val baseVersionCode = System.getenv("PROJECT_CONFIG_KT_BASE_VERSION_CODE")?.toIntOrNull() ?: 1022
6767
// Default value (1020) is used if not specified. The middle digit (e.g., 10<2>0) represents the revision version, such as 1.0.0+gh.r0<2>.
6868

6969
val versionCode = baseVersionCode

composite-builds/build-logic/plugins/src/main/java/com/tom/rv2ide/plugins/AndroidIDEAssetsPlugin.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class AndroidIDEAssetsPlugin : Plugin<Project> {
5353
}
5454

5555
androidComponentsExtension.onVariants { variant ->
56-
val variantNameCapitalized = variant.name.capitalized()
57-
56+
val variantNameCapitalized = variant.name.replaceFirstChar { it.uppercase() }
57+
5858
// variant.sources.jniLibs?.addGeneratedSourceDirectory(setupAapt2TaskTaskProvider,
5959
// SetupAapt2Task::outputDirectory)
6060

composite-builds/build-logic/plugins/src/main/java/com/tom/rv2ide/plugins/conf/AndroidModuleConf.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import org.gradle.api.provider.Provider
3939
* For example, if the base version code of the IDE is 270 (for v2.7.0), then for arm64-v8a flavor,
4040
* the version code will be `100 * 270 + 1` i.e. `27001`
4141
*/
42-
internal val flavorsAbis = mapOf("arm64-v8a" to 1, "armeabi-v7a" to 2)
42+
internal val flavorsAbis = mapOf("arm64-v8a" to 1, "armeabi-v7a" to 1)
4343

4444
fun Project.configureAndroidModule(coreLibDesugDep: Provider<MinimalExternalModuleDependency>) {
4545
val isAppModule = plugins.hasPlugin("com.android.application")
@@ -198,4 +198,5 @@ private fun Project.configureCoreLibDesugaring(
198198
if (coreLibDesugaringEnabled) {
199199
project.dependencies.add("coreLibraryDesugaring", coreLibDesugDep)
200200
}
201+
201202
}

core/app/build.gradle.kts

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ buildscript {
4242
}
4343
}
4444

45+
tasks.configureEach {
46+
if (name.contains("desugar", ignoreCase = true)) {
47+
enabled = false
48+
}
49+
}
50+
4551
configurations.all {
4652
resolutionStrategy {
4753
force("com.google.guava:guava:32.1.3-android")
@@ -63,25 +69,28 @@ android {
6369
applicationId = BuildConfig.packageName
6470
vectorDrawables.useSupportLibrary = true
6571
}
72+
73+
experimentalProperties["android.experimental.enableGlobalSynthetics"] = true
74+
6675

67-
signingConfigs {
68-
create("custom") {
69-
val keyStorePath = "${rootProject.projectDir}/signing/signing-key.jks"
70-
val keyStoreFile = file(keyStorePath)
71-
72-
val signing_storePassword = System.getenv("SIGNING_STORE_PASSWORD") ?: ""
73-
val signing_keyPassword = System.getenv("SIGNING_KEY_PASSWORD") ?: ""
74-
75-
storeFile = keyStoreFile
76-
storePassword = signing_storePassword
77-
keyAlias = "AndroidCS"
78-
keyPassword = signing_keyPassword
79-
}
80-
}
76+
signingConfigs {
77+
create("custom") {
78+
val keyStorePath = "${rootProject.projectDir}/signing/signing-key.jks"
79+
val keyStoreFile = file(keyStorePath)
80+
81+
val signing_storePassword = System.getenv("SIGNING_STORE_PASSWORD") ?: ""
82+
val signing_keyPassword = System.getenv("SIGNING_KEY_PASSWORD") ?: ""
83+
84+
storeFile = keyStoreFile
85+
storePassword = signing_storePassword
86+
keyAlias = "AndroidCS"
87+
keyPassword = signing_keyPassword
88+
}
89+
}
8190

8291
androidResources { generateLocaleConfig = true }
8392

84-
buildFeatures {
93+
buildFeatures {
8594
aidl = true
8695
dataBinding = true
8796
}
@@ -96,7 +105,7 @@ signingConfigs {
96105
signingConfig = signingConfigs.getByName("custom")
97106
}
98107
}
99-
108+
100109
lint {
101110
abortOnError = false
102111
disable.addAll(arrayOf("VectorPath", "NestedWeights", "ContentDescription", "SmallSp"))
@@ -180,9 +189,12 @@ dependencies {
180189

181190
// external deps here
182191
implementation("com.github.Dimezis:BlurView:version-3.2.0")
192+
implementation("androidx.security:security-crypto:1.1.0-alpha06")
183193
implementation(projects.external.acsprovider)
184194
implementation(projects.external.atc)
185195
implementation(libs.external.customizable.cardview)
196+
implementation(projects.external.logwire)
197+
implementation(libs.external.seasonal.effects)
186198

187199
// Annotation processors
188200
kapt(libs.common.glide.ap)
@@ -262,6 +274,7 @@ dependencies {
262274
implementation(projects.event.eventbusAndroid)
263275
implementation(projects.event.eventbusEvents)
264276
implementation(projects.java.javacServices)
277+
implementation(projects.java.lspSetup)
265278
implementation(projects.java.lsp)
266279
implementation(projects.logging.idestats)
267280
implementation(projects.logging.logsender)

core/app/proguard-rules.pro

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,9 @@
147147
-dontwarn org.ietf.jgss.GSSException
148148
-dontwarn org.ietf.jgss.GSSManager
149149
-dontwarn org.ietf.jgss.GSSName
150-
-dontwarn org.ietf.jgss.Oid
150+
-dontwarn org.ietf.jgss.Oid
151+
152+
-keep class * extends java.lang.Record { *; }
153+
-keepclassmembers class * extends java.lang.Record {
154+
<init>(...);
155+
}

core/app/src/main/AndroidManifest.xml

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<uses-permission
2020
android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
2121
tools:ignore="ScopedStorage" />
22+
<uses-permission android:name="android.permission.READ_LOGS" />
2223
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
2324
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
2425
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
@@ -31,8 +32,7 @@
3132
android:enableOnBackInvokedCallback="true"
3233
android:extractNativeLibs="true"
3334
android:hardwareAccelerated="true"
34-
android:icon="@mipmap/ic_launcher"
35-
android:roundIcon="@mipmap/ic_launcher"
35+
android:icon="@drawable/ic_acside"
3636
android:label="@string/app_name"
3737
android:largeHeap="true"
3838
android:name=".app.IDEApplication"
@@ -41,6 +41,7 @@
4141
android:resizeableActivity="false"
4242
android:supportsRtl="true"
4343
android:theme="@style/Theme.AndroidIDE"
44+
android:networkSecurityConfig="@xml/network_security_config"
4445
tools:ignore="DiscouragedApi,MediaCapabilities,UnusedAttribute">
4546
<activity
4647
android:exported="true"
@@ -76,6 +77,7 @@
7677
<activity android:name=".activities.AboutActivity" />
7778
<activity android:name=".activities.ContributorsActivity" />
7879
<activity android:name=".activities.IDEConfigurations" />
80+
<activity android:name=".activities.ActivityM3Icons" />
7981

8082
<activity
8183
android:name=".activities.TerminalActivity"
@@ -96,6 +98,16 @@
9698
android:exported="false"
9799
android:theme="@style/Theme.AndroidIDE" />
98100

101+
<activity
102+
android:name=".activities.FileBrowserActivity"
103+
android:exported="false"
104+
android:theme="@style/Theme.AndroidIDE" />
105+
106+
<activity
107+
android:name=".activities.NCrashHandlerActivity"
108+
android:exported="false"
109+
android:theme="@style/Theme.AndroidIDE" />
110+
99111
<provider
100112
android:authorities="com.tom.rv2ide.documents"
101113
android:exported="true"
@@ -142,13 +154,26 @@
142154
android:name=".services.builder.GradleBuildService" />
143155

144156
<service
145-
android:exported="true"
146-
android:name=".services.log.LogReceiverService"
147-
android:permission="com.tom.rv2ide.permission.BIND_LOG_SERVICE">
148-
<intent-filter>
149-
<action android:name="com.tom.rv2ide.LOG_SERVICE_ACTION" />
150-
</intent-filter>
157+
android:name="com.termux.app.TermuxService"
158+
android:enabled="true"
159+
android:exported="false"
160+
android:stopWithTask="true" />
161+
162+
<service
163+
android:name="io.github.mohammedbaqernull.logger.service.LogReceiverService"
164+
android:enabled="true"
165+
android:exported="true">
151166
</service>
167+
168+
<!-- <service -->
169+
<!-- android:exported="true" -->
170+
<!-- android:name=".services.log.LogReceiverService" -->
171+
<!-- android:permission="com.tom.rv2ide.permission.BIND_LOG_SERVICE"> -->
172+
<!-- <intent-filter> -->
173+
<!-- <action android:name="com.tom.rv2ide.LOG_SERVICE_ACTION" /> -->
174+
<!-- </intent-filter> -->
175+
<!-- </service> -->
176+
152177
<service
153178
android:enabled="false"
154179
android:exported="false"

core/app/src/main/assets/icons.zip

3.5 MB
Binary file not shown.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
/*
2+
* This file is part of AndroidCodeStudio.
3+
*
4+
* AndroidCodeStudio is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* AndroidCodeStudio is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with AndroidCodeStudio. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.tom.rv2ide.actions.etc
19+
20+
import android.content.Context
21+
import androidx.core.content.ContextCompat
22+
import androidx.lifecycle.lifecycleScope
23+
import com.tom.rv2ide.actions.ActionData
24+
import com.tom.rv2ide.actions.ActionItem
25+
import com.tom.rv2ide.actions.ActionMenu
26+
import com.tom.rv2ide.actions.EditorActivityAction
27+
import com.tom.rv2ide.editor.schemes.IDEColorSchemeProvider
28+
import com.tom.rv2ide.preferences.internal.EditorPreferences
29+
import com.tom.rv2ide.resources.R
30+
import com.tom.rv2ide.tasks.launchAsyncWithProgress
31+
import kotlinx.coroutines.Dispatchers
32+
import kotlinx.coroutines.withContext
33+
import com.tom.rv2ide.editor.schemes.IDEColorScheme
34+
import com.tom.rv2ide.editor.ui.IDEEditor
35+
36+
/**
37+
* @author Mohammed-baqer-null @ https://github.com/Mohammed-baqer-null
38+
*/
39+
40+
class ColorSchemeMenu(context: Context, override val order: Int) :
41+
EditorActivityAction(), ActionMenu {
42+
43+
override val children: MutableSet<ActionItem> = mutableSetOf()
44+
override val id: String = "ide.editor.color.scheme"
45+
46+
init {
47+
label = context.getString(R.string.idepref_editor_colorScheme)
48+
icon = ContextCompat.getDrawable(context, R.drawable.ic_color_scheme)
49+
val schemes = IDEColorSchemeProvider.list()
50+
schemes.forEachIndexed { index, scheme ->
51+
addAction(ColorSchemeAction(context, scheme, index))
52+
}
53+
addAction(ReloadColorSchemesAction(context, schemes.size))
54+
}
55+
56+
override fun prepare(data: ActionData) {
57+
super<EditorActivityAction>.prepare(data)
58+
super<ActionMenu>.prepare(data)
59+
val currentScheme = EditorPreferences.colorScheme
60+
children.forEach { item ->
61+
if (item is ColorSchemeAction) {
62+
item.visible = true
63+
}
64+
}
65+
66+
if (!visible) {
67+
return
68+
}
69+
70+
val editor = data.get(IDEEditor::class.java)
71+
if (editor == null) {
72+
visible = false
73+
enabled = false
74+
return
75+
}
76+
77+
if (!editor.isEditable) {
78+
visible = false
79+
enabled = false
80+
return
81+
}
82+
83+
visible = true
84+
enabled = true
85+
}
86+
}
87+
88+
class ColorSchemeAction(
89+
context: Context,
90+
private val scheme: IDEColorScheme,
91+
override val order: Int
92+
) : EditorActivityAction() {
93+
94+
override val id: String = "ide.editor.colorScheme.${scheme.key}"
95+
override var requiresUIThread: Boolean = true
96+
97+
init {
98+
label = scheme.name
99+
}
100+
101+
override suspend fun execAction(data: ActionData): Boolean {
102+
EditorPreferences.colorScheme = scheme.key
103+
104+
val context = data.requireActivity()
105+
context.lifecycleScope.launchAsyncWithProgress(
106+
context = Dispatchers.Default,
107+
configureFlashbar = { builder, _ ->
108+
builder.message(R.string.please_wait)
109+
},
110+
) { flashbar, _ ->
111+
IDEColorSchemeProvider.reload()
112+
withContext(Dispatchers.Main) {
113+
flashbar.dismiss()
114+
}
115+
}
116+
117+
return true
118+
}
119+
}

0 commit comments

Comments
 (0)