Skip to content

Commit

Permalink
Merge branch 'release/1.9.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
hushenghao committed Jun 17, 2023
2 parents 7068bae + 0ee94ac commit 337ee2f
Show file tree
Hide file tree
Showing 145 changed files with 2,944 additions and 2,072 deletions.
72 changes: 35 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ name: Android CI

on:
push:
# branches: [ master ]
# branches: [ release/1.9.4 ]
tags:
- 'v*'
# pull_request:
# branches: [ master ]

jobs:
build:
Expand All @@ -15,53 +13,53 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: set up JDK 11
- name: set up JDK
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
cache: gradle

- name: Retrieve the secret and decode it to a file
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
KEY_PROPERTIES_BASE64: ${{ secrets.KEY_PROPERTIES_BASE64 }}
run: |
echo "$KEY_PROPERTIES_BASE64" | base64 --decode > key.properties
echo "$KEYSTORE_BASE64" | base64 --decode > keystore.jks
- name: Print root files
run: ls -l

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew assembleRelease

- name: Stop gradle daemon
run: ./gradlew --stop

# if: contains(github.ref, 'tags/')


- name: Get Change logs
id: get-change-logs
run: |
CHANGE_LOGS=`ls -r fastlane/metadata/android/en-US/changelogs | head -1`
echo "CHANGE_LOGS=$CHANGE_LOGS" >> "$GITHUB_OUTPUT"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
uses: ncipollo/release-action@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
# body: |
# Changes in this Release
# - First Change
# - Second Change
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
name: Release ${{ github.ref }}
# tag: v1.9.4-prerelease
# name: PreRelease v1.9.4
# commit: release/1.9.4
draft: false
prerelease: false

- name: Get Apk Name
id: get-apk-name
run: |
APK_NAME=`cd ./app/build/outputs/apk/release && ls *.apk`
echo ::set-output name=apk_name::$APK_NAME
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./app/build/outputs/apk/release/${{ steps.get-apk-name.outputs.apk_name }}
asset_name: Easter_Eggs_debug.apk
asset_content_type: application/vnd.android.package-archive


bodyFile: fastlane/metadata/android/en-US/changelogs/${{ steps.get-change-logs.outputs.CHANGE_LOGS }}
artifacts: ./app/build/outputs/apk/release/*.apk
artifactContentType: application/vnd.android.package-archive
allowUpdates: true
updateOnlyUnreleased: true
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-pgyer (0.2.4)
fastlane-plugin-pgyer (0.2.5)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.32.0)
google-apis-core (>= 0.9.1, < 2.a)
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ The project contains the complete code of the system Easter eggs, which aims to
| Android 10 (Queen Cake) | 29 | Icon Quiz ||| - |
| Android 9 (Pie) | 28 | PAINT.APK ||| - |
| Android 8.0~8.1 (Oreo) | 26~27 | Octopus ||| - |
| Android 7.0~7.1.2 (Nougat) | 24~25 | Neko ||| 24 |
| Android 6.0~6.0.1 (Marshmallow) | 23 | Marshmallow Land ||| - |
| Android 7.0~7.1 (Nougat) | 24~25 | Neko ||| 24 |
| Android 6.0 (Marshmallow) | 23 | Marshmallow Land ||| - |
| Android 5.0~5.1 (Lollipop) | 21~22 | L Land ||| - |
| Android 4.4~4.4.4 (KitKat) | 19~20 | Dessert Case ||| - |
| Android 4.4~4.4W (KitKat) | 19~20 | Dessert Case ||| - |
| Android 4.1~4.3 (Jelly Bean) | 16~18 | BeanBag ||| - |
| Android 4.0~4.0.4 (Ice Cream Sandwich) | 14~15 | Nyandroid ||| - |
| Android 4.0~4.0.3 (Ice Cream Sandwich) | 14~15 | Nyandroid ||| - |
| Android 3.0~3.2 (Honeycomb) | 11~13 | Honeycomb [*](#id_egg_name) ||| - |
| Android 2.3~2.3.7 (Gingerbread) | 9~10 | Gingerbread [*](#id_egg_name) ||| - |
| Android 2.2~2.2.3 (Froyo) | 8 | - | - | - | - |
| Android 2.3~2.3.3 (Gingerbread) | 9~10 | Gingerbread [*](#id_egg_name) ||| - |
| Android 2.2 (Froyo) | 8 | - | - | - | - |
| Android 2.0~2.1 (Eclair) | 5~7 | - | - | - | - |
| Android 1.6 (Donut) | 4 | - | - | - | - |
| Android 1.5 (Cupcake) | 3 | - | - | - | - |
| Android 1.1 (Petit Four) | 2 | - | - | - | - |
| Android 1.0 | 1 | - | - | - | - |
| Android 1.0 (Base) | 1 | - | - | - | - |

* <span id='id_new_features'>Easter eggs with new features of the system are used, and the old version of the system can only use some functions.</span>
* <span id='id_full_egg_mini_sdk'>The minimum SDK version required to fully experience Easter Egg.</span>
Expand Down
14 changes: 7 additions & 7 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@
| Android 10 (Queen Cake) | 29 | Icon Quiz ||| - |
| Android 9 (Pie) | 28 | PAINT.APK ||| - |
| Android 8.0~8.1 (Oreo) | 26~27 | Octopus ||| - |
| Android 7.0~7.1.2 (Nougat) | 24~25 | Neko ||| 24 |
| Android 6.0~6.0.1 (Marshmallow) | 23 | Marshmallow Land ||| - |
| Android 7.0~7.1 (Nougat) | 24~25 | Neko ||| 24 |
| Android 6.0 (Marshmallow) | 23 | Marshmallow Land ||| - |
| Android 5.0~5.1 (Lollipop) | 21~22 | L Land ||| - |
| Android 4.4~4.4.4 (KitKat) | 19~20 | Dessert Case ||| - |
| Android 4.4~4.4W (KitKat) | 19~20 | Dessert Case ||| - |
| Android 4.1~4.3 (Jelly Bean) | 16~18 | BeanBag ||| - |
| Android 4.0~4.0.4 (Ice Cream Sandwich) | 14~15 | Nyandroid ||| - |
| Android 4.0~4.0.3 (Ice Cream Sandwich) | 14~15 | Nyandroid ||| - |
| Android 3.0~3.2 (Honeycomb) | 11~13 | Honeycomb [*](#id_egg_name) ||| - |
| Android 2.3~2.3.7 (Gingerbread) | 9~10 | Gingerbread [*](#id_egg_name) ||| - |
| Android 2.2~2.2.3 (Froyo) | 8 | - | - | - | - |
| Android 2.3~2.3.3 (Gingerbread) | 9~10 | Gingerbread [*](#id_egg_name) ||| - |
| Android 2.2 (Froyo) | 8 | - | - | - | - |
| Android 2.0~2.1 (Eclair) | 5~7 | - | - | - | - |
| Android 1.6 (Donut) | 4 | - | - | - | - |
| Android 1.5 (Cupcake) | 3 | - | - | - | - |
| Android 1.1 (Petit Four) | 2 | - | - | - | - |
| Android 1.0 | 1 | - | - | - | - |
| Android 1.0 (Base) | 1 | - | - | - | - |

* <span id='id_new_features'>使用了系统新特性的彩蛋,老版本系统只能使用部分功能。</span>
* <span id='id_full_egg_mini_sdk'>完整体验彩蛋所需要的最低SDK版本。</span>
Expand Down
23 changes: 14 additions & 9 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ plugins {

android {
compileSdk = Versions.COMPILE_SDK
compileSdkPreview = "UpsideDownCake"
buildToolsVersion = Versions.BUILD_TOOLS
namespace = "com.dede.android_eggs"

defaultConfig {
applicationId = "com.dede.android_eggs"
minSdk = Versions.MIN_SDK
targetSdk = Versions.TARGET_SDK
versionCode = 26
versionName = "1.9.3"
// targetSdkPreview = "UpsideDownCake"
versionCode = 27
versionName = "1.9.4"
buildConfigField("String", "GIT_HASH", "\"${gitHash}\"")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
resourceConfigurations.addAll(listOf("zh", "en"))
Expand Down Expand Up @@ -60,11 +62,11 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "17"
}

testOptions {
Expand All @@ -86,16 +88,19 @@ android {

dependencies {
implementation(deps.androidx.appcompat)
implementation(deps.androidx.core.ktx)
implementation(deps.androidx.lifecycle.runtime.ktx)
implementation(deps.androidx.lifecycle.viewmodel.ktx)
implementation(deps.androidx.preference.ktx)
implementation(deps.androidx.core)
implementation(deps.androidx.activity)
implementation(deps.androidx.lifecycle.runtime)
implementation(deps.androidx.lifecycle.viewmodel)
implementation(deps.androidx.preference)
implementation(deps.androidx.constraintlayout)
implementation(deps.androidx.browser)
implementation(deps.androidx.window)
implementation(deps.google.material)
implementation(deps.io.coil)
implementation(deps.free.reflection)
implementation(deps.viewbinding.delegate)
implementation(deps.blurhash.android)
debugImplementation(deps.leakcanary)
implementation(project(":basic"))
implementation(project(":eggs:T"))
Expand Down
8 changes: 7 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
Expand All @@ -24,6 +24,12 @@
-dontwarn org.conscrypt.**
-dontwarn org.openjsse.**

-keepnames class * extends com.dede.android_eggs.ui.adapter.VHolder
-keepclassmembers class * extends com.dede.android_eggs.ui.adapter.VHolder {
public <init>(android.view.View);
}

# temp fix
-keep class androidx.activity.OnBackPressedDispatcher {
private android.window.OnBackInvokedCallback onBackInvokedCallback;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package com.dede.android_eggs

import androidx.annotation.StringRes
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.RecyclerViewActions.actionOnHolderItem
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.rules.ActivityScenarioRule
import com.dede.android_eggs.ViewActionsExt.clickChildViewWithId
import com.dede.android_eggs.main.EasterEggsActivity
import org.junit.Rule

Expand All @@ -23,9 +21,13 @@ open class EasterEggsActivityBaseTest {

fun testPlatLogo(@StringRes titleRes: Int) {
// EasterEggsActivity launch Easter Egg
onView(withId(androidx.preference.R.id.recycler_view))
.check(matches(ViewMatchers.isDisplayed()))
.perform(actionOnHolderItem(EggPreferenceMatcher(titleRes), click()))
onView(withId(R.id.recycler_view))
.perform(
actionOnHolderItem(
EggItemMatcher(titleRes),
clickChildViewWithId(R.id.card_view)
)
)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
package com.dede.android_eggs

import android.content.res.Resources
import android.view.View
import android.widget.TextView
import androidx.annotation.StringRes
import androidx.preference.PreferenceViewHolder
import androidx.recyclerview.widget.RecyclerView.ViewHolder
import androidx.test.espresso.UiController
import androidx.test.espresso.ViewAction
import androidx.test.espresso.action.ViewActions
import org.hamcrest.Description
import org.hamcrest.Matcher
import org.hamcrest.TypeSafeDiagnosingMatcher


/**
* Find Preference by title res
* Find EggItem by title res
*
* @author shhu
* @since 2022/9/2
*/
class EggPreferenceMatcher(@StringRes val titleRes: Int) :
TypeSafeDiagnosingMatcher<PreferenceViewHolder>() {
class EggItemMatcher(@StringRes val titleRes: Int) :
TypeSafeDiagnosingMatcher<ViewHolder>() {

private var expectedText: String? = null

override fun describeTo(description: Description) {
description.appendText("item title res id: $titleRes,")
}

override fun matchesSafely(item: PreferenceViewHolder, description: Description): Boolean {
override fun matchesSafely(item: ViewHolder, description: Description): Boolean {
if (expectedText == null) {
try {
expectedText = item.itemView.resources.getString(titleRes)
Expand All @@ -33,8 +39,8 @@ class EggPreferenceMatcher(@StringRes val titleRes: Int) :
description.appendText(" title: $expectedText")
}
val expected = expectedText
val titleView = item.findViewById(android.R.id.title) as TextView
val titleView = item.itemView.findViewById(R.id.tv_summary) as? TextView ?: return false
val actual = titleView.text.toString()
return actual == expected || (expected != null && expected.startsWith(actual))
return actual == expected
}
}
Loading

0 comments on commit 337ee2f

Please sign in to comment.