|
1
|
apply plugin: 'com.android.application' |
|
2
|
|
|
3
|
android { |
|
4
|
namespace "com.jcrguidepro.app" |
|
5
|
compileSdk 34 |
|
6
|
|
|
7
|
defaultConfig { |
|
8
|
applicationId "com.jcrguidepro.app" |
|
9
|
minSdk 24 |
|
10
|
targetSdk 34 |
|
11
|
versionCode 5 |
|
12
|
versionName "1.4.0" |
|
13
|
|
|
14
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
|
15
|
} |
|
16
|
|
|
17
|
buildTypes { |
|
18
|
release { |
|
19
|
minifyEnabled true |
|
20
|
shrinkResources true |
|
21
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
|
22
|
} |
|
23
|
} |
|
24
|
|
|
25
|
compileOptions { |
|
26
|
sourceCompatibility JavaVersion.VERSION_17 |
|
27
|
targetCompatibility JavaVersion.VERSION_17 |
|
28
|
} |
|
29
|
} |
|
30
|
|
|
31
|
// Technical Task: Synchronize Root Web Assets to Android Assets folder |
|
32
|
tasks.register('copyWebAssets', Copy) { |
|
33
|
from "../../dist" |
|
34
|
into "src/main/assets" |
|
35
|
duplicatesStrategy = DuplicatesStrategy.INCLUDE |
|
36
|
|
|
37
|
// Pro-level regex filter to ensure local asset loading in WebView |
|
38
|
filter { line -> |
|
39
|
String result = line.replaceAll('src="/assets/', 'src="./assets/') |
|
40
|
.replaceAll('href="/assets/', 'href="./assets/') |
|
41
|
.replaceAll('src="/manifest.json"', 'src="./manifest.json"') |
|
42
|
.replaceAll('href="/manifest.json"', 'href="./manifest.json"') |
|
43
|
.replaceAll('href="/icon-', 'href="./icon-') |
|
44
|
.replaceAll('src="/icon-', 'src="./icon-') |
|
45
|
|
|
46
|
// Remove security blocks that often cause white screens in local shell |
|
47
|
result = result.replaceAll(/\bcrossorigin\b/, "") |
|
48
|
result = result.replaceAll(/<script.*replit-dev-banner.js.*<\/script>/, "") |
|
49
|
|
|
50
|
return result |
|
51
|
} |
|
52
|
} |
|
53
|
|
|
54
|
// Automated workflow: Sync assets before every build |
|
55
|
preBuild.dependsOn copyWebAssets |
|
56
|
|
|
57
|
dependencies { |
|
58
|
implementation 'androidx.appcompat:appcompat:1.6.1' |
|
59
|
implementation 'com.google.android.material:material:1.11.0' |
|
60
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' |
|
61
|
implementation 'androidx.webkit:webkit:1.11.0' |
|
62
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' |
|
63
|
} |