Skip to content
Open

Rrrr #20

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
6720c29
Create android.yml
linzyt223 Sep 24, 2024
941de8c
Update android.yml
linzyt223 Sep 24, 2024
51a65a9
Update android.yml
linzyt223 Sep 24, 2024
352c4f0
Update android.yml
linzyt223 Sep 24, 2024
de7f85d
Update android.yml
linzyt223 Sep 24, 2024
a836fd1
Update android.yml
linzyt223 Sep 24, 2024
98e76f1
Update android.yml
linzyt223 Sep 24, 2024
79521f1
Update android.yml
linzyt223 Sep 24, 2024
0e486c4
Update android.yml
linzyt223 Sep 24, 2024
4bef7dd
Update android.yml
linzyt223 Sep 24, 2024
78603ef
Update android.yml
linzyt223 Sep 24, 2024
9cffd97
Update android.yml
linzyt223 Sep 24, 2024
6620282
Update android.yml
linzyt223 Sep 24, 2024
41d3e3c
Update android.yml
linzyt223 Sep 24, 2024
8ccebc7
Update android.yml
linzyt223 Sep 24, 2024
629111e
Update android.yml
linzyt223 Sep 24, 2024
c26037c
Update android.yml
linzyt223 Sep 24, 2024
3f5d546
Update android.yml
linzyt223 Sep 24, 2024
4390fe9
Update android.yml
linzyt223 Sep 24, 2024
54392f0
Update android.yml
linzyt223 Sep 24, 2024
34b8443
Update android.yml
linzyt223 Sep 24, 2024
21b7558
Update android.yml
linzyt223 Sep 24, 2024
4a46a21
Update android.yml
linzyt223 Sep 24, 2024
518f182
Update android.yml
linzyt223 Sep 24, 2024
59fa2fb
Update android.yml
linzyt223 Sep 24, 2024
6e2bfdb
Create gen_key.sh
linzyt223 Sep 24, 2024
68ecbb7
e
linzyt223 Sep 25, 2024
416df9e
w
linzyt223 Sep 25, 2024
caa431c
e
linzyt223 Sep 25, 2024
0b054d5
e
linzyt223 Sep 25, 2024
fbc8e1e
e
linzyt223 Sep 25, 2024
dbd5fe3
e
linzyt223 Sep 25, 2024
5ff6fbd
e
linzyt223 Sep 26, 2024
bce7238
e
linzyt223 Sep 26, 2024
9f4cbf2
e
linzyt223 Sep 26, 2024
88570f4
r
linzyt223 Sep 26, 2024
f467a62
e
linzyt223 Sep 26, 2024
c5359c2
e
linzyt223 Sep 26, 2024
1b49d98
e
linzyt223 Sep 26, 2024
5925fdf
e
linzyt223 Sep 26, 2024
0ff959e
e
linzyt223 Sep 26, 2024
a6dd710
e
linzyt223 Sep 26, 2024
d398a85
e
linzyt223 Sep 26, 2024
61312b1
w
linzyt223 Sep 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Android CI

on:
workflow_dispatch:
inputs:
docker_images:
description: '请填写docker镜像名称 多个用英文逗号分开'
required: true
default: 'alpine:latest' # 设置默认的 Docker 镜像列表

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
# Set Current Date As Env Variable
- name: Set current date as env variable
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

# Set Repository Name As Env Variable
- name: Set repository name as env variable
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV

- name: Set Up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
cache: 'gradle'

- name: Change wrapper permissions
run: chmod +x ./gradlew

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26d
link-to-sdk: true

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: |
./gradlew assembleRelease
sudo mkdir app/build/outputs/apk/release/si
sudo cp app/build/outputs/apk/release/app-arm64-v8a-release-unsigned.apk app/build/outputs/apk/release/si
sudo chmod 777 app/build/outputs/apk/release/si




- name: gener key
id: skey
run: |
keytool -genkeypair \
-alias alias \
-storetype JKS \
-keyalg RSA \
-sigalg SHA256withRSA \
-keysize 2048 \
-validity 3650 \
-dname "CN=cv, OU=jk, O=mul, L=go, ST=goiania, C=br" \
-storepass "123456" \
-keypass "123456" \
-keystore df.jks
echo "encoded_key=$(base64 df.jks | tr -d '\n')" >> "$GITHUB_OUTPUT"

# Sign APK using ilharp/sign-android-release@v1
- name: Sign APK
uses: ilharp/sign-android-release@v1
with:
releaseDir: app/build/outputs/apk/release/si
signingKey: ${{ steps.skey.outputs.encoded_key }} # Replace with the actual base64-encoded keystore
keyAlias: alias
keyStorePassword: "123456"
keyPassword: "123456"
buildToolsVersion: 33.0.0
# Step 6: Generate Keystore using keytool
# - name: Generate Keystore
# run: |
# keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 \
# -alias my-key-alias -storepass android -keypass android \
# -dname "CN=Example, OU=Dev, O=MyCompany, L=City, ST=State, C=US"

# Step 7: Sign APK
# - name: Sign APK
# run: |
# jarsigner -verbose -keystore my-release-key.jks -storepass android -keypass android \
# app/build/outputs/apk/release/app-arm64-v8a-release-unsigned.apk my-key-alias
# zipalign -v 4 app/build/outputs/apk/release/app-arm64-v8a-release-unsigned.apk app/build/outputs/apk/release/app-release.apk



- uses: actions/upload-artifact@v4
with:
name: build-artifact
path: app/build/outputs/apk/release/si/app-arm64-v8a-release-unsigned-signed.apk
53 changes: 53 additions & 0 deletions gen_key.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
#
# Andre Ferreira <andre.dev.linux@gmail.com>
#

# Set environment variables
set -u
export JKS_CN="MC-OAuthServer"
export JKS_OU="Authorization Server"
export JKS_O="Multicode"
export JKS_L="GO"
export JKS_ST="Goiania"
export JKS_C="BR"

export KEYSTORE_ALIAS="mc-oauth-server"
export KEYSTORE_FILE_PATH="./${KEYSTORE_ALIAS}.jks"
export KEYSTORE_PASSWORD=$(openssl rand -base64 30)

# Display Key pass to get and add in application.yaml
echo ""
echo "Key Pass: ${KEYSTORE_PASSWORD}"
echo ""

# Generate KeyPair storage type JKS
keytool -genkeypair \
-alias $KEYSTORE_ALIAS \
-storetype JKS \
-keyalg RSA \
-sigalg SHA256withRSA \
-keysize 2048 \
-validity 3650 \
-dname "CN=${JKS_CN}, OU=${JKS_OU}, O=${JKS_O}, L=${JKS_L}, ST=${JKS_ST}, C=${JKS_C}" \
-storepass $KEYSTORE_PASSWORD \
-keypass $KEYSTORE_PASSWORD \
-keystore $KEYSTORE_FILE_PATH

# Get base64 of keystore file
#base64 -i $KEYSTORE_FILE_PATH -w 0
export $SIGNINGKEY=$(base64 "${KEYSTORE_FILE_PATH}" | tr -d '\n')
# Remove key store file
echo ""
echo "SIGNING Key: ${SIGNINGKEY}"
echo ""
echo
if [ -f "${KEYSTORE_FILE_PATH}" ]; then
rm -f $KEYSTORE_FILE_PATH
fi

# Unset environment variables
set +u
unset KEYSTORE_ALIAS
unset KEYSTORE_PASSWORD
unset KEYSTORE_FILE_PATH
3 changes: 1 addition & 2 deletions lib/src/main/java/com/artifex/mupdf/viewer/PageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public class PageView extends ViewGroup {
private static final int PROGRESS_DIALOG_DELAY = 200;

protected final Context mContext;

protected int mPageNumber;
private Point mParentSize;
protected Point mSize; // Size of page at minimum zoom
Expand Down Expand Up @@ -227,7 +226,7 @@ public void setPage(int page, PointF size) {
mDrawEntire.cancel();
mDrawEntire = null;
}

mIsBlank = false;
// Highlights may be missing because mIsBlank was true on last draw
if (mSearchView != null)
Expand Down
14 changes: 11 additions & 3 deletions lib/src/main/java/com/artifex/mupdf/viewer/ReaderView.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.artifex.mupdf.viewer;

import com.artifex.mupdf.fitz.Link;
import com.artifex.mupdf.fitz.StructuredText;
//import com.artifex.mupdf.fitz;

import java.util.LinkedList;
import java.util.NoSuchElementException;
Expand Down Expand Up @@ -66,7 +68,7 @@ public class ReaderView
private int mScrollerLastY;
private float mLastScaleFocusX;
private float mLastScaleFocusY;

// public StructuredText mST = new StructuredText(123);
protected Stack<Integer> mHistory;

static abstract class ViewMapper {
Expand Down Expand Up @@ -906,7 +908,11 @@ public void setLinksEnabled(boolean b) {
resetupChildren();
invalidate();
}

public int snapword(float x, float y) {
com.artifex.mupdf.fitz.Point tmp1 = new com.artifex.mupdf.fitz.Point(x,y);
com.artifex.mupdf.fitz.Point tmp2 = new com.artifex.mupdf.fitz.Point(x,y);
return 0;//StructuredText.napSelection(tmp1, tmp2, 1);
}
public boolean onSingleTapUp(MotionEvent e) {
Link link = null;
if (!tapDisabled) {
Expand All @@ -918,6 +924,7 @@ public boolean onSingleTapUp(MotionEvent e) {
setDisplayedViewIndex(page);
} else {
onTapMainDocArea();
snapword(e.getX(), e.getY());
}
} else if (e.getX() < tapPageMargin) {
smartMoveBackwards();
Expand All @@ -929,11 +936,12 @@ public boolean onSingleTapUp(MotionEvent e) {
smartMoveForwards();
} else {
onTapMainDocArea();
snapword(e.getX(), e.getY());
}
}
return true;
}

protected void onChildSetup(int i, View v) {
if (SearchTaskResult.get() != null
&& SearchTaskResult.get().pageNumber == i)
Expand Down
Binary file added mc-oauth-server.jks
Binary file not shown.