Skip to content

Commit 13c6786

Browse files
?
1 parent 154a607 commit 13c6786

File tree

3 files changed

+142
-43
lines changed

3 files changed

+142
-43
lines changed

.github/workflows/asm_build.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Build Rv2
2+
3+
on:
4+
push:
5+
branches:
6+
- "dev"
7+
- "main"
8+
- "indexing"
9+
- "release/**"
10+
paths-ignore:
11+
- '**.md'
12+
- '**.json'
13+
- 'fastlane/**'
14+
- '.github/workflows/crowdin_contributors.yml'
15+
pull_request:
16+
branches: [ "dev" ]
17+
paths-ignore:
18+
- '**.md'
19+
- '**.json'
20+
- 'fastlane/**'
21+
- '.github/workflows/crowdin_contributors.yml'
22+
workflow_dispatch: { }
23+
24+
jobs:
25+
build_release_apk:
26+
name: Build Release APK
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Cancel previous runs
30+
uses: styfle/cancel-workflow-action@0.12.1
31+
with:
32+
access_token: ${{ github.token }}
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
with:
36+
submodules: 'recursive'
37+
fetch-depth: 0
38+
- name: Set up JDK 17
39+
uses: actions/setup-java@v4
40+
with:
41+
java-version: '17'
42+
distribution: 'adopt'
43+
- name: Change Gradle wrapper permissions
44+
run: chmod +x ./gradlew
45+
- name: Restore cache
46+
uses: actions/cache@v4
47+
with:
48+
path: |
49+
~/.gradle/caches
50+
~/.gradle/wrapper
51+
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*') }}
52+
restore-keys: |
53+
${{ runner.os }}-gradle-
54+
- name: Create local.properties
55+
run: |
56+
echo "signing.storeFile=signing/signing-key.jks" >> local.properties
57+
echo "signing.storePassword=123456" >> local.properties
58+
echo "signing.keyAlias=android-ide" >> local.properties
59+
echo "signing.keyPassword=123456" >> local.properties
60+
- name: Debug signing setup
61+
run: |
62+
echo "=== Repository structure ==="
63+
find . -name "*.jks" -o -name "local.properties" | head -10
64+
echo ""
65+
echo "=== local.properties content ==="
66+
cat local.properties || echo "local.properties not found"
67+
echo ""
68+
echo "=== SigningDirectory ==="
69+
ls -la core/app/signing/ || echo "core/app/signing directory not found"
70+
- name: Assemble Debug APK
71+
run: ./gradlew :core:app:assembleDebug
72+
# run: ./gradlew :core:app:assembleRelease
73+
- name: List APK files (debug)
74+
run: ls -la core/app/build/outputs/apk/debug/
75+
- name: Upload arm64-v8a Release APK
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: apk-arm64-v8a-debug
79+
path: core/app/build/outputs/apk/debug/*arm64-v8a*.apk
80+
if: always()
81+
- name: Upload armeabi-v7a Release APK
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: apk-armeabi-v7a-release
85+
path: core/app/build/outputs/apk/release/*armeabi-v7a*.apk
86+
if: always()
87+
- name: Upload x86_64 Release APK
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: apk-x86_64-release
91+
path: core/app/build/outputs/apk/release/*x86_64*.apk
92+
if: always()
93+
- name: Upload universal Release APK
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: apk-universal-release
97+
path: core/app/build/outputs/apk/release/*universal*.apk
98+
if: always()

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Properties file for F-Droid
22
fdroid.properties
33
autopush.sh
4+
clear_runs.py
45

56
# Crowdin
67
crowdin.properties

core/app/src/main/java/com/itsaky/androidide/app/IDEApplication.kt

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ import android.util.Log
7575
class IDEApplication : TermuxApplication() {
7676

7777
private var uncaughtExceptionHandler: UncaughtExceptionHandler? = null
78-
// private var ideLogcatReader: IDELogcatReader? = null
78+
private var ideLogcatReader: IDELogcatReader? = null
7979

8080
init {
8181
if (!VMUtils.isJvm()) {
8282
TreeSitter.loadLibrary()
8383
}
8484

85-
// RecyclableObjectPool.DEBUG = BuildConfig.DEBUG
85+
RecyclableObjectPool.DEBUG = BuildConfig.DEBUG
8686
}
8787

8888
override fun attachBaseContext(base: Context) {
@@ -99,14 +99,14 @@ class IDEApplication : TermuxApplication() {
9999

100100
super.onCreate()
101101

102-
// if (BuildConfig.DEBUG) {
103-
// StrictMode.setVmPolicy(
104-
// StrictMode.VmPolicy.Builder(StrictMode.getVmPolicy()).penaltyLog().detectAll().build()
105-
// )
106-
// if (DevOpsPreferences.dumpLogs) {
107-
// startLogcatReader()
108-
// }
109-
// }
102+
if (BuildConfig.DEBUG) {
103+
StrictMode.setVmPolicy(
104+
StrictMode.VmPolicy.Builder(StrictMode.getVmPolicy()).penaltyLog().detectAll().build()
105+
)
106+
if (DevOpsPreferences.dumpLogs) {
107+
startLogcatReader()
108+
}
109+
}
110110

111111
EventBus.builder()
112112
.addIndex(AppEventsIndex())
@@ -142,15 +142,15 @@ class IDEApplication : TermuxApplication() {
142142
try {
143143
startActivity(intent)
144144
} catch (th: Throwable) {
145-
// log.error("Unable to start activity to show changelog", th)
145+
log.error("Unable to start activity to show changelog", th)
146146
flashError("Unable to start activity")
147147
}
148148
}
149149

150150
fun reportStatsIfNecessary() {
151151

152152
if (!StatPreferences.statOptIn) {
153-
// log.info("Stat collection is disabled.")
153+
log.info("Stat collection is disabled.")
154154
return
155155
}
156156

@@ -162,7 +162,7 @@ class IDEApplication : TermuxApplication() {
162162

163163
val workManager = WorkManager.getInstance(this)
164164

165-
// log.info("reportStatsIfNecessary: Enqueuing StatUploadWorker...")
165+
log.info("reportStatsIfNecessary: Enqueuing StatUploadWorker...")
166166
val operation = workManager.enqueueUniquePeriodicWork(
167167
StatUploadWorker.WORKER_WORK_NAME,
168168
ExistingPeriodicWorkPolicy.UPDATE, request
@@ -171,7 +171,7 @@ class IDEApplication : TermuxApplication() {
171171
operation.state.observeForever(object : Observer<Operation.State> {
172172
override fun onChanged(value: Operation.State) {
173173
operation.state.removeObserver(this)
174-
// log.debug("reportStatsIfNecessary: WorkManager enqueue result: {}", value)
174+
log.debug("reportStatsIfNecessary: WorkManager enqueue result: {}", value)
175175
}
176176
})
177177
}
@@ -194,7 +194,7 @@ class IDEApplication : TermuxApplication() {
194194
}
195195

196196
private fun handleCrash(thread: Thread, th: Throwable) {
197-
// writeException(th)
197+
writeException(th)
198198

199199
try {
200200

@@ -213,38 +213,38 @@ class IDEApplication : TermuxApplication() {
213213
}
214214
}
215215

216-
// private fun cancelStatUploadWorker() {
217-
// log.info("Opted-out of stat collection. Cancelling StatUploadWorker if enqueued...")
218-
// val operation = WorkManager.getInstance(this)
219-
// .cancelUniqueWork(StatUploadWorker.WORKER_WORK_NAME)
220-
// operation.state.observeForever(object : Observer<Operation.State> {
221-
// override fun onChanged(value: Operation.State) {
222-
// operation.state.removeObserver(this)
223-
// log.info("StatUploadWorker: Cancellation result state: {}", value)
224-
// }
225-
// })
226-
// }
227-
228-
// private fun startLogcatReader() {
229-
// if (ideLogcatReader != null) {
230-
// // already started
231-
// return
232-
// }
233-
234-
// log.info("Starting logcat reader...")
235-
// ideLogcatReader = IDELogcatReader().also { it.start() }
236-
// }
237-
238-
// private fun stopLogcatReader() {
239-
// log.info("Stopping logcat reader...")
240-
// ideLogcatReader?.stop()
241-
// ideLogcatReader = null
242-
// }
216+
private fun cancelStatUploadWorker() {
217+
log.info("Opted-out of stat collection. Cancelling StatUploadWorker if enqueued...")
218+
val operation = WorkManager.getInstance(this)
219+
.cancelUniqueWork(StatUploadWorker.WORKER_WORK_NAME)
220+
operation.state.observeForever(object : Observer<Operation.State> {
221+
override fun onChanged(value: Operation.State) {
222+
operation.state.removeObserver(this)
223+
log.info("StatUploadWorker: Cancellation result state: {}", value)
224+
}
225+
})
226+
}
227+
228+
private fun startLogcatReader() {
229+
if (ideLogcatReader != null) {
230+
// already started
231+
return
232+
}
233+
234+
log.info("Starting logcat reader...")
235+
ideLogcatReader = IDELogcatReader().also { it.start() }
236+
}
237+
238+
private fun stopLogcatReader() {
239+
log.info("Stopping logcat reader...")
240+
ideLogcatReader?.stop()
241+
ideLogcatReader = null
242+
}
243243

244244

245245
companion object {
246246

247-
// private val log = LoggerFactory.getLogger(IDEApplication::class.java)
247+
private val log = LoggerFactory.getLogger(IDEApplication::class.java)
248248

249249
@JvmStatic
250250
lateinit var instance: IDEApplication

0 commit comments

Comments
 (0)