Skip to content

Commit 00886c0

Browse files
committed
v 0.8.1 - beta 25
- Android 12 Support. - Bug Fixes and Speed Improvements.
1 parent 029b324 commit 00886c0

Some content is hidden

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

45 files changed

+234
-160
lines changed

android/app/build.gradle

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
3939
apply plugin: 'com.jeppeman.locallydynamic'
4040

4141
android {
42-
compileSdkVersion 29
42+
compileSdkVersion 31
4343

4444
sourceSets {
4545
main.java.srcDirs += 'src/main/kotlin'
@@ -52,11 +52,16 @@ android {
5252
defaultConfig {
5353
applicationId "in.canews.zeronetmobile"
5454
minSdkVersion 21
55-
targetSdkVersion 29
55+
targetSdkVersion 31
5656
versionCode flutterVersionCode.toInteger()
5757
versionName flutterVersionName
5858
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
5959
}
60+
61+
compileOptions {
62+
sourceCompatibility JavaVersion.VERSION_11
63+
targetCompatibility JavaVersion.VERSION_11
64+
}
6065

6166
signingConfigs {
6267
release {
@@ -79,7 +84,7 @@ android {
7984
applicationIdSuffix '.debug'
8085
signingConfig signingConfigs.release
8186
locallyDynamic {
82-
enabled = true
87+
enabled = false
8388
throttleDownloadBy = 1000
8489
}
8590
defaultConfig.ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86_64'
@@ -98,8 +103,14 @@ flutter {
98103
}
99104

100105
dependencies {
101-
def billing_version = "3.0.0"
106+
def billing_version = '4.0.0'
102107
implementation "com.android.billingclient:billing:$billing_version"
108+
109+
def work_version = "2.7.0"
110+
// Force WorkManager 2.6.0 for transitive dependency
111+
implementation("androidx.work:work-runtime-ktx:$work_version") {
112+
force = true
113+
}
103114

104115
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
105116
implementation 'com.google.android.gms:play-services-base:17.6.0'

android/app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
1313
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
1414
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
15+
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove"/>
1516

1617
<application
1718
android:name=".MyApplication"
@@ -22,6 +23,7 @@
2223
tools:ignore="GoogleAppIndexingWarning">
2324
<activity
2425
android:name=".MainActivity"
26+
android:exported="true"
2527
android:launchMode="singleTop"
2628
android:theme="@style/LaunchTheme"
2729
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
@@ -37,7 +39,9 @@
3739
<meta-data
3840
android:name="flutterEmbedding"
3941
android:value="2" />
40-
<receiver android:name="com.dexterous.flutterlocalnotifications.NotificationActionReceiver" />
42+
<receiver
43+
android:name="com.dexterous.flutterlocalnotifications.NotificationActionReceiver"
44+
android:exported="false" />
4145
<provider
4246
android:name="androidx.core.content.FileProvider"
4347
android:grantUriPermissions="true"

android/app/src/main/kotlin/in/canews/zeronetmobile/MainActivity.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ class MainActivity : FlutterActivity() {
305305
tempFile.createNewFile()
306306
inputStream?.toFile(tempFilePath)
307307
resultT?.success(File(tempFilePath).absoluteFile.absolutePath)
308+
Log.e("copyFileToTempPath: ", filename + " copied to " + tempFilePath)
308309
tempFile.deleteOnExit()
309310
}
310311
}
@@ -356,6 +357,7 @@ class MainActivity : FlutterActivity() {
356357
getAssetFiles("tor_$archName.zip")
357358
}
358359
} catch (e: IOException) {
360+
Log.e("copyAssetsToCache", e.toString())
359361
return false
360362
}
361363
return true
@@ -364,12 +366,12 @@ class MainActivity : FlutterActivity() {
364366
private fun getAssetFiles(fileName: String) {
365367
val assetManager = createPackageContext(packageName, 0).assets
366368
val assistContent = assetManager.open(fileName)
369+
Log.e("getAssetFiles: ", fileName)
367370
copyFileToTempPath(inputStreamA = assistContent, filename = fileName, path = null)
368371
}
369372

370373
private fun isModuleInstallSupported(): Boolean =
371-
Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
372-
&& isGooglePlayServicesAvailable(this)
374+
Build.VERSION.SDK_INT <= 30 && isGooglePlayServicesAvailable(this)
373375

374376
private fun isGooglePlayServicesAvailable(activity: Activity?): Boolean {
375377
val googleApiAvailability: GoogleApiAvailability = GoogleApiAvailability.getInstance()

android/arm/build.gradle

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
apply plugin: 'com.android.dynamic-feature'
22

33
android {
4-
compileSdkVersion 29
4+
compileSdkVersion 31
55

66

77
defaultConfig {
88
minSdkVersion 21
9-
targetSdkVersion 29
10-
versionCode 1
11-
versionName "1.0"
129

1310
}
1411

1512
compileOptions {
16-
sourceCompatibility 1.8
17-
targetCompatibility 1.8
13+
sourceCompatibility JavaVersion.VERSION_11
14+
targetCompatibility JavaVersion.VERSION_11
1815
}
1916

2017
}

android/arm64/build.gradle

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
apply plugin: 'com.android.dynamic-feature'
22

33
android {
4-
compileSdkVersion 29
4+
compileSdkVersion 31
55

66

77
defaultConfig {
88
minSdkVersion 21
9-
targetSdkVersion 29
10-
versionCode 1
11-
versionName "1.0"
129

1310
}
1411

1512
compileOptions {
16-
sourceCompatibility 1.8
17-
targetCompatibility 1.8
13+
sourceCompatibility JavaVersion.VERSION_11
14+
targetCompatibility JavaVersion.VERSION_11
1815
}
1916

2017
}

android/arm64_python

android/arm64_tor/build.gradle

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
apply plugin: 'com.android.dynamic-feature'
22

33
android {
4-
compileSdkVersion 29
4+
compileSdkVersion 31
55

66

77
defaultConfig {
88
minSdkVersion 21
9-
targetSdkVersion 29
10-
versionCode 1
11-
versionName "1.0"
129

1310
}
1411

1512
compileOptions {
16-
sourceCompatibility 1.8
17-
targetCompatibility 1.8
13+
sourceCompatibility JavaVersion.VERSION_11
14+
targetCompatibility JavaVersion.VERSION_11
1815
}
1916

2017
}

android/arm_python

android/arm_tor/build.gradle

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
apply plugin: 'com.android.dynamic-feature'
22

33
android {
4-
compileSdkVersion 29
4+
compileSdkVersion 31
55

66

77
defaultConfig {
88
minSdkVersion 21
9-
targetSdkVersion 29
10-
versionCode 1
11-
versionName "1.0"
129

1310
}
1411

1512
compileOptions {
16-
sourceCompatibility 1.8
17-
targetCompatibility 1.8
13+
sourceCompatibility JavaVersion.VERSION_11
14+
targetCompatibility JavaVersion.VERSION_11
1815
}
1916

2017
}

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
22
ext.kotlin_version = '1.5.21'
3-
ext.gradle_version = '4.2.0'
3+
ext.gradle_version = '7.0.3'
44
repositories {
55
google()
66
maven {
@@ -9,7 +9,7 @@ buildscript {
99
}
1010

1111
dependencies {
12-
classpath "com.android.tools.build:gradle:${gradle_version}"
12+
classpath "com.android.tools.build:gradle:$gradle_version"
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
classpath "com.jeppeman.locallydynamic.gradle:plugin:0.2"
1515
}

android/common/build.gradle

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
apply plugin: 'com.android.dynamic-feature'
22

33
android {
4-
compileSdkVersion 29
4+
compileSdkVersion 31
55

66

77
defaultConfig {
88
minSdkVersion 21
9-
targetSdkVersion 29
10-
versionCode 1
11-
versionName "1.0"
129

1310
}
1411

1512
compileOptions {
16-
sourceCompatibility 1.8
17-
targetCompatibility 1.8
13+
sourceCompatibility JavaVersion.VERSION_11
14+
targetCompatibility JavaVersion.VERSION_11
1815
}
1916

2017
}

android/common_python

3.5 KB
Binary file not shown.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
#Thu Oct 21 07:26:34 IST 2021
12
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
24
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
4-
zipStoreBase=GRADLE_USER_HOME
5+
distributionSha256Sum=0e46229820205440b48a5501122002842b82886e76af35f0f3a069243dca4b3c
56
zipStorePath=wrapper/dists
7+
zipStoreBase=GRADLE_USER_HOME

android/gradlew

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ esac
8282

8383
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
8484

85+
8586
# Determine the Java command to use to start the JVM.
8687
if [ -n "$JAVA_HOME" ] ; then
8788
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
129130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133+
132134
JAVACMD=`cygpath --unix "$JAVACMD"`
133135

134136
# We build the pattern for arguments to be converted via cygpath
@@ -154,19 +156,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
154156
else
155157
eval `echo args$i`="\"$arg\""
156158
fi
157-
i=$((i+1))
159+
i=`expr $i + 1`
158160
done
159161
case $i in
160-
(0) set -- ;;
161-
(1) set -- "$args0" ;;
162-
(2) set -- "$args0" "$args1" ;;
163-
(3) set -- "$args0" "$args1" "$args2" ;;
164-
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165-
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166-
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167-
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168-
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169-
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
162+
0) set -- ;;
163+
1) set -- "$args0" ;;
164+
2) set -- "$args0" "$args1" ;;
165+
3) set -- "$args0" "$args1" "$args2" ;;
166+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170172
esac
171173
fi
172174

@@ -175,14 +177,9 @@ save () {
175177
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176178
echo " "
177179
}
178-
APP_ARGS=$(save "$@")
180+
APP_ARGS=`save "$@"`
179181

180182
# Collect all arguments for the java command, following the shell quoting and substitution rules
181183
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182184

183-
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184-
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185-
cd "$(dirname "$0")"
186-
fi
187-
188185
exec "$JAVACMD" "$@"

android/gradlew.bat

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
2929
set APP_BASE_NAME=%~n0
3030
set APP_HOME=%DIRNAME%
3131

32+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34+
3235
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
3336
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
3437

@@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
3740

3841
set JAVA_EXE=java.exe
3942
%JAVA_EXE% -version >NUL 2>&1
40-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
4144

4245
echo.
4346
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -51,7 +54,7 @@ goto fail
5154
set JAVA_HOME=%JAVA_HOME:"=%
5255
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5356

54-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
5558

5659
echo.
5760
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -61,28 +64,14 @@ echo location of your Java installation.
6164

6265
goto fail
6366

64-
:init
65-
@rem Get command-line arguments, handling Windows variants
66-
67-
if not "%OS%" == "Windows_NT" goto win9xME_args
68-
69-
:win9xME_args
70-
@rem Slurp the command line arguments.
71-
set CMD_LINE_ARGS=
72-
set _SKIP=2
73-
74-
:win9xME_args_slurp
75-
if "x%~1" == "x" goto execute
76-
77-
set CMD_LINE_ARGS=%*
78-
7967
:execute
8068
@rem Setup the command line
8169

8270
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8371

72+
8473
@rem Execute Gradle
85-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
8675

8776
:end
8877
@rem End local scope for the variables with windows NT shell

android/nativelibs_python

0 commit comments

Comments
 (0)