Skip to content

Commit 0c80ad0

Browse files
committed
fix
2 parents cb285b0 + 80e620a commit 0c80ad0

File tree

9 files changed

+62
-48
lines changed

9 files changed

+62
-48
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
- name: Clean old builds
3333
run: rm $GITHUB_WORKSPACE/builds/*.cs3 || true
3434

35-
- name: Setup JDK 11
35+
- name: Setup JDK 17
3636
uses: actions/setup-java@v1
3737
with:
38-
java-version: 11
38+
java-version: 17
3939

4040
- name: Setup Android SDK
4141
uses: android-actions/setup-android@v2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest package="com.example"/>
2+
<manifest />

AniyomiProvider/src/main/java/com/example/BottomSheet.kt

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ class BottomFragment(private val plugin: Plugin) : BottomSheetDialogFragment() {
4646
}
4747

4848
private fun <T : View> View.findView(name: String): T {
49-
val id = plugin.resources!!.getIdentifier(name, "id", BuildConfig.LIBRARY_PACKAGE_NAME)
49+
val id = plugin.resources!!.getIdentifier(name, "id", "com.example")
5050
return this.findViewById(id)
5151
}
5252

5353
private fun getDrawable(name: String): Drawable? {
5454
val id =
55-
plugin.resources!!.getIdentifier(name, "drawable", BuildConfig.LIBRARY_PACKAGE_NAME)
55+
plugin.resources!!.getIdentifier(name, "drawable", "com.example")
5656
return ResourcesCompat.getDrawable(plugin.resources!!, id, null)
5757
}
5858

@@ -77,8 +77,7 @@ class BottomFragment(private val plugin: Plugin) : BottomSheetDialogFragment() {
7777
val deleteLocalButton = view.findView<ImageView>("delete_local_button")
7878
val externalApkButton = view.findView<ImageView>("external_apk_button")
7979
val externalApkRoot = view.findView<View>("external_apk_root")
80-
val downloadAniyomiExtensionsButton =
81-
view.findView<ImageView>("download_aniyomi_extensions")
80+
// val goToExtensionGithubButton = view.findView<ImageView>("go_to_apk_github")
8281

8382
val sortingGroup = view.findView<RadioGroup>("sorting_group")
8483
val radioNone = view.findView<RadioButton>("radio_button_none")
@@ -191,18 +190,18 @@ class BottomFragment(private val plugin: Plugin) : BottomSheetDialogFragment() {
191190
}
192191
})
193192

194-
downloadAniyomiExtensionsButton.imageTintList = ColorStateList.valueOf(textColor)
195-
downloadAniyomiExtensionsButton.setImageDrawable(getDrawable("baseline_open_in_browser_24"))
196-
downloadAniyomiExtensionsButton.setOnClickListener(object : OnClickListener {
197-
override fun onClick(p0: View?) {
198-
runCatching {
199-
val intent = Intent(Intent.ACTION_VIEW).apply {
200-
data = Uri.parse("https://aniyomi.org/extensions/")
201-
}
202-
activity?.startActivity(intent)
203-
}
204-
}
205-
})
193+
// goToExtensionGithubButton.imageTintList = ColorStateList.valueOf(textColor)
194+
// goToExtensionGithubButton.setImageDrawable(getDrawable("ic_github_logo"))
195+
// goToExtensionGithubButton.setOnClickListener(object : OnClickListener {
196+
// override fun onClick(p0: View?) {
197+
// runCatching {
198+
// val intent = Intent(Intent.ACTION_VIEW).apply {
199+
// data = Uri.parse("https://github.com/CranberrySoup/AniyomiCompatExtension")
200+
// }
201+
// activity?.startActivity(intent)
202+
// }
203+
// }
204+
// })
206205

207206
val sortingMap = mapOf(
208207
EpisodeSortMethods.None.num to radioNone,

AniyomiProvider/src/main/java/com/example/ExtensionAdapter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ class ExtensionAdapter(
2929
) : RecyclerView.Adapter<ExtensionAdapter.ViewHolder>() {
3030

3131
private fun <T : View> View.findView(name: String): T {
32-
val id = plugin.resources!!.getIdentifier(name, "id", BuildConfig.LIBRARY_PACKAGE_NAME)
32+
val id = plugin.resources!!.getIdentifier(name, "id", "com.example")
3333
return this.findViewById(id)
3434
}
3535

3636
private fun getDrawable(name: String): Drawable? {
3737
val id =
38-
plugin.resources!!.getIdentifier(name, "drawable", BuildConfig.LIBRARY_PACKAGE_NAME)
38+
plugin.resources!!.getIdentifier(name, "drawable", "com.example")
3939
return ResourcesCompat.getDrawable(plugin.resources!!, id, null)
4040
}
4141

AniyomiProvider/src/main/java/com/example/ExtensionFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ class ExtensionFragment(private val plugin: Plugin) : BottomSheetDialogFragment(
3131
}
3232

3333
private fun <T : View> View.findView(name: String): T {
34-
val id = plugin.resources!!.getIdentifier(name, "id", BuildConfig.LIBRARY_PACKAGE_NAME)
34+
val id = plugin.resources!!.getIdentifier(name, "id", "com.example")
3535
return this.findViewById(id)
3636
}
3737

3838
private fun getDrawable(name: String): Drawable? {
3939
val id =
40-
plugin.resources!!.getIdentifier(name, "drawable", BuildConfig.LIBRARY_PACKAGE_NAME)
40+
plugin.resources!!.getIdentifier(name, "drawable", "com.example")
4141
return ResourcesCompat.getDrawable(plugin.resources!!, id, null)
4242
}
4343

AniyomiProvider/src/main/kotlin/recloudstream/AniyomiPlugin.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ class AniyomiPlugin : Plugin() {
155155
fun loadAniyomi(context: Context, file: File) {
156156
safe {
157157
println("Loading Aniyomi Compat at: ${file.absolutePath}")
158+
file.setReadOnly()
158159
val classLoader = context.classLoader
159160
addDexToClasspath(file, classLoader)
160161
val aniyomiPlugin = classLoader.loadClass(pluginClassName).newInstance() as Plugin
@@ -167,6 +168,9 @@ class AniyomiPlugin : Plugin() {
167168
suspend fun downloadApk(context: Context): Boolean {
168169
return ioWorkSafe {
169170
val finalFile = getLocalFile(context)
171+
normalSafeApiCall {
172+
finalFile.setWritable(true)
173+
}
170174
val tmpFile = File.createTempFile("AniyomiCompat", null)
171175

172176
val request = app.get(apkUrl)
@@ -178,7 +182,7 @@ class AniyomiPlugin : Plugin() {
178182
setKey(ANIYOMI_PLUGIN_SUCCESS_KEY, false)
179183
tmpFile.copyTo(finalFile, true)
180184
setKey(ANIYOMI_PLUGIN_SUCCESS_KEY, true)
181-
tmpFile.deleteOnExit()
185+
tmpFile.delete()
182186
true
183187
} == true
184188
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:width="24dp"
4+
android:height="24dp"
5+
android:tint="#FFF"
6+
android:viewportWidth="1000"
7+
android:viewportHeight="1000">
8+
<path
9+
android:fillColor="#FFF"
10+
android:pathData="M455.34,24.62c-61.96,5.16 -121.85,22.37 -176.93,49.91c-80.55,40.62 -140.44,94.66 -190.36,170.73c-35.8,54.39 -60.24,116 -72.29,182.78C7.85,471.07 8.2,555.75 16.11,597.4c33.05,172.45 148.36,312.21 307.73,372.1c26.16,9.98 36.49,10.33 45.44,1.38c6.2,-6.2 6.88,-11.36 6.88,-52.67l0,-45.44l-43.72,-0c-37.86,-0 -46.47,-1.03 -60.24,-7.57c-27.19,-12.39 -45.44,-32.35 -62.65,-68.16c-15.15,-31.67 -34.42,-55.42 -58.17,-72.29c-23.75,-16.87 -5.16,-29.95 28.57,-20.31c14.8,4.48 23.06,9.64 37.86,25.13c10.33,10.67 24.44,26.85 30.98,36.14c7.57,10.67 18.93,20.65 30.98,27.54c16.52,9.29 22.03,10.67 44.75,10.33c14.11,-0.35 31.67,-2.76 38.9,-5.16c12.05,-4.48 13.77,-7.23 20.65,-27.54c4.13,-12.05 11.02,-26.85 15.49,-32.36l7.92,-9.98l-35.46,-7.57c-63.68,-13.43 -99.82,-32.01 -132.52,-68.16c-33.73,-36.83 -52.67,-94.31 -52.67,-160.4c0,-51.63 9.98,-84.68 36.83,-121.17l11.7,-16.18l-4.13,-21c-7.23,-37.52 2.75,-103.96 16.52,-109.12c14.46,-5.51 72.97,15.83 112.21,40.96l16.18,10.33l32.01,-6.2c44.06,-8.95 139.41,-9.29 183.47,-0.34l31.33,6.54l30.29,-17.56c33.73,-19.28 64.71,-30.64 87.43,-32.01l15.49,-1.03l6.54,17.21c8.61,22.03 11.71,70.91 5.85,93.97l-4.13,17.56l15.49,23.41c27.54,41.99 31.67,57.14 31.67,116.35c-0.34,43.37 -1.38,56.11 -7.92,79.17c-19.28,67.12 -60.24,110.84 -125.3,134.59c-8.26,3.1 -30.64,8.95 -50.25,13.08l-35.46,7.57l7.57,9.29c4.13,5.51 10.67,17.9 14.46,27.54c6.88,16.18 7.57,26.16 8.61,107.4c0.69,59.9 2.41,90.88 5.16,93.97c11.71,14.46 27.88,11.71 83.65,-14.8c67.12,-31.32 136.31,-88.12 182.09,-149.39c42.68,-56.45 77.11,-136.31 89.84,-206.88c7.92,-43.72 7.92,-121.51 0,-165.23c-19.96,-110.5 -81.58,-218.24 -165.57,-288.8C716.26,54.91 586.14,12.92 455.34,24.62z"
11+
tools:ignore="VectorPath" />
12+
</vector>

AniyomiProvider/src/main/res/layout/bottom_sheet_layout.xml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -214,29 +214,28 @@
214214
android:textStyle="italic"
215215
android:visibility="gone" />
216216

217-
<LinearLayout
218-
android:visibility="gone"
219-
android:layout_width="match_parent"
220-
android:layout_height="wrap_content"
221-
android:paddingTop="20dp">
222-
223-
<TextView
224-
android:layout_width="0dp"
225-
android:layout_height="wrap_content"
226-
android:layout_gravity="center"
227-
android:layout_weight="1"
228-
android:text="Download Aniyomi extensions"
229-
android:textSize="17sp"
230-
android:textStyle="bold" />
231-
232-
<ImageView
233-
android:id="@+id/download_aniyomi_extensions"
234-
android:layout_width="34dp"
235-
android:layout_height="34dp"
236-
android:clickable="true"
237-
android:focusable="true"
238-
tools:src="@drawable/baseline_open_in_browser_24" />
239-
</LinearLayout>
217+
<!-- <LinearLayout-->
218+
<!-- android:layout_width="match_parent"-->
219+
<!-- android:layout_height="wrap_content"-->
220+
<!-- android:paddingTop="20dp">-->
221+
222+
<!-- <TextView-->
223+
<!-- android:layout_width="0dp"-->
224+
<!-- android:layout_height="wrap_content"-->
225+
<!-- android:layout_gravity="center"-->
226+
<!-- android:layout_weight="1"-->
227+
<!-- android:text="Go to extension repository"-->
228+
<!-- android:textSize="17sp"-->
229+
<!-- android:textStyle="bold" />-->
230+
231+
<!-- <ImageView-->
232+
<!-- android:id="@+id/go_to_apk_github"-->
233+
<!-- android:layout_width="34dp"-->
234+
<!-- android:layout_height="34dp"-->
235+
<!-- android:clickable="true"-->
236+
<!-- android:focusable="true"-->
237+
<!-- tools:src="@drawable/ic_github_logo" />-->
238+
<!-- </LinearLayout>-->
240239

241240

242241
<LinearLayout

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# http://www.gradle.org/docs/current/userguide/build_environment.html
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
9-
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
9+
org.gradle.jvmargs=-Xmx8G -Dfile.encoding=UTF-8
1010
# When configured, Gradle will run in incubating parallel mode.
1111
# This option should only be used with decoupled projects. More details, visit
1212
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects

0 commit comments

Comments
 (0)