Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52a3339981 | ||
|
|
226519ed38 | ||
|
|
208abfe127 | ||
|
|
42a06296b7 | ||
|
|
2ac8bbf36d | ||
|
|
47abbfe35b | ||
|
|
620a3ee324 | ||
|
|
0453e7d2b6 | ||
|
|
c0682db621 | ||
|
|
b85f4a6e53 | ||
|
|
1656460b22 | ||
|
|
50686c8c3d | ||
|
|
b6c9e67fe4 | ||
|
|
cc4be07487 | ||
|
|
af4bcb85fe | ||
|
|
d10c238578 | ||
|
|
f1caf65d0c | ||
|
|
ada8600722 | ||
|
|
befb7a9366 | ||
|
|
d8731ac3ae | ||
|
|
945875e986 | ||
|
|
8299cfdecc | ||
|
|
01d56a6660 | ||
|
|
4eba5607b8 | ||
|
|
e22a04a21f | ||
|
|
e9067761dc | ||
|
|
918dff492f | ||
|
|
b9d3b8aa09 | ||
|
|
548f358813 | ||
|
|
29ac81c6b1 | ||
|
|
053e8d8043 | ||
|
|
ae10743fbd | ||
|
|
aa426e3331 | ||
|
|
7727589ee7 | ||
|
|
88102d56c9 | ||
|
|
fa2a105872 | ||
|
|
dc501074de | ||
|
|
619fd15c8c | ||
|
|
6947f61052 | ||
|
|
263f438e4b | ||
|
|
93bf6f4302 | ||
|
|
534533dc62 | ||
|
|
8bc2864eba | ||
|
|
b269b40a0a | ||
|
|
03f3963836 | ||
|
|
e6ab86d076 | ||
|
|
72bd25217c | ||
|
|
405d528db1 | ||
|
|
e6d26f0116 | ||
|
|
16adb6d032 | ||
|
|
969e962881 | ||
|
|
35e1f1509e | ||
|
|
5f547f7ba6 | ||
|
|
46bb61ac64 | ||
|
|
4e2e032819 | ||
|
|
6a240b46ac | ||
|
|
95922b1fce | ||
|
|
b7c6735975 | ||
|
|
b5d94ac8c0 | ||
|
|
124ee249ed | ||
|
|
dc0d9365c4 | ||
|
|
6c01418f01 | ||
|
|
3464957ce5 | ||
|
|
c4db4c8f0f | ||
|
|
66f16d78f0 | ||
|
|
f64a688df9 | ||
|
|
55b7dc4c9f | ||
|
|
d53b7d2562 | ||
|
|
566fb7099b | ||
|
|
adaa15c080 | ||
|
|
ce4ee6076c | ||
|
|
ed18adc962 | ||
|
|
8e2f36b349 | ||
|
|
add8351e8c | ||
|
|
3d51ebae45 | ||
|
|
e32ac91070 | ||
|
|
61a7bb6393 | ||
|
|
2a7e46c3cb | ||
|
|
ea1bc2e59a | ||
|
|
851234a5be | ||
|
|
30efdd605d | ||
|
|
805be867a5 | ||
|
|
404e44a4cf | ||
|
|
cf83d53ec6 | ||
|
|
89031e589e | ||
|
|
c7fcf8929e | ||
|
|
3f62af5c87 | ||
|
|
1f6707e99c | ||
|
|
b0e064bee7 | ||
|
|
9622a40eb0 | ||
|
|
7dac537a38 | ||
|
|
1092999502 | ||
|
|
2a2cbf7354 | ||
|
|
64c568a99d | ||
|
|
e8fb8e9fd3 | ||
|
|
cd2dd5cd93 | ||
|
|
fbf5309085 | ||
|
|
f51aa39ff8 | ||
|
|
b267d5b400 | ||
|
|
da8b3b9a7b | ||
|
|
1a8f1137b6 | ||
|
|
37e8598f0a | ||
|
|
534e25d049 | ||
|
|
8cdf6b08d0 | ||
|
|
5097d92d27 | ||
|
|
a092c782b4 | ||
|
|
e124d37ea6 | ||
|
|
e1b1867a39 | ||
|
|
981ee36cae | ||
|
|
e838f193ea | ||
|
|
5df9029686 | ||
|
|
504b7bf090 | ||
|
|
b266177ed1 | ||
|
|
78050cfe9f | ||
|
|
2d101708ec | ||
|
|
194012d87f | ||
|
|
19291e1f4f | ||
|
|
4e76e7fa30 | ||
|
|
d20a0c9963 | ||
|
|
f9a2f9bd11 | ||
|
|
4d67bbc76e | ||
|
|
e449dceda5 | ||
|
|
d78042824c | ||
|
|
5a7982fc8f | ||
|
|
ef4b6e319d | ||
|
|
4edf99aca3 | ||
|
|
e5edba7845 | ||
|
|
f070c110a8 | ||
|
|
c91bdd2ab5 | ||
|
|
a0ddaf2f34 | ||
|
|
c1c9a542be | ||
|
|
025b6302f4 | ||
|
|
857dd0ef26 | ||
|
|
7baccc44de | ||
|
|
a3a3212f85 | ||
|
|
4fc018aab9 | ||
|
|
a11013a09d | ||
|
|
2be5c025bf | ||
|
|
be750019d9 | ||
|
|
ecce969d1b | ||
|
|
0854226534 | ||
|
|
c775be1704 | ||
|
|
bfb65e9a11 | ||
|
|
4be49c6041 | ||
|
|
3aca4eca97 | ||
|
|
7bdcec1ea2 | ||
|
|
52c0b9e2e5 | ||
|
|
c4c7be3dec | ||
|
|
9b138cd0c4 | ||
|
|
92045ec23f | ||
|
|
8d368af8b0 | ||
|
|
4af39469e5 | ||
|
|
bc3b7e0d7a | ||
|
|
39c2652fae | ||
|
|
bfc8d76aed |
@@ -1,33 +1,6 @@
|
||||
# Gradle files
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
|
||||
# Log/OS Files
|
||||
*.log
|
||||
|
||||
# Android Studio generated files and folders
|
||||
captures/
|
||||
.externalNativeBuild/
|
||||
.cxx/
|
||||
*.apk
|
||||
output.json
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
.idea/
|
||||
misc.xml
|
||||
deploymentTargetDropDown.xml
|
||||
render.experimental.xml
|
||||
|
||||
# Keystore files
|
||||
*.jks
|
||||
*.keystore
|
||||
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
google-services.json
|
||||
|
||||
# Android Profiling
|
||||
*.hprof
|
||||
_site
|
||||
.bundle
|
||||
.sass-cache
|
||||
Gemfile.lock
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "pwa-chrome",
|
||||
"request": "launch",
|
||||
"name": "Launch Chrome against localhost",
|
||||
"url": "http://localhost:8000/hitomi-dev.html",
|
||||
"webRoot": "${workspaceFolder}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'github-pages', group: :jekyll_plugins
|
||||
@@ -1,4 +0,0 @@
|
||||
License is specified in following module separately
|
||||
|
||||
app/
|
||||
libpupil/
|
||||
@@ -1,26 +1,69 @@
|
||||

|
||||
*Pupil, Hitomi.la viewer for Android*
|
||||
# Jekyll Cayman theme
|
||||
|
||||

|
||||
[](https://github.com/tom5079/Pupil/releases/download/5.1.6-hotfix7/Pupil-v5.1.6-hotfix7.apk)
|
||||
[](https://discord.gg/Stj4b5v)
|
||||
This is a [Jekyll][1] theme for [@jasonlong][2]'s [Cayman theme][4] on [GitHub Pages][3].
|
||||
|
||||
# Features
|
||||

|
||||
Cayman is a clean, responsive theme for [GitHub Pages](https://pages.github.com). This theme is available as an option if you use the [Automatic Page Generator](https://help.github.com/articles/creating-pages-with-the-automatic-generator/) or you can copy the template and styles to use on your own.
|
||||
|
||||
# Installation
|
||||
You can preview the theme at https://jasonlong.github.io/cayman-theme or with real content at https://jasonlong.github.io/geo_pattern.
|
||||
|
||||
Go [Releases page](https://github.com/tom5079/Pupil/releases) and get latest version or
|
||||
Visit [github page](https://tom5079.github.io/Pupil/) (only available in Korean)
|
||||
or Build app yourself
|
||||

|
||||
|
||||
# Manual
|
||||
# How to use it?
|
||||
|
||||
[Manual](https://tom5079.github.io/Pupil/2019/06/06/manual-kr.html) is only available in Korean. Consider using translator.
|
||||
Download the theme @ https://github.com/pietromenna/jekyll-cayman-theme/archive/master.zip
|
||||
|
||||
# Contribution
|
||||
Unzip it and use it as a regular jekyll folder.
|
||||
|
||||
Any kind of contribution is appriciated. Feel free to leave PR!
|
||||
```
|
||||
$ unzip jekyll-cayman-theme-master.zip
|
||||
```
|
||||
|
||||
## Tag Translation
|
||||
Head over to [tags branch](https://github.com/tom5079/Pupil/tree/tags)
|
||||
Get inside the newly extracted folder
|
||||
```
|
||||
$ cd jekyll-cayman-theme-master
|
||||
```
|
||||
|
||||
Get the required gems
|
||||
```
|
||||
$ bundle install
|
||||
```
|
||||
|
||||
Use it!
|
||||
|
||||
```
|
||||
$ jekyll serve
|
||||
```
|
||||
|
||||
For more details read about [Jekyll][1] on its web page.
|
||||
|
||||
# Setup
|
||||
|
||||
Some important configuration can be done in the file `_config.yml`. Please, check the Setup section in that file.
|
||||
|
||||
|
||||
## baseurl
|
||||
|
||||
`baseurl` parameter is required in the case the site doesn't sit on the root of the domain. For example: https://pietromenna.github.io/jekyll-cayman-theme
|
||||
|
||||
In the case above the baseurl should be set to "/jekyll-cayman-theme".
|
||||
|
||||
In the case the site sits in the root, you can leave `baseurl` as empty "".
|
||||
|
||||
# Contributing
|
||||
|
||||
Bug reports and pull requests are welcome on GitHub at https://github.com/pietromenna/jekyll-cayman-theme.
|
||||
|
||||
# Development
|
||||
|
||||
To set up your environment to develop this theme, run `bundle install`.
|
||||
|
||||
Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
|
||||
|
||||
# License
|
||||
|
||||
This work is licensed under a [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/) license.
|
||||
|
||||
[1]: https://jekyllrb.com/
|
||||
[2]: https://github.com/jasonlong
|
||||
[3]: https://pages.github.com/
|
||||
[4]: https://github.com/jasonlong/cayman-theme
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
theme: jekyll-theme-cayman
|
||||
|
||||
plugins:
|
||||
- jekyll-sitemap
|
||||
|
||||
title: Pupil
|
||||
description: Hitomi.la viewer for Android
|
||||
baseurl: "/Pupil"
|
||||
|
||||
google_analytics: UA-119938781-2
|
||||
|
||||
disqus_url: "https://pupil.disqus.com"
|
||||
discord_url: "https://discord.gg/Stj4b5v"
|
||||
|
||||
github_url: "https://github.com/tom5079/Pupil"
|
||||
|
||||
t:
|
||||
en:
|
||||
header:
|
||||
description: "Hitomi.la viewer for Android"
|
||||
download: "Download app"
|
||||
issue: "Having a problem?"
|
||||
or: "or…"
|
||||
email: "Send an E-mail"
|
||||
discord: "Join Discord server"
|
||||
ko:
|
||||
header:
|
||||
description: "안드로이드 Hitomi.la 뷰어"
|
||||
download: "앱 다운로드"
|
||||
issue: "문제가 있으세요?"
|
||||
or: "또는…"
|
||||
email: "이메일 보내기"
|
||||
discord: "디스코드"
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
layout: default
|
||||
lang: ko
|
||||
title: 히토미를 여행하는 신사들을 위한 안내서
|
||||
---
|
||||
|
||||

|
||||
*히옷!*
|
||||
|
||||
안녕하십니까, 전국 방방곡곡의 신사 여러분들~!
|
||||
@@ -0,0 +1,95 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ site.lang | default: " en-US " }}">
|
||||
|
||||
<head>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
<script src="https://kit.fontawesome.com/695c47bd28.js" crossorigin="anonymous"></script>
|
||||
|
||||
{% if site.google_analytics %}
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ site.google_analytics }}');
|
||||
</script>
|
||||
{% endif %}
|
||||
<meta charset="UTF-8">
|
||||
|
||||
{% seo %}
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#157878">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
|
||||
<link rel="stylesheet" href="{{ '/assets/css/styles.css' | absolute_url }}">
|
||||
<link rel="shortcut icon" href="/Pupil/favicon.ico" type="image/x-icon" />
|
||||
|
||||
<script>
|
||||
/**
|
||||
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
|
||||
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
|
||||
|
||||
var disqus_config = function() {
|
||||
this.page.url = '{{ site.url }}{{ page.url }}'; // Replace PAGE_URL with your page's canonical URL variable
|
||||
this.page.identifier = '{{ page.id }}'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
|
||||
this.page.language = '{{ page.lang }}';
|
||||
};
|
||||
|
||||
(function() { // DON'T EDIT BELOW THIS LINE
|
||||
var d = document,
|
||||
s = d.createElement('script');
|
||||
s.src = 'https://pupil.disqus.com/embed.js';
|
||||
s.setAttribute('data-timestamp', +new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<script type='text/javascript' src='/Pupil/assets/js/pupil.js'></script>
|
||||
<script>
|
||||
Promise.resolve()
|
||||
.then(getLatestRelease)
|
||||
.then(result => {
|
||||
let url = result["assets"][0]["browser_download_url"];
|
||||
|
||||
$("#download-btn").attr("href", url)
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header class="page-header" role="banner">
|
||||
<a href="https://tom5079.github.io/Pupil" style="text-decoration:none; color:inherit;"><h1 class="project-name">{{ page.title | default: site.title | default: site.github.repository_name }}</h1></a>
|
||||
<h2 class="project-tagline">{{ site.t[page.lang].header.description }}</h2>
|
||||
<a id="download-btn" class="btn">{{ site.t[page.lang].header.download }}</a>
|
||||
<p/>
|
||||
<div class="wrap">
|
||||
<a href="{{ site.github_url }}"><i class="fab fa-github"></i></a>
|
||||
<a href="mailto:pupil.hentai@gmail.com"><i class="fas fa-envelope"></i></a>
|
||||
<a href="{{ site.discord_url }}"><i class="fab fa-discord"></i></a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main id="content" class="main-content" role="main">
|
||||
{{ content }}
|
||||
|
||||
<footer class="site-footer">
|
||||
|
||||
<div id="disqus_thread"></div>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
|
||||
{% if site.github.is_project_page %}
|
||||
<span class="site-footer-owner">{{ site.github.repository_name }} is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a>.</span> {% endif %}
|
||||
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.</span>
|
||||
</footer>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
layout: default
|
||||
lang: ko
|
||||
title: 접속 불가 현상 해결법
|
||||
description: 히토미 뷰어 Pupil 접속 불가 현상 해결법
|
||||
date: 2020-10-01
|
||||
---
|
||||
|
||||
**현재 Intra/유니콘/Aspear 등으로 접속이 불가능합니다.**
|
||||
|
||||
**1줄요약: [PowerTunnel](https://github.com/krlvm/PowerTunnel-Android) / [1.1.1.1](https://play.google.com/store/apps/details?id=com.cloudflare.onedotonedotonedotone)쓰세요**
|
||||
|
||||

|
||||
*익숙한 `그` 화면*
|
||||
|
||||
현재 일부 통신사에서 https 차단이 시행되고 있는 관계로 우회접속을 해야합니다.
|
||||
|
||||
# 해결 방법
|
||||
|
||||
## 1. PowerTunnel(속도저하 없음, 무료)
|
||||
테스트해본 앱 중 유일하게 작동하는 앱입니다.
|
||||
SNI 파편화로 작동하며, 외부 서버를 경유하지 않아 속도가 가장 빠릅니다.
|
||||
|
||||
[Github](https://github.com/krlvm/PowerTunnel-Android)
|
||||
|
||||
## 2. 1.1.1.1(속도저하 거의 없음, 무료)
|
||||
Cloudflare에서 제공하는 검열 우회 앱입니다.
|
||||
가까운 Cloudflare 서버를 경유하여 일반 VPN보다는 빠른 속도가 특징입니다.
|
||||
|
||||
[플레이스토어 링크](https://play.google.com/store/apps/details?id=com.cloudflare.onedotonedotonedotone)
|
||||
|
||||
## 3. VPN
|
||||
확실한 해결 방법입니다.
|
||||
추천 VPN으로는
|
||||
* Tunnelbear(한 달 1.5GB 무료, 이후 유료)
|
||||
* Betternet(무료)
|
||||
* NordVPN(유료)
|
||||
|
||||
가 있습니다. 속도는 NordVPN>Tunnelbear>Betternet순입니다.
|
||||
개인적으로 Tunnelbear을 추천드립니다.
|
||||
@@ -0,0 +1,179 @@
|
||||
---
|
||||
layout: default
|
||||
lang: ko
|
||||
title: Pupil v4.0 사용 설명서
|
||||
description: 히토미 뷰어 Pupil 사용 설명서
|
||||
---
|
||||
|
||||
일단 읽어 보셔봐
|
||||
|
||||
**취소 버튼이 없는 알림창은 알림창 밖을 누르면 취소됩니다**
|
||||
**만화 내보내기 기본 위치는 `내장메모리/Pupil`폴더 입니다.**
|
||||
**결과 없음/연결 오류/썸네일 안 나오시는 분들은 [접속 불가 해결법](https://tom5079.github.io/Pupil/2019/05/30/https-block-kr.html)을 참조해 주세요!**
|
||||
|
||||
# 1. 메인 화면
|
||||
|
||||

|
||||
|
||||
1. <span style="color:rgb(34,177,76)">사이드 메뉴 열기</span>
|
||||
2. <span style="color:rgb(255,127,39)">검색창</span>
|
||||
3. <span style="color:rgb(0,162,232)">설정</span>
|
||||
4. <span style="color:rgb(255,174,201)">기타</span>
|
||||
- 정렬 설정 (시간순, 인기순)
|
||||
5. <span style="color:rgb(185,122,87)">다운로드 상태</span>
|
||||
- 녹색: 다운로드 완료
|
||||
- 적색: 다운로드 중
|
||||
- 없음: 다운로드 안 됨
|
||||
6. <span style="color:rgb(237,28,36)">태그</span>
|
||||
- 태그를 누르면 해당 태그로 검색됩니다
|
||||
7. <span style="color:rgb(163,73,164)">갤러리 번호</span>
|
||||
- 태그를 누르면 검색됩니다
|
||||
8. <span style="color:rgb(255,242,0)">즐겨찾기</span>
|
||||
9. <span style="color:rgb(181,230,29)">추가 기능</span>
|
||||
- 페이지 이동: 원하는 페이지로 바로 이동
|
||||
- 갤러리 번호로 열기: 갤러리 번호로 뷰어를 엽니다
|
||||
|
||||
## 1-1. 검색
|
||||
|
||||
검색창에 태그/검색어를 입력하면 검색이 됩니다
|
||||
|
||||

|
||||
|
||||
검색어를 덜 입력하면 추천 태그가 나옵니다.
|
||||
물론 즐겨찾기 된 태그가 제일 앞에 표시됩니다.
|
||||
|
||||
우측 별 아이콘을 누르면 즐겨찾기 태그로 등록할 수 있습니다.
|
||||
|
||||

|
||||
즐겨찾기 태그는 검색어를 입력하지 않은 상태에서 나타납니다.
|
||||
|
||||
## 1-2. 페이지 이동
|
||||
페이지 이동은 볼륨 버튼으로도 가능합니다
|
||||
```
|
||||
볼륨 상 -> 이전 페이지
|
||||
볼륨 하 -> 다음 페이지
|
||||
```
|
||||
|
||||
### 1-2.1. 다음 페이지
|
||||

|
||||
페이지 맨 아래에서 한 번 더 끌어주시면 됩니다
|
||||
|
||||
### 1-2.2. 이전 페이지
|
||||

|
||||
페이지 맨 위에서 한 번 더 끌어주시면 됩니다
|
||||
|
||||
## 1-3. 갤러리 상세 보기
|
||||
갤러리의 상세 정보를 볼 수 있습니다
|
||||
|
||||
해당하는 갤러리를 길게 눌러 주세요
|
||||
|
||||

|
||||
|
||||
* 갤러리 종류/작가/그룹/언어/태그를 볼 수 있습니다
|
||||
- 클릭 시 해당 태그로 검색됩니다
|
||||
* 썸네일 표시
|
||||
* 연관 갤러리 표시
|
||||
|
||||
# 2. 뷰어
|
||||
|
||||

|
||||
|
||||
1. <span style="color:rgb(0,0,0)">제목</span>
|
||||
2. <span style="color:rgb(34,177,76)">즐겨찾기</span>
|
||||
3. <span style="color:rgb(238,28,36)">hiyobi.me 사용 표시</span>
|
||||
- hiyobi에서 이미지를 불러올 때 표시됩니다
|
||||
4. <span style="color:rgb(163,73,164)">페이지 표시</span>
|
||||
- 클릭 시 페이지 이동
|
||||
5. <span style="color:rgb(255,127,39)">로딩 상태바</span>
|
||||
- 다운로드 완료 시 사라짐
|
||||
6. <span style="color:rgb(255,201,14)">백그라운드 다운로드 버튼</span>
|
||||
7. <span style="color:rgb(0,162,232)">전체 화면 버튼</span>
|
||||
|
||||
## 2-1. 스크롤 모드
|
||||
|
||||
세로 스크롤 방식과 가로 스크롤 방식을 모두 지원합니다
|
||||
|
||||

|
||||
|
||||
* 세로 스크롤
|
||||
* 기본 방식
|
||||
* 세로 전체화면 스크롤
|
||||
* 전체화면 버튼을 이용
|
||||
* 가로 전체화면 스크롤
|
||||
* 이미지를 한 번 클릭
|
||||
* 뒤로가기 버튼으로 나갈 수 있음
|
||||
|
||||
# 3. 설정
|
||||
|
||||
## 3-1. 검색 설정
|
||||
### 3-1.1. 한 번에 로드할 갤러리 수
|
||||
한 페이지당 갤러리 수를 설정합니다.
|
||||
기본 값은 `25`입니다.
|
||||
|
||||
### 3-1.2. 기본 검색어
|
||||

|
||||
|
||||
메인 화면에서 검색어를 지정하지 않아도 추가되는 검색어입니다.
|
||||
한국어만 보고 싶을 때나 *특정 태그*에 관심이 있을 때 아주 유용합니다.
|
||||
|
||||
## 3-2. 캐시
|
||||
|
||||
### 3-1.1 캐시 삭제
|
||||
캐시 된 갤러리를 삭제합니다.
|
||||
|
||||
### 3-1.2 다운로드 삭제
|
||||
다운로드 된 갤러리를 삭제합니다.
|
||||
다운로드 목록에서도 지워집니다.
|
||||
|
||||
### 3-1.3 기록 삭제
|
||||
히스토리를 삭제합니다. 캐시된 이미지는 지워지지 않습니다.
|
||||
|
||||
## 3-3. 앱 잠금
|
||||
시작 시 잠금을 지원합니다.
|
||||
|
||||
현재 패턴 잠금만 지원합니다.
|
||||
|
||||
패턴을 잊어버렸을 때는 앱을 재설치 해주시기 바랍니다.
|
||||
|
||||
## 3-4. 기타
|
||||
### 3-4.1. hiyobi.me 사용
|
||||
이미지 로딩 속도 향상을 위해 ***가급적이면*** 히요비에서 불러옵니다.
|
||||
요즘 히요비가 계속 죽어서 효과가 없는 것 같기도 하고...
|
||||
|
||||
### 3-4.2. 보안 모드
|
||||
최근 앱 목록 창에서 끄지 못한 히토미를 남이 보는 불상사를 아주 조금 방지합니다.
|
||||
|
||||

|
||||
*보안 모드 ON*
|
||||
|
||||

|
||||
*보안 모드 OFF*
|
||||
|
||||
혹시 모르니까 켜 놓는게 좋습니다. **진짜루요**
|
||||
|
||||
### 3-4.3. 다크 모드
|
||||
앱의 테마를 어두운 색깔로 바꿉니다.
|
||||
밤에 볼때 좋겠지요^^*
|
||||
|
||||

|
||||
*다크 모드 OFF*
|
||||
|
||||

|
||||
*다크 모드 ON*
|
||||
|
||||
## 3-4.4. 이미지 숨기기
|
||||
갤러리에서 다운로드한 이미지를 보이지 않게 합니다.
|
||||
|
||||
이런 곤란한 상황을 막아줍니다
|
||||
|
||||

|
||||
*곤란...*
|
||||
|
||||
# 4. 갤러리 다운로드
|
||||
갤러리를 다운로드 하시면 `내장메모리/Pupil/<갤러리ID>` 폴더에 저장됩니다.
|
||||
이미지는 `images` 폴더에 이미지 번호 순서대로 저장되어 있습니다.
|
||||
|
||||
---
|
||||
|
||||
일단 여기까지입니다.
|
||||
더 궁금하신 게 있으시면 이메일 주세요!
|
||||
@@ -1 +0,0 @@
|
||||
/build
|
||||
@@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
import com.google.protobuf.gradle.*
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
kotlin("android")
|
||||
kotlin("kapt")
|
||||
id("kotlin-parcelize")
|
||||
id("kotlinx-serialization")
|
||||
id("com.google.android.gms.oss-licenses-plugin")
|
||||
id("com.google.gms.google-services")
|
||||
id("com.google.firebase.crashlytics")
|
||||
id("com.google.firebase.firebase-perf")
|
||||
id("com.google.protobuf")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 33
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
storeFile = File(System.getenv("SIGNING_STORE_FILE"))
|
||||
storePassword = System.getenv("SIGNING_STORE_PASSWORD")
|
||||
keyAlias = System.getenv("SIGNING_KEY_ALIAS")
|
||||
keyPassword = System.getenv("SIGNING_KEY_PASSWORD")
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "xyz.quaver.pupil"
|
||||
minSdk = 21
|
||||
targetSdk = 33
|
||||
versionCode = 600
|
||||
versionName = VERSION
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
getByName("debug") {
|
||||
isDebuggable = true
|
||||
applicationIdSuffix = ".debug"
|
||||
versionNameSuffix = "-DEBUG"
|
||||
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
|
||||
extra.set("enableCrashlytics", false)
|
||||
extra.set("alwaysUpdateBuildId", false)
|
||||
}
|
||||
getByName("release") {
|
||||
isMinifyEnabled = false
|
||||
applicationIdSuffix = ".beta"
|
||||
|
||||
isCrunchPngs = false
|
||||
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
}
|
||||
|
||||
composeOptions {
|
||||
kotlinCompilerExtensionVersion = Versions.JETPACK_COMPOSE
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
resources.excludes.addAll(
|
||||
listOf(
|
||||
"META-INF/AL2.0",
|
||||
"META-INF/LGPL2.1"
|
||||
)
|
||||
)
|
||||
}
|
||||
namespace = "xyz.quaver.pupil"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.aar"))))
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||
implementation(Kotlin.SERIALIZATION)
|
||||
implementation(Kotlin.COROUTINE)
|
||||
|
||||
implementation("androidx.activity:activity-compose:1.6.1")
|
||||
implementation("androidx.navigation:navigation-compose:2.5.3")
|
||||
|
||||
implementation(JetpackCompose.FOUNDATION)
|
||||
implementation(JetpackCompose.UI)
|
||||
implementation(JetpackCompose.UI_UTIL)
|
||||
implementation(JetpackCompose.UI_TOOLING)
|
||||
implementation(JetpackCompose.ANIMATION)
|
||||
implementation(JetpackCompose.MATERIAL)
|
||||
implementation(JetpackCompose.MATERIAL_ICONS)
|
||||
implementation(JetpackCompose.RUNTIME_LIVEDATA)
|
||||
|
||||
// implementation(JetpackCompose.MARKDOWN)
|
||||
|
||||
implementation(Accompanist.INSETS)
|
||||
implementation(Accompanist.INSETS_UI)
|
||||
implementation(Accompanist.FLOW_LAYOUT)
|
||||
implementation(Accompanist.SYSTEM_UI_CONTROLLER)
|
||||
implementation(Accompanist.DRAWABLE_PAINTER)
|
||||
implementation(Accompanist.APPCOMPAT_THEME)
|
||||
|
||||
implementation("io.coil-kt:coil-compose:2.0.0-rc03")
|
||||
|
||||
implementation(KtorClient.CORE)
|
||||
implementation(KtorClient.OKHTTP)
|
||||
implementation(KtorClient.CONTENT_NEGOTIATION)
|
||||
implementation(KtorClient.SERIALIZATION)
|
||||
|
||||
implementation("androidx.room:room-runtime:2.4.3")
|
||||
annotationProcessor("androidx.room:room-compiler:2.4.3")
|
||||
kapt("androidx.room:room-compiler:2.4.3")
|
||||
implementation("androidx.room:room-ktx:2.4.3")
|
||||
|
||||
implementation("androidx.datastore:datastore:1.0.0")
|
||||
implementation("androidx.datastore:datastore-preferences:1.0.0")
|
||||
|
||||
implementation("org.kodein.di:kodein-di-framework-compose:7.11.0")
|
||||
|
||||
implementation(platform("com.google.firebase:firebase-bom:29.0.3"))
|
||||
implementation("com.google.firebase:firebase-analytics-ktx")
|
||||
implementation("com.google.firebase:firebase-crashlytics-ktx")
|
||||
implementation("com.google.firebase:firebase-perf-ktx")
|
||||
|
||||
implementation("com.google.protobuf:protobuf-javalite:3.19.1")
|
||||
|
||||
implementation("com.google.android.gms:play-services-oss-licenses:17.0.0")
|
||||
|
||||
implementation("org.jsoup:jsoup:1.14.3")
|
||||
|
||||
implementation("xyz.quaver.pupil.sources:core:0.0.1-alpha01-DEV29")
|
||||
|
||||
implementation("xyz.quaver:documentfilex:0.7.2")
|
||||
implementation("xyz.quaver:subsampledimage:0.0.1-alpha22-SNAPSHOT")
|
||||
|
||||
implementation("org.kodein.log:kodein-log:0.12.0")
|
||||
debugImplementation("com.squareup.leakcanary:leakcanary-android:2.8.1")
|
||||
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
testImplementation("org.mockito:mockito-inline:4.4.0")
|
||||
testImplementation(KtorClient.TEST)
|
||||
testImplementation(Kotlin.COROUTINE_TEST)
|
||||
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.3")
|
||||
androidTestImplementation("androidx.test:rules:1.4.0")
|
||||
androidTestImplementation("androidx.test:runner:1.4.0")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
|
||||
androidTestImplementation(KtorClient.TEST)
|
||||
|
||||
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.1.1")
|
||||
}
|
||||
|
||||
protobuf {
|
||||
protoc {
|
||||
artifact = "com.google.protobuf:protoc:3.19.1"
|
||||
}
|
||||
generateProtoTasks {
|
||||
all().forEach { task ->
|
||||
task.builtins {
|
||||
id("java") {
|
||||
option("lite")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task<Exec>("clearAppCache") {
|
||||
commandLine("adb", "shell", "pm", "clear", "xyz.quaver.pupil.debug")
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{"installed":{"client_id":"644157827114-rnbcmlqiaqgg295o45kavchnvi3dedbo.apps.googleusercontent.com","project_id":"pupil-1598439316578","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}
|
||||
@@ -1,45 +0,0 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.kts.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
-dontobfuscate
|
||||
|
||||
-keepattributes *Annotation*, InnerClasses
|
||||
-dontnote kotlinx.serialization.AnnotationsKt # core serialization annotations
|
||||
|
||||
# kotlinx-serialization-json specific. Add this if you have java.lang.NoClassDefFoundError kotlinx.serialization.json.JsonObjectSerializer
|
||||
-keepclassmembers class kotlinx.serialization.json.** {
|
||||
*** Companion;
|
||||
}
|
||||
-keepclasseswithmembers class kotlinx.serialization.json.** {
|
||||
kotlinx.serialization.KSerializer serializer(...);
|
||||
}
|
||||
|
||||
-keep,includedescriptorclasses class xyz.quaver.**$$serializer { *; }
|
||||
-keepclassmembers class xyz.quaver.** {
|
||||
*** Companion;
|
||||
}
|
||||
-keepclasseswithmembers class xyz.quaver.** {
|
||||
kotlinx.serialization.KSerializer serializer(...);
|
||||
}
|
||||
-keepclassmembers class * extends androidx.datastore.preferences.protobuf.GeneratedMessageLite {
|
||||
<fields>;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "xyz.quaver.pupil.beta",
|
||||
"variantName": "release",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 600,
|
||||
"versionName": "6.0.0-alpha02",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2019 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
@file:Suppress("UNUSED_VARIABLE")
|
||||
|
||||
package xyz.quaver.pupil
|
||||
|
||||
import android.util.Log
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.google.api.Http
|
||||
import io.ktor.client.*
|
||||
import io.ktor.client.call.*
|
||||
import io.ktor.client.engine.okhttp.*
|
||||
import io.ktor.client.request.*
|
||||
import io.ktor.client.statement.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Pupil, Hitomi.la viewer for Android
|
||||
~ Copyright (C) 2020 tom5079
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="app_name" translatable="false" tools:override="true">Pupil-Debug</string>
|
||||
</resources>
|
||||
@@ -1,57 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="21"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="21"/>
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" tools:ignore="QueryAllPackagesPermission" />
|
||||
|
||||
|
||||
<application
|
||||
android:name=".Pupil"
|
||||
android:allowBackup="true"
|
||||
android:fullBackupContent="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
tools:replace="android:theme"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<provider
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
|
||||
<activity
|
||||
android:name=".ui.MainActivity"
|
||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||
android:theme="@style/NoActionBarAppTheme"
|
||||
android:exported="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
Before Width: | Height: | Size: 14 KiB |
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2019 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil
|
||||
|
||||
import android.app.Application
|
||||
import android.app.Notification
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import com.google.android.gms.common.GooglePlayServicesNotAvailableException
|
||||
import com.google.android.gms.common.GooglePlayServicesRepairableException
|
||||
import com.google.android.gms.security.ProviderInstaller
|
||||
import io.ktor.client.*
|
||||
import io.ktor.client.engine.okhttp.*
|
||||
import io.ktor.client.plugins.contentnegotiation.*
|
||||
import io.ktor.serialization.kotlinx.json.*
|
||||
import org.kodein.di.*
|
||||
import org.kodein.di.android.x.androidXModule
|
||||
import xyz.quaver.pupil.sources.core.NetworkCache
|
||||
import xyz.quaver.pupil.sources.core.settingsDataStore
|
||||
import xyz.quaver.pupil.util.PupilHttpClient
|
||||
|
||||
class Pupil : Application(), DIAware {
|
||||
|
||||
override val di: DI by DI.lazy {
|
||||
import(androidXModule(this@Pupil))
|
||||
|
||||
bind { singleton { NetworkCache(this@Pupil) } }
|
||||
|
||||
bindSingleton { settingsDataStore }
|
||||
|
||||
bind { singleton { PupilHttpClient(OkHttp.create()) } }
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
|
||||
try {
|
||||
ProviderInstaller.installIfNeeded(this)
|
||||
} catch (e: GooglePlayServicesRepairableException) {
|
||||
e.printStackTrace()
|
||||
} catch (e: GooglePlayServicesNotAvailableException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
val manager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
|
||||
manager.createNotificationChannel(NotificationChannel("download", getString(R.string.channel_download), NotificationManager.IMPORTANCE_LOW).apply {
|
||||
description = getString(R.string.channel_download_description)
|
||||
enableLights(false)
|
||||
enableVibration(false)
|
||||
lockscreenVisibility = Notification.VISIBILITY_SECRET
|
||||
})
|
||||
|
||||
manager.createNotificationChannel(NotificationChannel("downloader", getString(R.string.channel_downloader), NotificationManager.IMPORTANCE_LOW).apply {
|
||||
description = getString(R.string.channel_downloader_description)
|
||||
enableLights(false)
|
||||
enableVibration(false)
|
||||
lockscreenVisibility = Notification.VISIBILITY_SECRET
|
||||
})
|
||||
|
||||
manager.createNotificationChannel(NotificationChannel("update", getString(R.string.channel_update), NotificationManager.IMPORTANCE_HIGH).apply {
|
||||
description = getString(R.string.channel_update_description)
|
||||
enableLights(true)
|
||||
enableVibration(true)
|
||||
lockscreenVisibility = Notification.VISIBILITY_SECRET
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2020 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil.sources
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageInfo
|
||||
import android.content.pm.PackageManager
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import dalvik.system.PathClassLoader
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
import xyz.quaver.pupil.sources.core.Source
|
||||
|
||||
@Composable
|
||||
fun rememberLocalSourceList(context: Context = LocalContext.current): State<List<SourceEntry>> = produceState(emptyList()) {
|
||||
while (true) {
|
||||
value = loadSourceList(context)
|
||||
delay(1000)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun loadSource(context: Context, sourceEntry: SourceEntry): Source = coroutineScope {
|
||||
sourceCacheMutex.withLock {
|
||||
sourceCache[sourceEntry.packageName] ?: run {
|
||||
val classLoader = PathClassLoader(sourceEntry.sourceDir, null, context.classLoader)
|
||||
|
||||
Class.forName("${sourceEntry.packagePath}${sourceEntry.sourcePath}", false, classLoader)
|
||||
.getConstructor(Application::class.java)
|
||||
.newInstance(context.applicationContext) as Source
|
||||
}.also { sourceCache[sourceEntry.packageName] = it }
|
||||
}
|
||||
}
|
||||
|
||||
private const val SOURCES_FEATURE = "pupil.sources"
|
||||
private const val SOURCES_PACKAGE_PREFIX = "xyz.quaver.pupil.sources"
|
||||
private const val SOURCES_PATH = "pupil.sources.path"
|
||||
|
||||
private val PackageInfo.isSourceFeatureEnabled
|
||||
get() = this.reqFeatures.orEmpty().any { it.name == SOURCES_FEATURE }
|
||||
|
||||
private fun loadSource(context: Context, packageInfo: PackageInfo): List<SourceEntry> {
|
||||
val packageManager = context.packageManager
|
||||
|
||||
val applicationInfo = packageInfo.applicationInfo
|
||||
|
||||
val packageName = packageManager.getApplicationLabel(applicationInfo).toString().substringAfter("[Pupil] ")
|
||||
val packagePath = packageInfo.packageName
|
||||
|
||||
val icon = packageManager.getApplicationIcon(applicationInfo)
|
||||
|
||||
val version = packageInfo.versionName
|
||||
|
||||
return packageInfo
|
||||
.applicationInfo
|
||||
.metaData
|
||||
?.getString(SOURCES_PATH)
|
||||
?.split(';')
|
||||
?.map { source ->
|
||||
val (sourceName, sourcePath) = source.split(':', limit = 2)
|
||||
SourceEntry(
|
||||
packageName,
|
||||
packagePath,
|
||||
sourceName,
|
||||
sourcePath,
|
||||
applicationInfo.sourceDir,
|
||||
icon,
|
||||
version
|
||||
)
|
||||
}.orEmpty()
|
||||
}
|
||||
|
||||
private val sourceCacheMutex = Mutex()
|
||||
private val sourceCache = mutableMapOf<String, Source>()
|
||||
|
||||
private fun loadSourceList(context: Context): List<SourceEntry> {
|
||||
val packageManager = context.packageManager
|
||||
|
||||
val packages = packageManager.getInstalledPackages(
|
||||
PackageManager.GET_CONFIGURATIONS or PackageManager.GET_META_DATA
|
||||
)
|
||||
|
||||
return packages.flatMap { packageInfo ->
|
||||
if (packageInfo.isSourceFeatureEnabled)
|
||||
loadSource(context, packageInfo)
|
||||
else
|
||||
emptyList()
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2022 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil.sources
|
||||
|
||||
import androidx.compose.runtime.*
|
||||
import kotlinx.coroutines.delay
|
||||
import org.kodein.di.compose.localDI
|
||||
import org.kodein.di.compose.rememberInstance
|
||||
import org.kodein.di.direct
|
||||
import org.kodein.di.instance
|
||||
import xyz.quaver.pupil.util.PupilHttpClient
|
||||
import xyz.quaver.pupil.util.RemoteSourceInfo
|
||||
|
||||
@Composable
|
||||
fun rememberRemoteSourceList(client: PupilHttpClient = localDI().direct.instance()) = produceState<Map<String, RemoteSourceInfo>?>(null) {
|
||||
while (true) {
|
||||
value = client.getRemoteSourceList()
|
||||
delay(1000)
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2022 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil.sources
|
||||
|
||||
import android.graphics.drawable.Drawable
|
||||
|
||||
data class SourceEntry(
|
||||
val packageName: String,
|
||||
val packagePath: String,
|
||||
val sourceName: String,
|
||||
val sourcePath: String,
|
||||
val sourceDir: String,
|
||||
val icon: Drawable,
|
||||
val version: String
|
||||
)
|
||||
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2019 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.compose.animation.Crossfade
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import com.google.accompanist.insets.ProvideWindowInsets
|
||||
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||
import kotlinx.coroutines.launch
|
||||
import org.kodein.di.*
|
||||
import org.kodein.di.android.closestDI
|
||||
import org.kodein.di.android.subDI
|
||||
import org.kodein.di.compose.rememberInstance
|
||||
import xyz.quaver.pupil.BuildConfig
|
||||
import xyz.quaver.pupil.sources.core.Source
|
||||
import xyz.quaver.pupil.sources.core.util.LocalActivity
|
||||
import xyz.quaver.pupil.sources.loadSource
|
||||
import xyz.quaver.pupil.ui.theme.PupilTheme
|
||||
import xyz.quaver.pupil.util.PupilHttpClient
|
||||
import xyz.quaver.pupil.util.Release
|
||||
|
||||
class MainActivity : ComponentActivity(), DIAware {
|
||||
override val di by closestDI()
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
|
||||
setContent {
|
||||
PupilTheme {
|
||||
ProvideWindowInsets(windowInsetsAnimationsEnabled = true) {
|
||||
val navController = rememberNavController()
|
||||
|
||||
val systemUiController = rememberSystemUiController()
|
||||
val useDarkIcons = MaterialTheme.colors.isLight
|
||||
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
|
||||
val client: PupilHttpClient by rememberInstance()
|
||||
|
||||
val latestRelease by produceState<Release?>(null) {
|
||||
value = null //client.latestRelease()
|
||||
}
|
||||
|
||||
var dismissUpdate by remember { mutableStateOf(false) }
|
||||
|
||||
SideEffect {
|
||||
systemUiController.setSystemBarsColor(
|
||||
color = Color.Transparent,
|
||||
darkIcons = useDarkIcons
|
||||
)
|
||||
}
|
||||
|
||||
latestRelease?.let { release ->
|
||||
UpdateAlertDialog(
|
||||
show = !dismissUpdate && release.version != BuildConfig.VERSION_NAME,
|
||||
release = release,
|
||||
onDismiss = { dismissUpdate = true }
|
||||
)
|
||||
}
|
||||
|
||||
NavHost(navController, "main") {
|
||||
composable("main") {
|
||||
var source by remember { mutableStateOf<Source?>(null) }
|
||||
|
||||
BackHandler(
|
||||
enabled = source != null
|
||||
) {
|
||||
source = null
|
||||
}
|
||||
|
||||
Crossfade(source) { _source ->
|
||||
if (_source == null)
|
||||
SourceSelector {
|
||||
coroutineScope.launch {
|
||||
source = loadSource(application, it)
|
||||
}
|
||||
}
|
||||
else {
|
||||
CompositionLocalProvider(LocalActivity provides this@MainActivity) {
|
||||
_source.Entry()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
composable("settings") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,352 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2021 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil.ui
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.provider.Settings
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material.*
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Download
|
||||
import androidx.compose.material.icons.filled.DownloadDone
|
||||
import androidx.compose.material.icons.filled.Explore
|
||||
import androidx.compose.material.icons.outlined.Info
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.text.capitalize
|
||||
import androidx.compose.ui.text.intl.Locale
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.navigation.NavDestination.Companion.hierarchy
|
||||
import androidx.navigation.NavGraph.Companion.findStartDestination
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import androidx.navigation.compose.currentBackStackEntryAsState
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import coil.compose.AsyncImage
|
||||
import com.google.accompanist.drawablepainter.rememberDrawablePainter
|
||||
import com.google.accompanist.insets.LocalWindowInsets
|
||||
import com.google.accompanist.insets.rememberInsetsPaddingValues
|
||||
import com.google.accompanist.insets.systemBarsPadding
|
||||
import com.google.accompanist.insets.ui.BottomNavigation
|
||||
import com.google.accompanist.insets.ui.Scaffold
|
||||
import com.google.accompanist.insets.ui.TopAppBar
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.kodein.di.DI
|
||||
import org.kodein.di.DIAware
|
||||
import org.kodein.di.compose.localDI
|
||||
import org.kodein.di.instance
|
||||
import xyz.quaver.pupil.sources.SourceEntry
|
||||
import xyz.quaver.pupil.sources.rememberLocalSourceList
|
||||
import xyz.quaver.pupil.sources.rememberRemoteSourceList
|
||||
import xyz.quaver.pupil.util.PupilHttpClient
|
||||
import xyz.quaver.pupil.util.RemoteSourceInfo
|
||||
import xyz.quaver.pupil.util.launchApkInstaller
|
||||
import java.io.File
|
||||
|
||||
private sealed class SourceSelectorScreen(val route: String, val icon: ImageVector) {
|
||||
object Local: SourceSelectorScreen("local", Icons.Default.DownloadDone)
|
||||
object Explore: SourceSelectorScreen("explore", Icons.Default.Explore)
|
||||
}
|
||||
|
||||
private val sourceSelectorScreens = listOf(
|
||||
SourceSelectorScreen.Local,
|
||||
SourceSelectorScreen.Explore
|
||||
)
|
||||
|
||||
private val RemoteSourceInfo.apkUrl: String
|
||||
get() = "https://github.com/tom5079/PupilSources/releases/download/$name-$version/$projectName-release.apk"
|
||||
|
||||
|
||||
class DownloadApkActionState(override val di: DI) : DIAware {
|
||||
private val app: Application by instance()
|
||||
private val client: PupilHttpClient by instance()
|
||||
|
||||
var progress by mutableStateOf<Float?>(null)
|
||||
private set
|
||||
|
||||
suspend fun download(url: String): File? = withContext(Dispatchers.IO) {
|
||||
progress = 0f
|
||||
|
||||
val file = File.createTempFile("pupil", ".apk", File(app.cacheDir, "apks").also {
|
||||
it.mkdirs()
|
||||
})
|
||||
|
||||
client.downloadFile(url, file).collect { progress = it }
|
||||
|
||||
if (progress == Float.POSITIVE_INFINITY) file else null
|
||||
}
|
||||
|
||||
fun reset() {
|
||||
progress = null
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun rememberDownloadApkActionState(di: DI = localDI()) = remember { DownloadApkActionState(di) }
|
||||
|
||||
@Composable
|
||||
fun DownloadApkAction(
|
||||
state: DownloadApkActionState,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
state.progress?.let { progress ->
|
||||
Box(
|
||||
Modifier.padding(12.dp, 0.dp)
|
||||
) {
|
||||
when {
|
||||
progress.isFinite() && progress > 0f ->
|
||||
CircularProgressIndicator(progress, modifier = Modifier.size(24.dp))
|
||||
else ->
|
||||
CircularProgressIndicator(modifier = Modifier.size(24.dp))
|
||||
}
|
||||
}
|
||||
|
||||
true
|
||||
} ?: content()
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun SourceListItem(icon: @Composable (Modifier) -> Unit = { }, name: String, version: String, actions: @Composable () -> Unit = { }) {
|
||||
Card(
|
||||
modifier = Modifier.padding(8.dp),
|
||||
elevation = 4.dp
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
icon(Modifier.size(48.dp))
|
||||
|
||||
Column(
|
||||
Modifier.weight(1f)
|
||||
) {
|
||||
Text(name.capitalize(Locale.current))
|
||||
|
||||
CompositionLocalProvider(LocalContentAlpha provides 0.5f) {
|
||||
Text(
|
||||
"v$version",
|
||||
style = MaterialTheme.typography.caption
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
actions()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun Local(onSource: (SourceEntry) -> Unit) {
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
val context = LocalContext.current
|
||||
|
||||
val localSourceList by rememberLocalSourceList()
|
||||
val remoteSourceList by rememberRemoteSourceList()
|
||||
|
||||
if (localSourceList.isEmpty()) {
|
||||
Box(Modifier.fillMaxSize()) {
|
||||
Column(
|
||||
Modifier.align(Alignment.Center),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp)
|
||||
) {
|
||||
CompositionLocalProvider(LocalContentAlpha provides 0.5f) {
|
||||
Text("(´∇`)", style = MaterialTheme.typography.h2)
|
||||
}
|
||||
Text("No sources found!\nLet's go download one.", textAlign = TextAlign.Center)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LazyColumn {
|
||||
items(localSourceList) { source ->
|
||||
val actionState = rememberDownloadApkActionState()
|
||||
|
||||
SourceListItem(
|
||||
icon = { modifier ->
|
||||
Image(
|
||||
rememberDrawablePainter(source.icon),
|
||||
contentDescription = "source icon",
|
||||
modifier = modifier
|
||||
)
|
||||
},
|
||||
source.sourceName,
|
||||
source.version
|
||||
) {
|
||||
DownloadApkAction(actionState) {
|
||||
val remoteSource = remoteSourceList?.get(source.packageName)
|
||||
if (remoteSource != null && remoteSource.version != source.version) {
|
||||
TextButton(onClick = {
|
||||
coroutineScope.launch {
|
||||
val file = actionState.download(remoteSource.apkUrl)!! // TODO("Handle error")
|
||||
context.launchApkInstaller(file)
|
||||
actionState.reset()
|
||||
}
|
||||
}) {
|
||||
Text("UPDATE")
|
||||
}
|
||||
} else {
|
||||
TextButton(
|
||||
onClick = { onSource(source) }
|
||||
) {
|
||||
Text("GO")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun Explore() {
|
||||
val localSourceList by rememberLocalSourceList()
|
||||
val localSources by derivedStateOf {
|
||||
localSourceList.associateBy {
|
||||
it.packageName
|
||||
}
|
||||
}
|
||||
|
||||
val context = LocalContext.current
|
||||
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
|
||||
val remoteSources by rememberRemoteSourceList()
|
||||
|
||||
Box(
|
||||
Modifier.fillMaxSize()
|
||||
) {
|
||||
if (remoteSources == null)
|
||||
CircularProgressIndicator(Modifier.align(Alignment.Center))
|
||||
else
|
||||
LazyColumn {
|
||||
items(remoteSources?.values?.toList().orEmpty()) { sourceInfo ->
|
||||
val actionState = rememberDownloadApkActionState()
|
||||
|
||||
SourceListItem(
|
||||
icon = { modifier ->
|
||||
AsyncImage(
|
||||
"https://raw.githubusercontent.com/tom5079/PupilSources/master/${sourceInfo.projectName}/src/main/res/mipmap-xxxhdpi/ic_launcher.png",
|
||||
contentDescription = "source icon",
|
||||
modifier = modifier
|
||||
)
|
||||
},
|
||||
sourceInfo.name,
|
||||
sourceInfo.version
|
||||
) {
|
||||
DownloadApkAction(actionState) {
|
||||
if (localSources[sourceInfo.name]?.version != sourceInfo.version) {
|
||||
TextButton(onClick = {
|
||||
coroutineScope.launch {
|
||||
val file = actionState.download(sourceInfo.apkUrl)!! // TODO("Handle exception")
|
||||
context.launchApkInstaller(file)
|
||||
actionState.reset()
|
||||
}
|
||||
}) {
|
||||
Text("UPDATE")
|
||||
}
|
||||
} else {
|
||||
IconButton(onClick = {
|
||||
if (sourceInfo.name in localSources) {
|
||||
context.startActivity(
|
||||
Intent(
|
||||
Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
|
||||
Uri.fromParts("package", localSources[sourceInfo.name]!!.packagePath, null)
|
||||
)
|
||||
)
|
||||
} else coroutineScope.launch {
|
||||
val file = actionState.download(sourceInfo.apkUrl)!! // TODO("Handle exception")
|
||||
context.launchApkInstaller(file)
|
||||
actionState.reset()
|
||||
}
|
||||
}) {
|
||||
Icon(
|
||||
if (sourceInfo.name !in localSources) Icons.Default.Download
|
||||
else Icons.Outlined.Info,
|
||||
contentDescription = "download"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun SourceSelector(onSource: (SourceEntry) -> Unit) {
|
||||
val bottomNavController = rememberNavController()
|
||||
|
||||
Scaffold(
|
||||
topBar = {
|
||||
TopAppBar(
|
||||
title = {
|
||||
Text("Pupil")
|
||||
},
|
||||
contentPadding = rememberInsetsPaddingValues(LocalWindowInsets.current.statusBars)
|
||||
)
|
||||
},
|
||||
bottomBar = {
|
||||
BottomNavigation(
|
||||
contentPadding = rememberInsetsPaddingValues(LocalWindowInsets.current.navigationBars)
|
||||
) {
|
||||
val navBackStackEntry by bottomNavController.currentBackStackEntryAsState()
|
||||
val currentDestination = navBackStackEntry?.destination
|
||||
|
||||
sourceSelectorScreens.forEach { screen ->
|
||||
BottomNavigationItem(
|
||||
icon = { Icon(screen.icon, contentDescription = screen.route) },
|
||||
label = { Text(screen.route) },
|
||||
selected = currentDestination?.hierarchy?.any { it.route == screen.route } == true,
|
||||
onClick = {
|
||||
bottomNavController.navigate(screen.route) {
|
||||
popUpTo(bottomNavController.graph.findStartDestination().id) {
|
||||
saveState = true
|
||||
}
|
||||
launchSingleTop = true
|
||||
restoreState = true
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
) { contentPadding ->
|
||||
NavHost(bottomNavController, startDestination = "local", modifier = Modifier
|
||||
.systemBarsPadding(top = false, bottom = false)
|
||||
.padding(contentPadding)) {
|
||||
composable(SourceSelectorScreen.Local.route) { Local(onSource) }
|
||||
composable(SourceSelectorScreen.Explore.route) { Explore() }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2022 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil.ui
|
||||
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material.*
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import kotlinx.coroutines.launch
|
||||
import org.kodein.di.compose.onDIContext
|
||||
import xyz.quaver.pupil.util.Release
|
||||
import xyz.quaver.pupil.util.launchApkInstaller
|
||||
import java.util.*
|
||||
|
||||
@Composable
|
||||
fun UpdateAlertDialog(
|
||||
show: Boolean,
|
||||
release: Release,
|
||||
onDismiss: () -> Unit
|
||||
) {
|
||||
val state = rememberDownloadApkActionState()
|
||||
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
val context = LocalContext.current
|
||||
|
||||
if (show) {
|
||||
Dialog(onDismissRequest = { if (state.progress == null) onDismiss() }) {
|
||||
Card {
|
||||
val progress = state.progress
|
||||
|
||||
if (progress != null) {
|
||||
if (progress.isFinite() && progress > 0)
|
||||
LinearProgressIndicator(progress)
|
||||
else
|
||||
LinearProgressIndicator()
|
||||
}
|
||||
|
||||
Column(
|
||||
Modifier.padding(start = 8.dp, top = 8.dp, end = 8.dp, bottom = 0.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
Text(
|
||||
"Update Available",
|
||||
style = MaterialTheme.typography.h6
|
||||
)
|
||||
|
||||
Text(release.releaseNotes.getOrElse(Locale.getDefault()) { release.releaseNotes[Locale.ENGLISH]!! })
|
||||
|
||||
Row(
|
||||
Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.End
|
||||
) {
|
||||
TextButton(onClick = onDismiss, enabled = progress == null) {
|
||||
Text("DISMISS")
|
||||
}
|
||||
|
||||
TextButton(
|
||||
onClick = {
|
||||
coroutineScope.launch {
|
||||
val file = state.download(release.apkUrl)!! // TODO("Handle exception")
|
||||
context.launchApkInstaller(file)
|
||||
state.reset()
|
||||
onDismiss()
|
||||
}
|
||||
},
|
||||
enabled = progress == null
|
||||
) {
|
||||
Text("UPDATE")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2021 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
val LightBlue300 = Color(0xFF4FC3F7)
|
||||
val LightBlue700 = Color(0xFF0288D1)
|
||||
val Pink600 = Color(0xFFD81B60)
|
||||
val Blue700 = Color(0xFF1976D2)
|
||||
val GreenA700 = Color(0xFF00C853)
|
||||
val Orange500 = Color(0xFFFF9800)
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2021 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil.ui.theme
|
||||
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.Shapes
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
val Shapes = Shapes(
|
||||
small = RoundedCornerShape(4.dp),
|
||||
medium = RoundedCornerShape(4.dp),
|
||||
large = RoundedCornerShape(0.dp)
|
||||
)
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2021 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil.ui.theme
|
||||
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.contentColorFor
|
||||
import androidx.compose.material.darkColors
|
||||
import androidx.compose.material.lightColors
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
private val DarkColorPalette = darkColors(
|
||||
primary = LightBlue300,
|
||||
primaryVariant = LightBlue700,
|
||||
secondary = Pink600,
|
||||
onPrimary = Color.White,
|
||||
onSecondary = Color.White
|
||||
)
|
||||
private val LightColorPalette = lightColors(
|
||||
primary = LightBlue300,
|
||||
primaryVariant = LightBlue700,
|
||||
secondary = Pink600,
|
||||
onPrimary = Color.White,
|
||||
onSecondary = Color.White
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun PupilTheme(
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
val colors = if (darkTheme) DarkColorPalette else LightColorPalette
|
||||
|
||||
MaterialTheme(
|
||||
colors = colors,
|
||||
typography = Typography,
|
||||
shapes = Shapes,
|
||||
content = content
|
||||
)
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2021 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil.ui.theme
|
||||
|
||||
import androidx.compose.material.Typography
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
val Typography = Typography(
|
||||
body1 = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp
|
||||
)
|
||||
)
|
||||
@@ -1,156 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2022 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil.util
|
||||
|
||||
import androidx.compose.ui.res.stringArrayResource
|
||||
import io.ktor.client.*
|
||||
import io.ktor.client.call.*
|
||||
import io.ktor.client.engine.*
|
||||
import io.ktor.client.plugins.contentnegotiation.*
|
||||
import io.ktor.client.request.*
|
||||
import io.ktor.client.statement.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.serialization.kotlinx.json.*
|
||||
import io.ktor.utils.io.core.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.flow
|
||||
import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.withContext
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.*
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
@Serializable
|
||||
data class RemoteSourceInfo(
|
||||
val projectName: String,
|
||||
val name: String,
|
||||
val version: String
|
||||
)
|
||||
|
||||
class Release(
|
||||
val version: String,
|
||||
val apkUrl: String,
|
||||
val releaseNotes: Map<Locale, String>
|
||||
)
|
||||
|
||||
private val localeMap = mapOf(
|
||||
"한국어" to Locale.KOREAN,
|
||||
"日本語" to Locale.JAPANESE,
|
||||
"English" to Locale.ENGLISH
|
||||
)
|
||||
|
||||
class PupilHttpClient(engine: HttpClientEngine) {
|
||||
private val httpClient = HttpClient(engine) {
|
||||
install(ContentNegotiation) {
|
||||
json()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a list of available sources from PupilSources repository.
|
||||
* Returns empty map when exception occurs
|
||||
*/
|
||||
suspend fun getRemoteSourceList(): Map<String, RemoteSourceInfo> = withContext(Dispatchers.IO) {
|
||||
runCatching {
|
||||
httpClient.get("https://tom5079.github.io/PupilSources/versions.json").body<Map<String, RemoteSourceInfo>>()
|
||||
}.getOrDefault(emptyMap())
|
||||
}
|
||||
|
||||
/**
|
||||
* Downloads specific file from :url to :dest.
|
||||
* Returns flow that emits progress.
|
||||
* when value emitted by flow {
|
||||
* in 0f .. 1f -> downloading
|
||||
* POSITIVE_INFINITY -> download finised
|
||||
* NEGATIVE_INFINITY -> exception occured
|
||||
* }
|
||||
*/
|
||||
fun downloadFile(url: String, dest: File) = flow {
|
||||
runCatching {
|
||||
httpClient.prepareGet(url).execute { response ->
|
||||
val channel = response.bodyAsChannel()
|
||||
val contentLength = response.contentLength() ?: -1
|
||||
var readBytes = 0f
|
||||
|
||||
dest.outputStream().use { outputStream ->
|
||||
while (!channel.isClosedForRead) {
|
||||
val packet = channel.readRemaining(DEFAULT_BUFFER_SIZE.toLong())
|
||||
while (!packet.isEmpty) {
|
||||
val bytes = packet.readBytes()
|
||||
outputStream.write(bytes)
|
||||
|
||||
readBytes += bytes.size
|
||||
emit(readBytes / contentLength)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emit(Float.POSITIVE_INFINITY)
|
||||
}.onFailure {
|
||||
emit(Float.NEGATIVE_INFINITY)
|
||||
}
|
||||
}.flowOn(Dispatchers.IO)
|
||||
|
||||
/**
|
||||
* Latest application release info from Github API.
|
||||
* Returns null when exception occurs.
|
||||
*/
|
||||
suspend fun latestRelease(beta: Boolean = true): Release? = withContext(Dispatchers.IO) {
|
||||
runCatching {
|
||||
val releases = Json.parseToJsonElement(
|
||||
httpClient.get("https://api.github.com/repos/tom5079/Pupil/releases").bodyAsText()
|
||||
).jsonArray
|
||||
|
||||
val latestRelease = releases.first { release ->
|
||||
beta || !release.jsonObject["prerelease"]!!.jsonPrimitive.boolean
|
||||
}.jsonObject
|
||||
|
||||
val version = latestRelease["tag_name"]!!.jsonPrimitive.content
|
||||
|
||||
val apkUrl = latestRelease["assets"]!!.jsonArray.first { asset ->
|
||||
val name = asset.jsonObject["name"]!!.jsonPrimitive.content
|
||||
name.startsWith("Pupil-v") && name.endsWith(".apk")
|
||||
}.jsonObject["browser_download_url"]!!.jsonPrimitive.content
|
||||
|
||||
val releaseNotes: Map<Locale, String> = buildMap {
|
||||
val body = latestRelease["body"]!!.jsonPrimitive.content
|
||||
|
||||
var locale: Locale? = null
|
||||
val stringBuilder = StringBuilder()
|
||||
body.lineSequence().forEach { line ->
|
||||
localeMap[line.drop(3)]?.let { newLocale ->
|
||||
if (locale != null) {
|
||||
put(locale!!, stringBuilder.deleteCharAt(stringBuilder.length-1).toString())
|
||||
stringBuilder.clear()
|
||||
}
|
||||
locale = newLocale
|
||||
return@forEach
|
||||
}
|
||||
|
||||
if (locale != null) stringBuilder.appendLine(line)
|
||||
}
|
||||
put(locale!!, stringBuilder.deleteCharAt(stringBuilder.length-1).toString())
|
||||
}
|
||||
|
||||
Release(version, apkUrl, releaseNotes)
|
||||
}.getOrNull()
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2022 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil.util
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.webkit.MimeTypeMap
|
||||
import androidx.core.content.FileProvider
|
||||
import java.io.File
|
||||
|
||||
fun Context.launchApkInstaller(file: File) {
|
||||
val uri = FileProvider.getUriForFile(this, "$packageName.fileprovider", file)
|
||||
|
||||
val intent = Intent(Intent.ACTION_VIEW).apply {
|
||||
flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or
|
||||
Intent.FLAG_GRANT_READ_URI_PERMISSION or
|
||||
Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
setDataAndType(uri, MimeTypeMap.getSingleton().getMimeTypeFromExtension("apk"))
|
||||
}
|
||||
|
||||
startActivity(intent)
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.7 KiB |
@@ -1,4 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24.0" android:viewportHeight="24.0">
|
||||
<path android:fillColor="#fff" android:pathData="M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73 0.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/>
|
||||
<path android:fillColor="#fff" android:pathData="M8.5 15a1.5 1.5 0 1 1 1.5 1.5A1.5 1.5 0 0 1 8.5 15z"/>
|
||||
</vector>
|
||||
@@ -1,3 +0,0 @@
|
||||
<vector android:height="24dp" android:width="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@color/material_orange_500" android:pathData="M12 15.39l-3.76 2.27 0.99-4.28-3.32-2.88 4.38-0.37L12 6.09l1.71 4.04 4.38 0.37-3.32 2.88 0.99 4.28M22 9.24l-7.19-0.61L12 2 9.19 8.63 2 9.24l5.45 4.73L5.82 21 12 17.27 18.18 21l-1.64-7.03L22 9.24z"/>
|
||||
</vector>
|
||||
|
Before Width: | Height: | Size: 3.3 KiB |
@@ -1,4 +0,0 @@
|
||||
<!--drawable/numeric.xml-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:fillColor="#fff" android:pathData="M4 17V9H2V7h4v10H4m18-2c0 1.11-0.9 2-2 2h-4v-2h4v-2h-2v-2h2V9h-4V7h4a2 2 0 0 1 2 2v1.5a1.5 1.5 0 0 1-1.5 1.5 1.5 1.5 0 0 1 1.5 1.5V15m-8 0v2H8v-4c0-1.11 0.9-2 2-2h2V9H8V7h4a2 2 0 0 1 2 2v2c0 1.11-0.9 2-2 2h-2v2h4z"/>
|
||||
</vector>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 835 B |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 10 KiB |
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Pupil, Hitomi.la viewer for Android
|
||||
~ Copyright (C) 2020 tom5079
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources></resources>
|
||||
@@ -1,160 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="galleryblock_language">言語: %1$s</string>
|
||||
<string name="galleryblock_series">シリーズ: %1$s</string>
|
||||
<string name="galleryblock_type">タイプ: %1$s</string>
|
||||
<string name="main_no_result">結果なし</string>
|
||||
<string name="search_hint">検索…</string>
|
||||
<string name="settings_clear_cache">キャッシュクリア</string>
|
||||
<string name="settings_clear_cache_alert_message">キャッシュをクリアするとイメージのロード速度に影響を与えます。実行しますか?</string>
|
||||
<string name="settings_storage_usage">%s使用中</string>
|
||||
<string name="settings_storage_usage_loading">ストレージ使用量読み込み中…</string>
|
||||
<string name="settings_default_query">デフォルトキーワード</string>
|
||||
<string name="settings_galleries_per_page">一回にロードするギャラリー数</string>
|
||||
<string name="settings_search_title">検索設定</string>
|
||||
<string name="settings_title">設定</string>
|
||||
<string name="update_notification_description">アップデートダウンロード中</string>
|
||||
<string name="update_title">新しいアップデートがあります</string>
|
||||
<string name="warning">注意</string>
|
||||
<string name="settings_miscellaneous_title">その他</string>
|
||||
<string name="settings_mirror_title">ミラーサーバー</string>
|
||||
<string name="settings_clear_history">履歴を削除</string>
|
||||
<string name="settings_clear_history_alert_message">履歴を削除しますか?</string>
|
||||
<string name="settings_clear_history_summary">履歴数: %1$d</string>
|
||||
<string name="main_drawer_history">履歴</string>
|
||||
<string name="main_drawer_home">トップ</string>
|
||||
<string name="update_release_note"># リリースノート(v%1$s)\n%2$s</string>
|
||||
<string name="settings_security_mode_title">セキュリティーモード</string>
|
||||
<string name="settings_security_mode_summary">アプリ履歴でアプリの画面を表示しない</string>
|
||||
<string name="reader_go_to_page">移動</string>
|
||||
<string name="default_query_dialog_language_selector_none">非選択</string>
|
||||
<string name="default_query_dialog_filter_BL">BLフィルター</string>
|
||||
<string name="default_query_dialog_filter_guro">グロフィルター</string>
|
||||
<string name="default_query_dialog_language">"言語: "</string>
|
||||
<string name="default_query_dialog_title">デフォルトキーワード設定</string>
|
||||
<string name="main_drawer_group_contact_title">お問い合わせ先</string>
|
||||
<string name="main_drawer_group_contact_homepage">ホームページ</string>
|
||||
<string name="main_drawer_group_contact_help">ヘルプ</string>
|
||||
<string name="main_drawer_group_contact_github">Github</string>
|
||||
<string name="main_drawer_group_contact_email">メールを送る</string>
|
||||
<string name="reader_fab_fullscreen">フルスクリーン</string>
|
||||
<string name="channel_download">ダウンロード</string>
|
||||
<string name="channel_download_description">ダウンロードの進行を通知</string>
|
||||
<string name="reader_fab_download">バックグラウンドダウンロード</string>
|
||||
<string name="reader_notification_text">ダウンロード中…</string>
|
||||
<string name="reader_notification_complete">ダウンロード完了</string>
|
||||
<string name="reader_fab_download_cancel">バックグラウンドダウンロード中止</string>
|
||||
<string name="main_drawer_downloads">ダウンロード</string>
|
||||
<string name="main_jump_title">ページ移動</string>
|
||||
<string name="main_jump_message">現ページ番号: %1$d\nページ数: %2$d</string>
|
||||
<string name="unable_to_connect">hitomi.laに接続できません</string>
|
||||
<string name="main_move_to_page">%1$dページへ移動</string>
|
||||
<string name="settings_clear_downloads">ダウンロード削除</string>
|
||||
<string name="settings_clear_downloads_alert_message">ダウンロードしたギャラリーを全て削除します。\n実行しますか?</string>
|
||||
<string name="settings_mirror_summary">ミラーサーバからイメージをロード</string>
|
||||
<string name="main_drawer_favorite">ブックマーク</string>
|
||||
<string name="main_open_gallery_by_id">ギャラリー番号で見る</string>
|
||||
<string name="reader_failed_to_find_gallery">エラーが発生しました</string>
|
||||
<string name="settings_storage">ストレージ</string>
|
||||
<string name="main_drawer_grouop_contact_discord">ディスコード</string>
|
||||
<string name="settings_app_lock">アプリロック</string>
|
||||
<string name="settings_app_lock_type">アップロックの種類</string>
|
||||
<string name="settings_app_version_title">バージョン(アップデート確認)</string>
|
||||
<string name="settings_lock_biometrics">生体認識</string>
|
||||
<string name="settings_lock_confirm">ロック確認のためもう一回入力してください。</string>
|
||||
<string name="settings_lock_enabled">有効</string>
|
||||
<string name="settings_lock_fingerprint">指紋</string>
|
||||
<string name="settings_lock_password">パスワード</string>
|
||||
<string name="settings_lock_pattern">パターン</string>
|
||||
<string name="settings_lock_wrong_confirm">ロックが一致しません。やり直してください。</string>
|
||||
<string name="settings_lock_none">なし</string>
|
||||
<string name="settings_lock_remove_message">ロックを無効にしますか?</string>
|
||||
<string name="reader_loading">ロード中</string>
|
||||
<string name="main_menu_sort">ソート</string>
|
||||
<string name="main_menu_sort_newest">投稿日時順</string>
|
||||
<string name="main_menu_sort_popular">人気順</string>
|
||||
<string name="ignore">無視</string>
|
||||
<string name="lock_corrupted">ロックファイルが破損されています。Pupilを再再インストールしてください。</string>
|
||||
<string name="settings_dark_mode_title">ダークモード</string>
|
||||
<string name="settings_dark_mode_summary">夜にシコりたい方々へ</string>
|
||||
<string name="gallery_details">ギャラリー情報</string>
|
||||
<string name="gallery_artists">アーティスト</string>
|
||||
<string name="gallery_characters">キャラクター</string>
|
||||
<string name="gallery_groups">グループ</string>
|
||||
<string name="gallery_language">言語</string>
|
||||
<string name="gallery_series">シリーズ</string>
|
||||
<string name="gallery_tags">タグ</string>
|
||||
<string name="gallery_thumbnails">サムネイル</string>
|
||||
<string name="gallery_related">おすすめ</string>
|
||||
<string name="settings_nomedia_title">イメージを隠す</string>
|
||||
<string name="main_delete">削除</string>
|
||||
<string name="main_download">ダウンロード</string>
|
||||
<string name="settings_backup_title">ブックマークバックアップ</string>
|
||||
<string name="settings_restore_title">ブックマーク復元</string>
|
||||
<string name="settings_backup_file_created">バックアップファイルを作成しました</string>
|
||||
<string name="settings_restore_failed">復元に失敗しました</string>
|
||||
<string name="settings_restore_success">%1$d項目を復元しました</string>
|
||||
<string name="settings_download_folder">ダウンロード場所</string>
|
||||
<string name="settings_download_folder_internal">内部ストレージ</string>
|
||||
<string name="settings_download_folder_removable">外部SDカード</string>
|
||||
<string name="settings_download_folder_available">%s 使用可能</string>
|
||||
<string name="update_download_completed">ダウンロードが完了しました</string>
|
||||
<string name="update_download_completed_description">ここをクリックしてアップデートを行えます</string>
|
||||
<string name="settings_beta">ベータチャンネルでアップデートを受信</string>
|
||||
<string name="settings_app_version_description">v%s</string>
|
||||
<string name="settings_low_quality">低解像度イメージ</string>
|
||||
<string name="settings_low_quality_summary">ロード速度とデータ使用料を改善するため低解像度イメージをロード</string>
|
||||
<string name="settings_download_folder_custom">手動で設定</string>
|
||||
<string name="settings_download_folder_not_writable">このフォルダにアクセスできません。他のフォルダを選択してください。</string>
|
||||
<string name="settings_proxy_title">プロクシ</string>
|
||||
<string name="proxy_dialog_username_hint">ID</string>
|
||||
<string name="proxy_dialog_type">プロクシタイプ</string>
|
||||
<string name="proxy_dialog_port_hint">ポート</string>
|
||||
<string name="proxy_dialog_password_hint">パスワード</string>
|
||||
<string name="proxy_dialog_error">エラー</string>
|
||||
<string name="proxy_dialog_addr_hint">サーバーアドレス</string>
|
||||
<string name="proxy_dialog_server">サーバー</string>
|
||||
<string name="main_menu_thin">簡単モード</string>
|
||||
<string name="main_fab_cancel">すべてのダウンロードキャンセル</string>
|
||||
<string name="channel_update">アップデート</string>
|
||||
<string name="channel_update_description">アップデートの進行状態を表示</string>
|
||||
<string name="settings_import_old_galleries">旧ギャラリーインポート</string>
|
||||
<string name="import_old_galleries_folder_not_readable">フォルダを読めません</string>
|
||||
<string name="import_old_galleries_notification">旧ギャラリーインポート中…</string>
|
||||
<string name="import_old_galleries_notification_done">インポート完了</string>
|
||||
<string name="main_fab_random">ランダムギャラリーを開く</string>
|
||||
<string name="settings_lock_fingerprint_without_lock">予備のロックが設定されていないと指紋ロックは使用できません</string>
|
||||
<string name="settings_lock_fingerprint_prompt">Pupil指紋ロック™</string>
|
||||
<string name="settings_lock_fingerprint_prompt_subtitle">こうかはばつぐんだ!</string>
|
||||
<string name="default_query_dialog_filter_loli">登場人物を全て18歳以上にする</string>
|
||||
<string name="settings_user_id">ユーザーID</string>
|
||||
<string name="copied_to_clipboard">クリップボードにコピーしました</string>
|
||||
<string name="reader_fab_retry">リトライ</string>
|
||||
<string name="reader_fab_auto">まばたき検知スクロール</string>
|
||||
<string name="search_all">全てのギャラリーを対象に検索</string>
|
||||
<string name="settings_rtl">綴じ方向を左にする</string>
|
||||
<string name="settings_manage_favorites">ブックマーク管理</string>
|
||||
<string name="settings_backup_failed">エラーが発生しました</string>
|
||||
<string name="settings_backup_share">バックアップ共有</string>
|
||||
<string name="channel_downloader">ダウンローダ</string>
|
||||
<string name="channel_downloader_description">ダウンローダの状態を表示</string>
|
||||
<string name="downloader_running">ダウンローダー起動中</string>
|
||||
<string name="settings_download_folder_name">フォルダ名パターン</string>
|
||||
<string name="settings_invalid_download_folder_name">フォルダ名に使用できない文字が含まれています</string>
|
||||
<string name="settings_download_folder_name_message">%sに含まれている文字列を対応する変数に置換します\n\n%s</string>
|
||||
<string name="settings_manage_storage">ストレージ管理</string>
|
||||
<string name="settings_oss">オープンソースライセンス</string>
|
||||
<string name="search_show_tags">お気に入りのタグを見る</string>
|
||||
<string name="search_show_histories">履歴を見る</string>
|
||||
<string name="reader_fab_auto_cancel">まばたき検知を中止</string>
|
||||
<string name="camera_denied">カメラ権限が拒否されているため、まばたき検知使用できません</string>
|
||||
<string name="no_camera">この機器には前面カメラが装着されていません</string>
|
||||
<string name="error">エラー</string>
|
||||
<string name="settings_cache_limit">キャッシュサイズ制限</string>
|
||||
<string name="unlimited">制限なし</string>
|
||||
<string name="settings_tag_translation">タグ言語</string>
|
||||
<string name="settings_tag_translation_message">Githubにて翻訳に参加できます</string>
|
||||
<string name="settings_max_concurrent_download">並列ダウンロード</string>
|
||||
<string name="unaccessible_download_folder">アンドロイド11以上では外部からのアプリ内部空間接近が不可能です。ダウンロードフォルダを変更しますか?</string>
|
||||
<string name="settings_networking">ネットワーク</string>
|
||||
</resources>
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Pupil, Hitomi.la viewer for Android
|
||||
~ Copyright (C) 2020 tom5079
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources></resources>
|
||||
@@ -1,160 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="galleryblock_language">언어: %1$s</string>
|
||||
<string name="galleryblock_series">시리즈: %1$s</string>
|
||||
<string name="galleryblock_type">종류: %1$s</string>
|
||||
<string name="search_hint">검색…</string>
|
||||
<string name="settings_default_query">기본 검색어</string>
|
||||
<string name="settings_clear_cache">캐시 정리하기</string>
|
||||
<string name="settings_clear_cache_alert_message">캐시를 정리하면 이미지 로딩속도가 느려질 수 있습니다. 계속하시겠습니까?</string>
|
||||
<string name="settings_storage_usage">%s 사용중</string>
|
||||
<string name="settings_storage_usage_loading">저장공간 사용량 계산 중…</string>
|
||||
<string name="settings_galleries_per_page">한 번에 로드할 갤러리 수</string>
|
||||
<string name="settings_search_title">검색 설정</string>
|
||||
<string name="settings_title">설정</string>
|
||||
<string name="update_notification_description">업데이트 다운로드중…</string>
|
||||
<string name="update_title">업데이트가 있습니다!</string>
|
||||
<string name="warning">경고</string>
|
||||
<string name="main_no_result">결과 없음\n해결법</string>
|
||||
<string name="settings_miscellaneous_title">기타</string>
|
||||
<string name="settings_clear_history">기록 삭제</string>
|
||||
<string name="settings_clear_history_alert_message">기록을 삭제하시겠습니까?</string>
|
||||
<string name="settings_clear_history_summary">기록 %1$d개 저장됨</string>
|
||||
<string name="main_drawer_history">기록</string>
|
||||
<string name="main_drawer_home">홈</string>
|
||||
<string name="update_release_note"># 릴리즈 노트(v%1$s)\n%2$s</string>
|
||||
<string name="settings_security_mode_summary">최근 앱 목록 창에서 앱 화면을 보이지 않게 합니다</string>
|
||||
<string name="settings_security_mode_title">보안 모드 활성화</string>
|
||||
<string name="reader_go_to_page">이동</string>
|
||||
<string name="default_query_dialog_language_selector_none">미선택</string>
|
||||
<string name="default_query_dialog_filter_BL">BL물 필터</string>
|
||||
<string name="default_query_dialog_filter_guro">고어물 필터</string>
|
||||
<string name="default_query_dialog_language">"언어: "</string>
|
||||
<string name="default_query_dialog_title">기본 검색어 설정</string>
|
||||
<string name="main_drawer_group_contact_email">메일 보내기!</string>
|
||||
<string name="main_drawer_group_contact_github">Github</string>
|
||||
<string name="main_drawer_group_contact_help">도움말</string>
|
||||
<string name="main_drawer_group_contact_homepage">홈페이지</string>
|
||||
<string name="main_drawer_group_contact_title">문의</string>
|
||||
<string name="reader_fab_fullscreen">전체 화면</string>
|
||||
<string name="channel_download">다운로드</string>
|
||||
<string name="channel_download_description">다운로드 상태 알림</string>
|
||||
<string name="reader_fab_download">백그라운드 다운로드</string>
|
||||
<string name="reader_notification_text">다운로드 중…</string>
|
||||
<string name="reader_notification_complete">다운로드 완료</string>
|
||||
<string name="reader_fab_download_cancel">백그라운드 다운로드 취소</string>
|
||||
<string name="main_drawer_downloads">다운로드</string>
|
||||
<string name="main_jump_title">페이지 이동</string>
|
||||
<string name="main_jump_message">현재 페이지: %1$d\n페이지 수: %2$d</string>
|
||||
<string name="unable_to_connect">hitomi.la에 연결할 수 없습니다</string>
|
||||
<string name="main_move_to_page">%1$d 페이지로 이동</string>
|
||||
<string name="settings_clear_downloads">다운로드 삭제</string>
|
||||
<string name="settings_clear_downloads_alert_message">다운로드 된 만화를 모두 삭제합니다.\n계속하시겠습니까?</string>
|
||||
<string name="main_drawer_favorite">즐겨찾기</string>
|
||||
<string name="main_open_gallery_by_id">갤러리 번호로 열기</string>
|
||||
<string name="reader_failed_to_find_gallery">갤러리를 찾지 못했습니다</string>
|
||||
<string name="settings_storage">저장 공간</string>
|
||||
<string name="main_drawer_grouop_contact_discord">디스코드</string>
|
||||
<string name="settings_app_lock">앱 잠금</string>
|
||||
<string name="settings_app_lock_type">앱 잠금 종류</string>
|
||||
<string name="settings_app_version_title">앱 버전(업데이트 확인)</string>
|
||||
<string name="settings_lock_biometrics">생체 인식</string>
|
||||
<string name="settings_lock_confirm">잠금 확인을 위해 한번 더 입력해주세요</string>
|
||||
<string name="settings_lock_enabled">사용 중</string>
|
||||
<string name="settings_lock_fingerprint">지문</string>
|
||||
<string name="settings_lock_password">비밀번호</string>
|
||||
<string name="settings_lock_pattern">패턴</string>
|
||||
<string name="settings_lock_wrong_confirm">잠금이 일치하지 않습니다. 다시 시도하세요.</string>
|
||||
<string name="settings_lock_none">없음</string>
|
||||
<string name="settings_lock_remove_message">잠금을 해제할까요?</string>
|
||||
<string name="reader_loading">로딩중</string>
|
||||
<string name="main_menu_sort">정렬</string>
|
||||
<string name="main_menu_sort_popular">인기순</string>
|
||||
<string name="main_menu_sort_newest">시간순</string>
|
||||
<string name="ignore">무시</string>
|
||||
<string name="lock_corrupted">잠금 파일이 손상되었습니다! 앱을 재설치 해 주시기 바랍니다.</string>
|
||||
<string name="settings_dark_mode_title">다크 모드</string>
|
||||
<string name="settings_dark_mode_summary">딥 다크한 모오드</string>
|
||||
<string name="gallery_details">갤러리 정보</string>
|
||||
<string name="gallery_artists">작가</string>
|
||||
<string name="gallery_characters">캐릭터</string>
|
||||
<string name="gallery_groups">그룹</string>
|
||||
<string name="gallery_language">언어</string>
|
||||
<string name="gallery_series">시리즈</string>
|
||||
<string name="gallery_tags">태그</string>
|
||||
<string name="gallery_related">관련 갤러리</string>
|
||||
<string name="gallery_thumbnails">미리보기</string>
|
||||
<string name="settings_nomedia_title">이미지 숨기기</string>
|
||||
<string name="main_delete">삭제</string>
|
||||
<string name="main_download">다운로드</string>
|
||||
<string name="settings_backup_title">즐겨찾기 백업</string>
|
||||
<string name="settings_restore_title">즐겨찾기 복원</string>
|
||||
<string name="settings_backup_file_created">백업 파일을 생성하였습니다</string>
|
||||
<string name="settings_restore_failed">복원에 실패했습니다</string>
|
||||
<string name="settings_restore_success">%1$d개 항목을 복원했습니다</string>
|
||||
<string name="settings_download_folder">다운로드 위치</string>
|
||||
<string name="settings_download_folder_internal">내부 저장공간</string>
|
||||
<string name="settings_download_folder_removable">외부 SD카드</string>
|
||||
<string name="settings_download_folder_available">%s 사용 가능</string>
|
||||
<string name="update_download_completed">다운로드가 완료되었습니다</string>
|
||||
<string name="update_download_completed_description">여기를 클릭해서 업데이트를 진행할 수 있습니다</string>
|
||||
<string name="settings_beta">베타 채널에서 업데이트</string>
|
||||
<string name="settings_app_version_description">v%s</string>
|
||||
<string name="settings_low_quality">저해상도 이미지</string>
|
||||
<string name="settings_low_quality_summary">로드 속도와 데이터 사용량을 줄이기 위해 저해상도 이미지를 로드</string>
|
||||
<string name="settings_mirror_summary">미러 서버에서 이미지 로드</string>
|
||||
<string name="settings_mirror_title">미러 설정</string>
|
||||
<string name="settings_download_folder_custom">직접 설정</string>
|
||||
<string name="settings_download_folder_not_writable">이 폴더에 접근할 수 없습니다. 다른 폴더를 선택해주세요.</string>
|
||||
<string name="settings_proxy_title">프록시</string>
|
||||
<string name="proxy_dialog_username_hint">ID</string>
|
||||
<string name="proxy_dialog_type">프록시 타입</string>
|
||||
<string name="proxy_dialog_port_hint">포트</string>
|
||||
<string name="proxy_dialog_password_hint">비밀번호</string>
|
||||
<string name="proxy_dialog_error">잘못된 값</string>
|
||||
<string name="proxy_dialog_addr_hint">서버 주소</string>
|
||||
<string name="proxy_dialog_server">서버</string>
|
||||
<string name="main_menu_thin">간단히 보기</string>
|
||||
<string name="main_fab_cancel">다운로드 모두 취소</string>
|
||||
<string name="channel_update">업데이트</string>
|
||||
<string name="channel_update_description">업데이트 진행상황 표시</string>
|
||||
<string name="settings_import_old_galleries">이전 버전 갤러리 가져오기</string>
|
||||
<string name="import_old_galleries_folder_not_readable">폴더를 읽을 수 없습니다</string>
|
||||
<string name="import_old_galleries_notification">이전 버전 갤러리 가져오는 중…</string>
|
||||
<string name="import_old_galleries_notification_done">가져오기 완료</string>
|
||||
<string name="main_fab_random">무작위 갤러리 열기</string>
|
||||
<string name="settings_lock_fingerprint_without_lock">지문 잠금은 다른 잠금 방식이 활성화 되어 있을 때만 사용 가능합니다</string>
|
||||
<string name="settings_lock_fingerprint_prompt">Pupil 지문 인식™</string>
|
||||
<string name="settings_lock_fingerprint_prompt_subtitle">힘세고 강한 지문 인식</string>
|
||||
<string name="default_query_dialog_filter_loli">판사님 저는 페도가 아닙니다</string>
|
||||
<string name="settings_user_id">유저 ID</string>
|
||||
<string name="copied_to_clipboard">클립보드에 복사됨</string>
|
||||
<string name="reader_fab_retry">재시도</string>
|
||||
<string name="reader_fab_auto">눈 깜빡임 감지 스크롤</string>
|
||||
<string name="search_all">모든 갤러리 검색</string>
|
||||
<string name="settings_rtl">좌측으로 페이지 넘기기</string>
|
||||
<string name="settings_manage_favorites">즐겨찾기 관리</string>
|
||||
<string name="settings_backup_failed">업로드 실패</string>
|
||||
<string name="settings_backup_share">백업 공유</string>
|
||||
<string name="channel_downloader">다운로더</string>
|
||||
<string name="channel_downloader_description">다운로더 작동 여부 표시</string>
|
||||
<string name="downloader_running">다운로더 작동중…</string>
|
||||
<string name="settings_download_folder_name">폴더명 패턴</string>
|
||||
<string name="settings_invalid_download_folder_name">폴더 패턴에 사용할 수 없는 문자가 포함되어 있습니다</string>
|
||||
<string name="settings_download_folder_name_message">지원되는 변수는 %s 입니다\n\n%s</string>
|
||||
<string name="settings_manage_storage">저장소 관리</string>
|
||||
<string name="settings_oss">오픈 소스 라이선스</string>
|
||||
<string name="search_show_histories">검색 기록 보기</string>
|
||||
<string name="search_show_tags">즐겨찾기 태그 보기</string>
|
||||
<string name="reader_fab_auto_cancel">눈 깜빡임 감지 중지</string>
|
||||
<string name="camera_denied">카메라 권한이 거부되었기 때문에 눈 깜빡임 감지가 불가능합니다</string>
|
||||
<string name="no_camera">이 장치에는 전면 카메라가 없습니다</string>
|
||||
<string name="error">오류</string>
|
||||
<string name="settings_cache_limit">캐시 크기 제한</string>
|
||||
<string name="unlimited">무제한</string>
|
||||
<string name="settings_tag_translation">태그 언어</string>
|
||||
<string name="settings_tag_translation_message">Github에서 번역에 참여하세요</string>
|
||||
<string name="settings_max_concurrent_download">병렬 다운로드</string>
|
||||
<string name="unaccessible_download_folder">안드로이드 11 이상에서는 외부에서 현재 다운로드 폴더에 접근할 수 없습니다. 변경하시겠습니까?</string>
|
||||
<string name="settings_networking">네트워크</string>
|
||||
</resources>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string-array name="hitomi_sort_mode">
|
||||
<item>NEWEST</item>
|
||||
<item>POPULAR</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Pupil, Hitomi.la viewer for Android
|
||||
~ Copyright (C) 2020 tom5079
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<declare-styleable name="TagChipGroup">
|
||||
<attr name="maxTag" format="integer"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="RippleCircleStatus">
|
||||
<attr name="half" format="enum">
|
||||
<enum name="top" value="1"/>
|
||||
<enum name="bottom" value="-1"/>
|
||||
</attr>
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#4fc3f7</color>
|
||||
<color name="colorPrimaryDark">#0093c4</color>
|
||||
<color name="colorAccent">#D81B60</color>
|
||||
|
||||
<color name="material_orange_500">#ff9800</color>
|
||||
</resources>
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
</resources>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<item name="notification_id_update" type="id" />
|
||||
|
||||
</resources>
|
||||
@@ -1,252 +0,0 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="app_name" translatable="false" tools:override="true">Pupil-Beta</string>
|
||||
|
||||
<string name="release_url" translatable="false">https://api.github.com/repos/tom5079/Pupil/releases</string>
|
||||
|
||||
<string name="home_page" translatable="false">http://bit.ly/2EZDClw</string>
|
||||
<string name="help" translatable="false">http://bit.ly/2Z7lNZE</string>
|
||||
<string name="github" translatable="false">https://github.com/tom5079/Pupil/</string>
|
||||
<string name="email" translatable="false">mailto:pupil.hentai@gmail.com</string>
|
||||
<string name="discord" translatable="false">https://discord.gg/Stj4b5v</string>
|
||||
|
||||
<!-- Korean only -->
|
||||
<string name="https_text" translatable="false">해결법</string>
|
||||
<string name="https" translatable="false">https://bit.ly/34dUBwy</string>
|
||||
|
||||
<string name="backup_url" translatable="false">http://ix.io/</string>
|
||||
|
||||
<string name="main_settings" translatable="false">Settings</string>
|
||||
<string name="galleryblock_thumbnail_description" translatable="false">Thumbnail</string>
|
||||
|
||||
<string name="reader_imageview_description" translatable="false">Content ImageView</string>
|
||||
<string name="page_indicator_placeholder" translatable="false">-/-</string>
|
||||
|
||||
<string name="galleryblock_artist_with_group" translatable="false">%s (%s)</string>
|
||||
|
||||
<!-- Translate needed down here -->
|
||||
|
||||
<string name="warning">Warning</string>
|
||||
<string name="error">Error</string>
|
||||
|
||||
<string name="ignore">Ignore</string>
|
||||
|
||||
<string name="unlimited">Unlimited</string>
|
||||
|
||||
<string name="copied_to_clipboard">Copied to clipboard</string>
|
||||
|
||||
<string name="channel_download">Download</string>
|
||||
<string name="channel_download_description">Shows download status</string>
|
||||
|
||||
<string name="channel_downloader">Downloader</string>
|
||||
<string name="channel_downloader_description">Shows downloader status</string>
|
||||
|
||||
<string name="channel_update">Update</string>
|
||||
<string name="channel_update_description">Shows update progress</string>
|
||||
|
||||
<string name="unable_to_connect">Unable to connect to hitomi.la</string>
|
||||
|
||||
<string name="lock_corrupted">Lock file corrupted! Please re-install Pupil</string>
|
||||
|
||||
<string name="main_no_result">No result</string>
|
||||
|
||||
<string name="unaccessible_download_folder">From Android 11 and above, current Download folder cannot be accessed by outside apps. Would you like to change the download folder?</string>
|
||||
|
||||
<string name="main_drawer_home">Home</string>
|
||||
<string name="main_drawer_history">History</string>
|
||||
<string name="main_drawer_downloads">Downloads</string>
|
||||
<string name="main_drawer_favorite">Favorites</string>
|
||||
<string name="main_drawer_group_contact_title">Contact</string>
|
||||
<string name="main_drawer_group_contact_help">Help</string>
|
||||
<string name="main_drawer_group_contact_homepage">Visit homepage</string>
|
||||
<string name="main_drawer_group_contact_github">Visit github</string>
|
||||
<string name="main_drawer_group_contact_email">Email me!</string>
|
||||
<string name="main_drawer_grouop_contact_discord">Discord</string>
|
||||
|
||||
<string name="main_menu_thin">Thin Mode</string>
|
||||
|
||||
<string name="main_menu_sort">Sort</string>
|
||||
<string name="main_menu_sort_newest">Newest</string>
|
||||
<string name="main_menu_sort_popular">Popular</string>
|
||||
|
||||
<string name="main_jump_title">Jump to page</string>
|
||||
<string name="main_jump_message">Current page: %1$d\nMaximum page: %2$d</string>
|
||||
<string name="main_open_gallery_by_id">Open Gallery by ID</string>
|
||||
<string name="reader_failed_to_find_gallery">Failed to open gallery</string>
|
||||
<string name="main_fab_random">Open a random gallery</string>
|
||||
<string name="main_fab_cancel">Cancel all downloads</string>
|
||||
|
||||
<string name="main_move_to_page">Move to page %1$d</string>
|
||||
|
||||
<string name="main_download">DOWNLOAD</string>
|
||||
<string name="main_delete">DELETE</string>
|
||||
|
||||
<string name="update_title">Update available</string>
|
||||
<string name="update_download_completed">Download Completed</string>
|
||||
<string name="update_download_completed_description">Click here to update</string>
|
||||
<string name="update_notification_description">Downloading update…</string>
|
||||
<string name="update_release_note"># Release Note(v%1$s)\n%2$s</string>
|
||||
|
||||
<string name="search_hint">Search…</string>
|
||||
<string name="search_all">Search all galleries</string>
|
||||
<string name="search_show_histories">Show histories</string>
|
||||
<string name="search_show_tags">Show favorite tags</string>
|
||||
|
||||
<string name="gallery_details">Details</string>
|
||||
<string name="gallery_thumbnails">Thumbnails</string>
|
||||
<string name="gallery_related">Related Galleries</string>
|
||||
<string name="gallery_artists">Artists</string>
|
||||
<string name="gallery_groups">Groups</string>
|
||||
<string name="gallery_language">Language</string>
|
||||
<string name="gallery_series">Series</string>
|
||||
<string name="gallery_characters">Characters</string>
|
||||
<string name="gallery_tags">Tags</string>
|
||||
|
||||
<string name="galleryblock_series">Series: %1$s</string>
|
||||
<string name="galleryblock_type">Type: %1$s</string>
|
||||
<string name="galleryblock_language">Language: %1$s</string>
|
||||
<string name="galleryblock_pagecount" translatable="false">%dP</string>
|
||||
|
||||
<!-- READER -->
|
||||
|
||||
<string name="reader_loading">Loading</string>
|
||||
<string name="reader_go_to_page">Go to page</string>
|
||||
<string name="reader_fab_fullscreen">Fullscreen</string>>
|
||||
<string name="reader_fab_retry">Retry</string>
|
||||
<string name="reader_fab_auto">Scroll with eye blink</string>
|
||||
<string name="reader_fab_auto_cancel">Stop scroll with eye blink</string>
|
||||
<string name="reader_fab_download">Background download</string>
|
||||
<string name="reader_fab_download_cancel">Cancel background download</string>
|
||||
<string name="reader_notification_text">Downloading…</string>
|
||||
<string name="reader_notification_complete">Download complete</string>
|
||||
|
||||
<string name="camera_denied">Eye blink detection cannot be used without a permission</string>
|
||||
<string name="no_camera">There is no front facing camera in this device</string>
|
||||
|
||||
<!-- DOWNLOADER -->
|
||||
<string name="downloader_running">Downloader running…</string>
|
||||
|
||||
<!-- SETTINGS -->
|
||||
|
||||
<string name="settings_title">Settings</string>
|
||||
|
||||
<string name="settings_app_version_title">App version(Click to check update)</string>
|
||||
<string name="settings_app_version_description">v%s</string>
|
||||
<string name="settings_beta">Update from beta channel</string>
|
||||
|
||||
<!-- SEARCH -->
|
||||
|
||||
<string name="settings_search_title">Search Settings</string>
|
||||
<string name="settings_galleries_per_page">Galleries per page</string>
|
||||
<string name="settings_default_query">Default query</string>
|
||||
|
||||
<!-- SETTINGS/STORAGE -->
|
||||
|
||||
<string name="settings_storage">Storage</string>
|
||||
|
||||
<!-- SETTINGS/STORAGE / MANAGE STORAGE -->
|
||||
|
||||
<string name="settings_manage_storage">Manage Storage</string>
|
||||
<string name="settings_storage_usage">Currently using %s</string>
|
||||
<string name="settings_storage_usage_loading">Calculating storage usage…</string>
|
||||
<string name="settings_clear_cache">Clear cache</string>
|
||||
<string name="settings_clear_cache_alert_message">Deleting cache can affect image loading speed. Do you want to continue?</string>
|
||||
<string name="settings_clear_downloads">Clear downloads</string>
|
||||
<string name="settings_clear_downloads_alert_message">Delete all downloaded galleries.\nDo you want to continue?</string>
|
||||
<string name="settings_clear_history">Clear history</string>
|
||||
<string name="settings_clear_history_alert_message">Do you want to clear histories?</string>
|
||||
<string name="settings_clear_history_summary">%1$d histories saved</string>
|
||||
|
||||
<!-- SETTINGS/STORAGE / MISCELLANEOUS -->
|
||||
|
||||
<string name="settings_download_folder_name">Folder naming pattern</string>
|
||||
<string name="settings_invalid_download_folder_name">Folder naming pattern is containing invalid characters</string>
|
||||
<string name="settings_download_folder_name_message">%s will be replaced to its corresponding value\n\n%s</string>
|
||||
<string name="settings_download_folder">Download folder</string>
|
||||
<string name="settings_download_folder_removable">Removable Storage</string>
|
||||
<string name="settings_download_folder_internal">Internal Storage</string>
|
||||
<string name="settings_download_folder_available">%s available</string>
|
||||
<string name="settings_download_folder_custom">Custom Location</string>
|
||||
<string name="settings_download_folder_not_writable">This folder is not writable. Please select another folder.</string>
|
||||
<string name="settings_cache_limit">Cache Limit</string>
|
||||
<string name="settings_nomedia_title">Hide image from gallery</string>
|
||||
<string name="settings_low_quality">Low quality images</string>
|
||||
<string name="settings_low_quality_summary">Load low quality images to improve load speed and data usage</string>
|
||||
|
||||
<!-- SETTINGS/APP LOCK -->
|
||||
|
||||
<string name="settings_app_lock">App lock</string>
|
||||
<string name="settings_app_lock_type">App lock type</string>
|
||||
|
||||
<!-- SETTINGS/NETWORKING -->
|
||||
<string name="settings_networking">Networking</string>
|
||||
<string name="settings_mirror_summary">Load images from mirrors</string>
|
||||
<string name="settings_proxy_title">Proxy</string>
|
||||
<string name="settings_max_concurrent_download">Concurrent Download</string>
|
||||
|
||||
<!-- SETTINGS/MISCELLANEOUS -->
|
||||
|
||||
<string name="settings_miscellaneous_title">Miscellaneous</string>
|
||||
<string name="settings_tag_translation">Tag Language</string>
|
||||
<string name="settings_tag_translation_message">Participate in translation on Github</string>
|
||||
<string name="settings_rtl">Turn pages Right-to-Left</string>
|
||||
<string name="settings_security_mode_title">Enable security mode</string>
|
||||
<string name="settings_security_mode_summary">Enable security mode to make the screen invisible on recent app window</string>
|
||||
<string name="settings_dark_mode_title">Dark mode</string>
|
||||
<string name="settings_dark_mode_summary">Protect yourself against light attacks!</string>
|
||||
<string name="settings_import_old_galleries">Import old galleries</string>
|
||||
<string name="settings_user_id">User ID</string>
|
||||
<string name="settings_oss">Open Source Notice</string>
|
||||
|
||||
<!-- MANAGE FAVORITES -->
|
||||
|
||||
<string name="settings_manage_favorites">Manage favorites</string>
|
||||
<string name="settings_backup_title">Backup favorites</string>
|
||||
<string name="settings_backup_failed">Upload Failed</string>
|
||||
<string name="settings_backup_share">Share Backup</string>
|
||||
<string name="settings_backup_file_created">Backup file created</string>
|
||||
<string name="settings_restore_title">Restore favorites</string>
|
||||
<string name="settings_restore_failed">Restore failed</string>
|
||||
<string name="settings_restore_success">%1$d entries restored</string>
|
||||
|
||||
<!-- SETTINGS/APP LOCK ACTIVITY -->
|
||||
|
||||
<string name="settings_lock_none">None</string>
|
||||
<string name="settings_lock_pattern">Pattern</string>
|
||||
<string name="settings_lock_pin" translatable="false">PIN</string>
|
||||
<string name="settings_lock_password">Password</string>
|
||||
<string name="settings_lock_biometrics">Biometrics</string>
|
||||
<string name="settings_lock_fingerprint">Fingerprint</string>
|
||||
<string name="settings_lock_fingerprint_without_lock">Fingerprint can be only enabled if one of the other locks are enabled</string>
|
||||
<string name="settings_lock_fingerprint_prompt">Pupil Fingerprint Lock™</string>
|
||||
<string name="settings_lock_enabled">Enabled</string>
|
||||
<string name="settings_lock_confirm">Input same lock once more to confirm Lock</string>
|
||||
<string name="settings_lock_remove_message">Do you want to remove lock?</string>
|
||||
<string name="settings_lock_wrong_confirm">Lock is different from last one. Please try again.</string>
|
||||
|
||||
<!-- SETTINGS/DEFAULT QUERY DIALOG -->
|
||||
|
||||
<string name="default_query_dialog_title">Set default query</string>
|
||||
<string name="default_query_dialog_language">Language: </string>
|
||||
<string name="default_query_dialog_filter_BL">Filter BL</string>
|
||||
<string name="default_query_dialog_filter_guro">Filter Guro</string>
|
||||
<string name="default_query_dialog_filter_loli">I\'m not a pedophile</string>
|
||||
<string name="default_query_dialog_language_selector_none">Any</string>
|
||||
<string name="settings_mirror_title">Mirrors</string>
|
||||
|
||||
<!-- PROXY DIALOG -->
|
||||
<string name="proxy_dialog_type">type</string>
|
||||
<string name="proxy_dialog_addr_hint">address</string>
|
||||
<string name="proxy_dialog_port_hint">port</string>
|
||||
<string name="proxy_dialog_username_hint">username</string>
|
||||
<string name="proxy_dialog_password_hint">password</string>
|
||||
<string name="proxy_dialog_error">Wrong value</string>
|
||||
<string name="proxy_dialog_server">server</string>
|
||||
|
||||
<!-- IMPORT OLD GALLERIES -->
|
||||
<string name="import_old_galleries_folder_not_readable">This folder is not readable</string>
|
||||
<string name="import_old_galleries_notification">Importing old galleries…</string>
|
||||
<string name="import_old_galleries_notification_text" translatable="false">%1$d/%2$d</string>
|
||||
<string name="import_old_galleries_notification_done">Importing completed</string>
|
||||
<string name="settings_lock_fingerprint_prompt_subtitle">Ah Shit, Here we go again</string>
|
||||
|
||||
</resources>
|
||||
@@ -1,18 +0,0 @@
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="NoActionBarAppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Pupil, Hitomi.la viewer for Android
|
||||
~ Copyright (C) 2019 tom5079
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<paths>
|
||||
<cache-path name="cached_image" path="networkcache/" />
|
||||
<cache-path name="apks" path="apks/" />
|
||||
</paths>
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Pupil, Hitomi.la viewer for Android
|
||||
~ Copyright (C) 2020 tom5079
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<network-security-config>
|
||||
<domain-config cleartextTrafficPermitted="true">
|
||||
<domain includeSubdomains="false">ix.io</domain>
|
||||
</domain-config>
|
||||
|
||||
</network-security-config>
|
||||
@@ -1,113 +0,0 @@
|
||||
/*
|
||||
* Pupil, Hitomi.la viewer for Android
|
||||
* Copyright (C) 2022 tom5079
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package xyz.quaver.pupil
|
||||
|
||||
import io.ktor.client.engine.mock.*
|
||||
import io.ktor.http.*
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.flow.collect
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import kotlinx.serialization.encodeToString
|
||||
import kotlinx.serialization.json.Json
|
||||
import org.junit.Assert.assertArrayEquals
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import xyz.quaver.pupil.util.PupilHttpClient
|
||||
import xyz.quaver.pupil.util.RemoteSourceInfo
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import kotlin.random.Random
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class PupilHttpClientTest {
|
||||
|
||||
val tempFile = File.createTempFile("pupilhttpclienttest", ".apk").also {
|
||||
it.deleteOnExit()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getRemoteSourceList() = runTest {
|
||||
val expected = buildMap {
|
||||
put("hitomi.la", RemoteSourceInfo("hitomi", "hitomi.la", "0.0.1"))
|
||||
}
|
||||
|
||||
val mockEngine = MockEngine { _ ->
|
||||
respond(Json.encodeToString(expected), headers = headersOf(HttpHeaders.ContentType, ContentType.Application.Json.contentType))
|
||||
}
|
||||
|
||||
val client = PupilHttpClient(mockEngine)
|
||||
|
||||
assertEquals(expected, client.getRemoteSourceList())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun downloadApk() = runTest {
|
||||
val expected = Random.Default.nextBytes(1000000) // 1MB
|
||||
|
||||
val mockEngine = MockEngine { _ ->
|
||||
respond(expected, headers = headersOf(HttpHeaders.ContentType, "application/vnd.android.package-archive"))
|
||||
}
|
||||
|
||||
val client = PupilHttpClient(mockEngine)
|
||||
|
||||
client.downloadFile("http://a/", tempFile).collect()
|
||||
|
||||
assertArrayEquals(expected, tempFile.readBytes())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun latestRelease() = runTest {
|
||||
val expectedVersion = "5.3.7"
|
||||
val expectedApkUrl = "https://github.com/tom5079/Pupil/releases/download/5.3.7/Pupil-v5.3.7.apk"
|
||||
val expectedReleaseNotes = mapOf(
|
||||
Locale.KOREAN to """
|
||||
* 가끔씩 무한로딩 걸리는 현상 수정
|
||||
* 백업시 즐겨찾기 태그도 백업되게 수정
|
||||
* 이전 안드로이드에서 앱이 튕기는 오류 수정
|
||||
""".trimIndent(),
|
||||
Locale.JAPANESE to """
|
||||
* 稀に接続不可になるバグを修正
|
||||
* お気に入りタグを含むようバックアップ機能を修正
|
||||
* 旧バージョンのアンドロイドでアプリがクラッシュするバグを解決
|
||||
""".trimIndent(),
|
||||
Locale.ENGLISH to """
|
||||
* Fixed occasional outage
|
||||
* Updated backup/restore feature to include favorite tags
|
||||
* Fixed app crashing on older Androids
|
||||
""".trimIndent()
|
||||
)
|
||||
|
||||
val mockEngine = MockEngine { _ ->
|
||||
val response = javaClass.getResource("/releases.json")!!.readText()
|
||||
respond(response)
|
||||
}
|
||||
|
||||
val client = PupilHttpClient(mockEngine)
|
||||
|
||||
val release = client.latestRelease()!!
|
||||
|
||||
assertEquals(expectedVersion, release.version)
|
||||
assertEquals(expectedApkUrl, release.apkUrl)
|
||||
|
||||
println(expectedReleaseNotes)
|
||||
println(release.releaseNotes)
|
||||
assertEquals(expectedReleaseNotes, release.releaseNotes)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
---
|
||||
|
||||
/* for image caption */
|
||||
img + br + em {
|
||||
font-style: normal;
|
||||
display: inherit;
|
||||
text-align: center;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
.center {
|
||||
display: block;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.wrap > * {
|
||||
margin: 0 1rem;
|
||||
}
|
||||
|
||||
.fab, .fas {
|
||||
font-size: 32px;
|
||||
color: white;
|
||||
}
|
||||
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 917 KiB |
|
After Width: | Height: | Size: 357 KiB |
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 127 KiB |
|
After Width: | Height: | Size: 332 KiB |
|
After Width: | Height: | Size: 365 KiB |
|
After Width: | Height: | Size: 681 KiB |
|
After Width: | Height: | Size: 3.8 MiB |
|
After Width: | Height: | Size: 526 KiB |
|
After Width: | Height: | Size: 812 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 202 KiB |
|
After Width: | Height: | Size: 218 KiB |
|
After Width: | Height: | Size: 141 KiB |
|
After Width: | Height: | Size: 14 MiB |
|
After Width: | Height: | Size: 583 KiB |
|
After Width: | Height: | Size: 564 KiB |
|
After Width: | Height: | Size: 821 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 132 KiB |
@@ -0,0 +1,170 @@
|
||||
"use strict";
|
||||
|
||||
var loading_timer;
|
||||
var domain = (/^dev\./.test(document.location.hostname.toString()) ? 'dev' : 'ltn')+'.hitomi.la';
|
||||
var galleryblockextension = '.html';
|
||||
var galleryblockdir = 'galleryblock';
|
||||
var nozomiextension = '.nozomi';
|
||||
|
||||
function subdomain_from_url(url, base) {
|
||||
var retval = 'b';
|
||||
if (base) {
|
||||
retval = base;
|
||||
}
|
||||
|
||||
var b = 16;
|
||||
|
||||
var r = /\/[0-9a-f]{61}([0-9a-f]{2})([0-9a-f])/;
|
||||
var m = r.exec(url);
|
||||
if (!m) {
|
||||
return 'a';
|
||||
}
|
||||
|
||||
var g = parseInt(m[2]+m[1], b);
|
||||
if (!isNaN(g)) {
|
||||
retval = String.fromCharCode(97 + gg.m(g)) + retval;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
function url_from_url(url, base) {
|
||||
return url.replace(/\/\/..?\.hitomi\.la\//, '//'+subdomain_from_url(url, base)+'.hitomi.la/');
|
||||
}
|
||||
|
||||
|
||||
function full_path_from_hash(hash) {
|
||||
return gg.b+gg.s(hash)+'/'+hash;
|
||||
}
|
||||
|
||||
function real_full_path_from_hash(hash) {
|
||||
return hash.replace(/^.*(..)(.)$/, '$2/$1/'+hash);
|
||||
}
|
||||
|
||||
|
||||
function url_from_hash(galleryid, image, dir, ext) {
|
||||
ext = ext || dir || image.name.split('.').pop();
|
||||
dir = dir || 'images';
|
||||
|
||||
return 'https://a.hitomi.la/'+dir+'/'+full_path_from_hash(image.hash)+'.'+ext;
|
||||
}
|
||||
|
||||
function url_from_url_from_hash(galleryid, image, dir, ext, base) {
|
||||
if ('tn' === base) {
|
||||
return url_from_url('https://a.hitomi.la/'+dir+'/'+real_full_path_from_hash(image.hash)+'.'+ext, base);
|
||||
}
|
||||
return url_from_url(url_from_hash(galleryid, image, dir, ext), base);
|
||||
}
|
||||
|
||||
function rewrite_tn_paths(html) {
|
||||
return html.replace(/\/\/tn\.hitomi\.la\/[^\/]+\/[0-9a-f]\/[0-9a-f]{2}\/[0-9a-f]{64}/g, function(url) {
|
||||
return url_from_url(url, 'tn');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function show_loading() {
|
||||
return vate_loading(true);
|
||||
}
|
||||
|
||||
function hide_loading() {
|
||||
stop_loading_timer();
|
||||
return vate_loading(false);
|
||||
}
|
||||
|
||||
function vate_loading(bool) {
|
||||
var el = $('#loader-content');
|
||||
if (!el) return;
|
||||
|
||||
if (bool) {
|
||||
el.show();
|
||||
} else {
|
||||
el.hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function start_loading_timer() {
|
||||
hide_loading();
|
||||
loading_timer = setTimeout(show_loading, 500);
|
||||
}
|
||||
|
||||
function stop_loading_timer() {
|
||||
clearTimeout(loading_timer);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function scroll_to_top() {
|
||||
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
||||
}
|
||||
|
||||
|
||||
function localDates() {
|
||||
$(".date").each(function() {
|
||||
//2007-02-06 20:02:00-06
|
||||
//2016-03-27 13:37:33.612-05
|
||||
var r = /(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(?:\.\d+)?([+-]\d{2})/;
|
||||
var m = r.exec($(this).html());
|
||||
if (!m) {
|
||||
return;
|
||||
}
|
||||
|
||||
//2007-02-06T20:02:00-06:00
|
||||
$(this).html(new Date(m[1]+'-'+m[2]+'-'+m[3]+'T'+m[4]+':'+m[5]+':'+m[6]+m[7]+':00').toLocaleString(undefined, { year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' })); //Feb 6, 2007, 8:02 PM
|
||||
});
|
||||
}
|
||||
|
||||
//https://stackoverflow.com/a/51332115/272601
|
||||
function retry(fn, retries, err) {
|
||||
retries = typeof retries !== 'undefined' ? retries : 3;
|
||||
err = typeof err !== 'undefined' ? err : null;
|
||||
|
||||
if (!retries) {
|
||||
return Promise.reject(err);
|
||||
}
|
||||
return fn().catch(function(err) {
|
||||
//console.warn(`retry ${3 - retries}, err ${err}`);
|
||||
return retry(fn, (retries - 1), err);
|
||||
});
|
||||
}
|
||||
|
||||
function flip_lazy_images() {
|
||||
const sources = document.querySelectorAll('source.picturelazyload');
|
||||
sources.forEach(function(lazyEl) {
|
||||
lazyEl.setAttribute("srcset", lazyEl.getAttribute("data-srcset"));
|
||||
});
|
||||
|
||||
const imgs = document.querySelectorAll('img.lazyload');
|
||||
imgs.forEach(function(lazyEl) {
|
||||
lazyEl.setAttribute("src", lazyEl.getAttribute("data-src"));
|
||||
//lazyEl.setAttribute("srcset", lazyEl.getAttribute("data-srcset")); //can't do this because the webp shim can't handle it
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#lang").mouseenter(function() {
|
||||
$("#lang-drop").addClass("active");
|
||||
});
|
||||
$("#lang").mouseleave(function() {
|
||||
$("#lang-drop").removeClass("active");
|
||||
});
|
||||
$("#lang").click(function() {
|
||||
$("#lang-drop").toggleClass("active");
|
||||
});
|
||||
$(".drop-button").click(function() {
|
||||
$("nav").toggleClass("active");
|
||||
});
|
||||
localDates();
|
||||
});
|
||||
|
||||
if (typeof Cookies !== 'undefined' && Cookies && Cookies.get('observe_cls')) {
|
||||
let cls = 0;
|
||||
const po = new PerformanceObserver((list) => {
|
||||
for (const entry of list.getEntries()) {
|
||||
cls += entry.value;
|
||||
console.log(entry, 'total is now: '+cls);
|
||||
}
|
||||
});
|
||||
po.observe({type: 'layout-shift', buffered: true});
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
"use strict";
|
||||
|
||||
var loading_timer;
|
||||
var domain = (/^dev\./.test(document.location.hostname.toString()) ? 'dev' : 'ltn')+'.hitomi.la';
|
||||
var galleryblockextension = '.html';
|
||||
var galleryblockdir = 'galleryblock';
|
||||
var nozomiextension = '.nozomi';
|
||||
|
||||
function subdomain_from_url(url, base) {
|
||||
var retval = 'b';
|
||||
if (base) {
|
||||
retval = base;
|
||||
}
|
||||
|
||||
var b = 16;
|
||||
|
||||
var r = /\/[0-9a-f]{61}([0-9a-f]{2})([0-9a-f])/;
|
||||
var m = r.exec(url);
|
||||
if (!m) {
|
||||
return 'a';
|
||||
}
|
||||
|
||||
var g = parseInt(m[2]+m[1], b);
|
||||
if (!isNaN(g)) {
|
||||
retval = String.fromCharCode(97 + gg.m(g)) + retval;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
function url_from_url(url, base) {
|
||||
return url.replace(/\/\/..?\.hitomi\.la\//, '//'+subdomain_from_url(url, base)+'.hitomi.la/');
|
||||
}
|
||||
|
||||
|
||||
function full_path_from_hash(hash) {
|
||||
return gg.b+gg.s(hash)+'/'+hash;
|
||||
}
|
||||
|
||||
function real_full_path_from_hash(hash) {
|
||||
return hash.replace(/^.*(..)(.)$/, '$2/$1/'+hash);
|
||||
}
|
||||
|
||||
|
||||
function url_from_hash(galleryid, image, dir, ext) {
|
||||
ext = ext || dir || image.name.split('.').pop();
|
||||
dir = dir || 'images';
|
||||
|
||||
return 'https://a.hitomi.la/'+dir+'/'+full_path_from_hash(image.hash)+'.'+ext;
|
||||
}
|
||||
|
||||
function url_from_url_from_hash(galleryid, image, dir, ext, base) {
|
||||
if ('tn' === base) {
|
||||
return url_from_url('https://a.hitomi.la/'+dir+'/'+real_full_path_from_hash(image.hash)+'.'+ext, base);
|
||||
}
|
||||
return url_from_url(url_from_hash(galleryid, image, dir, ext), base);
|
||||
}
|
||||
|
||||
function rewrite_tn_paths(html) {
|
||||
return html.replace(/\/\/tn\.hitomi\.la\/[^\/]+\/[0-9a-f]\/[0-9a-f]{2}\/[0-9a-f]{64}/g, function(url) {
|
||||
return url_from_url(url, 'tn');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function show_loading() {
|
||||
return vate_loading(true);
|
||||
}
|
||||
|
||||
function hide_loading() {
|
||||
stop_loading_timer();
|
||||
return vate_loading(false);
|
||||
}
|
||||
|
||||
function vate_loading(bool) {
|
||||
var el = $('#loader-content');
|
||||
if (!el) return;
|
||||
|
||||
if (bool) {
|
||||
el.show();
|
||||
} else {
|
||||
el.hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function start_loading_timer() {
|
||||
hide_loading();
|
||||
loading_timer = setTimeout(show_loading, 500);
|
||||
}
|
||||
|
||||
function stop_loading_timer() {
|
||||
clearTimeout(loading_timer);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function scroll_to_top() {
|
||||
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
||||
}
|
||||
|
||||
|
||||
function localDates() {
|
||||
$(".date").each(function() {
|
||||
//2007-02-06 20:02:00-06
|
||||
//2016-03-27 13:37:33.612-05
|
||||
var r = /(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(?:\.\d+)?([+-]\d{2})/;
|
||||
var m = r.exec($(this).html());
|
||||
if (!m) {
|
||||
return;
|
||||
}
|
||||
|
||||
//2007-02-06T20:02:00-06:00
|
||||
$(this).html(new Date(m[1]+'-'+m[2]+'-'+m[3]+'T'+m[4]+':'+m[5]+':'+m[6]+m[7]+':00').toLocaleString(undefined, { year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' })); //Feb 6, 2007, 8:02 PM
|
||||
});
|
||||
}
|
||||
|
||||
//https://stackoverflow.com/a/51332115/272601
|
||||
function retry(fn, retries, err) {
|
||||
retries = typeof retries !== 'undefined' ? retries : 3;
|
||||
err = typeof err !== 'undefined' ? err : null;
|
||||
|
||||
if (!retries) {
|
||||
return Promise.reject(err);
|
||||
}
|
||||
return fn().catch(function(err) {
|
||||
//console.warn(`retry ${3 - retries}, err ${err}`);
|
||||
return retry(fn, (retries - 1), err);
|
||||
});
|
||||
}
|
||||
|
||||
function flip_lazy_images() {
|
||||
const sources = document.querySelectorAll('source.picturelazyload');
|
||||
sources.forEach(function(lazyEl) {
|
||||
lazyEl.setAttribute("srcset", lazyEl.getAttribute("data-srcset"));
|
||||
});
|
||||
|
||||
const imgs = document.querySelectorAll('img.lazyload');
|
||||
imgs.forEach(function(lazyEl) {
|
||||
lazyEl.setAttribute("src", lazyEl.getAttribute("data-src"));
|
||||
//lazyEl.setAttribute("srcset", lazyEl.getAttribute("data-srcset")); //can't do this because the webp shim can't handle it
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#lang").mouseenter(function() {
|
||||
$("#lang-drop").addClass("active");
|
||||
});
|
||||
$("#lang").mouseleave(function() {
|
||||
$("#lang-drop").removeClass("active");
|
||||
});
|
||||
$("#lang").click(function() {
|
||||
$("#lang-drop").toggleClass("active");
|
||||
});
|
||||
$(".drop-button").click(function() {
|
||||
$("nav").toggleClass("active");
|
||||
});
|
||||
localDates();
|
||||
});
|
||||
|
||||
if (typeof Cookies !== 'undefined' && Cookies && Cookies.get('observe_cls')) {
|
||||
let cls = 0;
|
||||
const po = new PerformanceObserver((list) => {
|
||||
for (const entry of list.getEntries()) {
|
||||
cls += entry.value;
|
||||
console.log(entry, 'total is now: '+cls);
|
||||
}
|
||||
});
|
||||
po.observe({type: 'layout-shift', buffered: true});
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
async function get_gallery_url(galleryid) {
|
||||
const url = `https://hitomi.la/galleries/${galleryid}.html`;
|
||||
|
||||
const response = await fetch(url);
|
||||
const html = await response.text();
|
||||
|
||||
const doc = new DOMParser().parseFromString(html, 'text/html');
|
||||
|
||||
return doc.querySelector('link').getAttribute('href');
|
||||
}
|
||||
|
||||
async function get_gallery(galleryid) {
|
||||
const url = await get_gallery_url(galleryid);
|
||||
|
||||
const response = await fetch(url);
|
||||
const html = await response.text();
|
||||
|
||||
const doc = new DOMParser().parseFromString(rewrite_tn_paths(html), 'text/html');
|
||||
|
||||
//related
|
||||
eval(Array.from(doc.getElementsByTagName('script')).find(elm => elm.innerHTML.includes('var related')).innerHTML);
|
||||
|
||||
const lang_list = {};
|
||||
|
||||
Array.from(doc.querySelectorAll('#lang-list a')).forEach(elm => lang_list[elm.innerText] = elm.getAttribute('href').slice(11, -5));
|
||||
|
||||
const cover = replace_jpg_tn(doc.querySelector('.cover img').src);
|
||||
|
||||
const title = doc.querySelector('.gallery h1 a').innerText;
|
||||
const artists = Array.from(doc.querySelectorAll('.gallery h2 a'), elm => elm.innerText);
|
||||
const groups = Array.from(doc.querySelectorAll('.gallery-info a[href^="/group."]'), elm => elm.innerText);
|
||||
const type = doc.querySelector('.gallery-info a[href^="/type/"]').innerText.trim();
|
||||
|
||||
const language = doc.querySelector('.gallery-info a[href^="/index"][href$=".html"]').getAttribute('href').slice(7, -5);
|
||||
|
||||
const series = Array.from(doc.querySelectorAll('.gallery-info a[href^="/series/"]'), elm => elm.innerText);
|
||||
const characters = Array.from(doc.querySelectorAll('.gallery-info a[href^="/character/"]'), elm => elm.innerText);
|
||||
|
||||
const tags = Array.from(doc.querySelectorAll('.gallery-info a[href^="/tag/"]'), elm => decodeURIComponent(elm.getAttribute('href')).slice(5, -9));
|
||||
|
||||
const gallery_info = await get_gallery_info(galleryid);
|
||||
const thumbnails = gallery_info.files.map(file => url_from_url_from_hash(galleryid, file, 'webpsmallsmalltn', 'webp', 'tn'));
|
||||
|
||||
return {
|
||||
related: related,
|
||||
langList: lang_list,
|
||||
cover: cover,
|
||||
title: title,
|
||||
artists: artists,
|
||||
groups: groups,
|
||||
type: type,
|
||||
language: language,
|
||||
series: series,
|
||||
characters: characters,
|
||||
tags: tags,
|
||||
thumbnails: thumbnails
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
async function get_gallery_block(galleryid) {
|
||||
const uri = `//${domain}/${galleryblockdir}/${galleryid}${galleryblockextension}`;
|
||||
|
||||
const response = await fetch(uri);
|
||||
const html = await response.text();
|
||||
|
||||
const doc = new DOMParser().parseFromString(rewrite_tn_paths(html), 'text/html');
|
||||
|
||||
const title_elm = doc.querySelector('h1 > a');
|
||||
|
||||
const gallery_url = title_elm.href;
|
||||
const title = title_elm.textContent;
|
||||
|
||||
const thumbnails = Array.from(doc.querySelectorAll('.dj-img-cont img'), elm => replace_jpg_tn(elm.getAttribute('data-src')));
|
||||
|
||||
const artists = Array.from(doc.querySelectorAll('.artist-list a'), elm => elm.innerText);
|
||||
const series = Array.from(doc.querySelectorAll('a[href^="/series/"]'), elm => elm.innerText);
|
||||
const type = doc.querySelector('a[href^="/type/"]').innerText;
|
||||
|
||||
const language = doc.querySelector('a[href^="/index"][href$=".html"]')?.getAttribute('href').slice(7, -5);
|
||||
|
||||
const related_tags = Array.from(doc.querySelectorAll('.relatedtags a'), elm => decodeURIComponent(elm.getAttribute('href')).slice(5, -9));
|
||||
|
||||
return {
|
||||
id: galleryid,
|
||||
galleryUrl: gallery_url,
|
||||
thumbnails: thumbnails,
|
||||
title: title,
|
||||
artists: artists,
|
||||
series: series,
|
||||
type: type,
|
||||
language: language,
|
||||
relatedTags: related_tags
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
function get_gallery_info(galleryID) {
|
||||
return new Promise((resolve, reject) => {
|
||||
$.getScript(`https://ltn.hitomi.la/galleries/${galleryID}.js`, () => {
|
||||
resolve(galleryinfo);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function do_search(query) {
|
||||
let terms = query.toLowerCase().trim().split(/\s+/);
|
||||
let positive_terms = [], negative_terms = [];
|
||||
|
||||
$.each(terms, function (i, term) {
|
||||
term = term.replace(/_/g, ' ');
|
||||
if (term.match(/^-/)) {
|
||||
negative_terms.push(term.replace(/^-/, ''));
|
||||
} else {
|
||||
positive_terms.push(term);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return new Promise((resolve, reject) => { //first results
|
||||
if (!positive_terms.length) {
|
||||
get_galleryids_from_nozomi(undefined, 'index', 'all').then(results => {
|
||||
resolve(results);
|
||||
});
|
||||
} else {
|
||||
const term = positive_terms.shift();
|
||||
get_galleryids_for_query(term).then(results => {
|
||||
resolve(results);
|
||||
});
|
||||
}
|
||||
}).then(() => { //positive results
|
||||
return Promise.all(positive_terms.map(term => {
|
||||
return new Promise((resolve, reject) => {
|
||||
get_galleryids_for_query(term).then(new_results => {
|
||||
const new_results_set = new Set(new_results);
|
||||
results = results.filter(galleryid => new_results_set.has(galleryid));
|
||||
resolve();
|
||||
})
|
||||
});
|
||||
}));
|
||||
}).then(() => { //negative results
|
||||
return Promise.all(negative_terms.map(term => {
|
||||
return new Promise((resolve, reject) => {
|
||||
get_galleryids_for_query(term).then(new_results => {
|
||||
const new_results_set = new Set(new_results);
|
||||
results = results.filter(galleryid => !new_results_set.has(galleryid));
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}));
|
||||
}).then(() => {
|
||||
const final_results_length = results.length;
|
||||
$('#number-of-results').html(final_results_length);
|
||||
if (!final_results_length) {
|
||||
hide_loading();
|
||||
$('.gallery-content').html($('#no-results-content').html());
|
||||
} else {
|
||||
put_results_on_page();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function replace_jpg_tn(tn) {
|
||||
if (!tn.startsWith('https')) tn = `https:${tn}`;
|
||||
if (tn.endsWith('jpg')) tn = tn.replace('bigtn', 'webpbigtn').replace(/jpg$/, 'webp');
|
||||
|
||||
return tn;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
async function get_gallery_url(galleryid) {
|
||||
const url = `https://hitomi.la/galleries/${galleryid}.html`;
|
||||
|
||||
const response = await fetch(url);
|
||||
const html = await response.text();
|
||||
|
||||
const doc = new DOMParser().parseFromString(html, 'text/html');
|
||||
|
||||
return doc.querySelector('link').getAttribute('href');
|
||||
}
|
||||
|
||||
async function get_gallery(galleryid) {
|
||||
const url = await get_gallery_url(galleryid);
|
||||
|
||||
const response = await fetch(url);
|
||||
const html = await response.text();
|
||||
|
||||
const doc = new DOMParser().parseFromString(rewrite_tn_paths(html), 'text/html');
|
||||
|
||||
//related
|
||||
eval(Array.from(doc.getElementsByTagName('script')).find(elm => elm.innerHTML.includes('var related')).innerHTML);
|
||||
|
||||
const lang_list = {};
|
||||
|
||||
Array.from(doc.querySelectorAll('#lang-list a')).forEach(elm => lang_list[elm.innerText] = elm.getAttribute('href').slice(11, -5));
|
||||
|
||||
const cover = replace_jpg_tn(doc.querySelector('.cover img').src);
|
||||
|
||||
const title = doc.querySelector('.gallery h1 a').innerText;
|
||||
const artists = Array.from(doc.querySelectorAll('.gallery h2 a'), elm => elm.innerText);
|
||||
const groups = Array.from(doc.querySelectorAll('.gallery-info a[href^="/group."]'), elm => elm.innerText);
|
||||
const type = doc.querySelector('.gallery-info a[href^="/type/"]').innerText.trim();
|
||||
|
||||
const language = doc.querySelector('.gallery-info a[href^="/index"][href$=".html"]').getAttribute('href').slice(7, -5);
|
||||
|
||||
const series = Array.from(doc.querySelectorAll('.gallery-info a[href^="/series/"]'), elm => elm.innerText);
|
||||
const characters = Array.from(doc.querySelectorAll('.gallery-info a[href^="/character/"]'), elm => elm.innerText);
|
||||
|
||||
const tags = Array.from(doc.querySelectorAll('.gallery-info a[href^="/tag/"]'), elm => decodeURIComponent(elm.getAttribute('href')).slice(5, -9));
|
||||
|
||||
const gallery_info = await get_gallery_info(galleryid);
|
||||
const thumbnails = gallery_info.files.map(file => url_from_url_from_hash(galleryid, file, 'webpsmallsmalltn', 'webp', 'tn'));
|
||||
|
||||
return {
|
||||
related: related,
|
||||
langList: lang_list,
|
||||
cover: cover,
|
||||
title: title,
|
||||
artists: artists,
|
||||
groups: groups,
|
||||
type: type,
|
||||
language: language,
|
||||
series: series,
|
||||
characters: characters,
|
||||
tags: tags,
|
||||
thumbnails: thumbnails
|
||||
};
|
||||
}
|
||||