Compare commits
7 Commits
v2026.6.10
...
2026.7.19
| Author | SHA1 | Date | |
|---|---|---|---|
| 619bd21db8 | |||
| 11922d7199 | |||
| 16f3abf51b | |||
| c26663640d | |||
| 1a34854f4d | |||
| c0cdb495aa | |||
| 9d7f653cec |
11
.gitignore
vendored
11
.gitignore
vendored
@@ -58,6 +58,15 @@ google-services.json
|
|||||||
# Android Profiling
|
# Android Profiling
|
||||||
*.hprof
|
*.hprof
|
||||||
|
|
||||||
|
# Signing key
|
||||||
*.key
|
*.key
|
||||||
|
# APK for release upload
|
||||||
|
*1_20*
|
||||||
|
# APK from recompile
|
||||||
*_fix*
|
*_fix*
|
||||||
out/
|
# Decompiled APK files
|
||||||
|
out*
|
||||||
|
# Savesates
|
||||||
|
save*
|
||||||
|
# Backups
|
||||||
|
*~
|
||||||
|
|||||||
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
FROM alpine
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
openjdk17-jre \
|
||||||
|
wget \
|
||||||
|
bash \
|
||||||
|
patch
|
||||||
|
|
||||||
|
RUN wget -O /usr/local/bin/apktool \
|
||||||
|
https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool && \
|
||||||
|
wget -O /usr/local/bin/apktool.jar \
|
||||||
|
https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_3.0.2.jar && \
|
||||||
|
chmod +x /usr/local/bin/apktool.jar && \
|
||||||
|
chmod +x /usr/local/bin/apktool
|
||||||
|
|
||||||
|
WORKDIR /data
|
||||||
|
|
||||||
|
CMD ["tail", "-f", "/dev/null"]
|
||||||
50
README.md
50
README.md
@@ -1,15 +1,25 @@
|
|||||||
# bejeweled-classic
|
# bejeweled-classic
|
||||||
|
|
||||||
## The issue
|
## The main issue
|
||||||
|
|
||||||
Bejewled Classic (v3.8.1) has issues with newer high resolution screens, which results in forced landscape mode. In some cases, the inputs are all over the place.
|
Bejewled Classic (v3.8.1) has issues with newer high resolution screens, which results in forced landscape mode. In some cases, the inputs are all over the place.
|
||||||

|

|
||||||
|
|
||||||
|
## What's different
|
||||||
|
|
||||||
|
[v2026.7.7]
|
||||||
|
- Changed storage location from `/data/app/0/...` to `/storage/emulated/0/Android/media/com.ea.gp.bej3/` for exposing the savestates and stored settings
|
||||||
|
- Added new app version (can be either viewed in app info or ingame in the about menu)
|
||||||
|
|
||||||
|
[v2026.6.10]
|
||||||
|
- Changed the `xlargeScreens` from `false` to `true` to fix the forced landscape issue
|
||||||
|
|
||||||
## Fix
|
## Fix
|
||||||
|
|
||||||
|
|
||||||
### Download
|
### Download
|
||||||
|
|
||||||
[Download from releases]()
|
[Download from releases](https://git.pinguin-software.de/DasMoorhuhn/bejeweled-classic/releases)
|
||||||
|
|
||||||
### DIY
|
### DIY
|
||||||
|
|
||||||
@@ -20,24 +30,38 @@ Bejewled Classic (v3.8.1) has issues with newer high resolution screens, which r
|
|||||||
> - [apktool](https://apktool.org/docs/install) (newer versions do work better than what comes from the debian repos)
|
> - [apktool](https://apktool.org/docs/install) (newer versions do work better than what comes from the debian repos)
|
||||||
> - aapt
|
> - aapt
|
||||||
> - adb (optional)
|
> - adb (optional)
|
||||||
|
> - [diff](https://man7.org/linux/man-pages/man1/diff.1.html) (optional)
|
||||||
|
> - [patch](https://man7.org/linux/man-pages/man1/patch.1.html) (optional if changes are applied by hand)
|
||||||
|
|
||||||
1. Download the apk or use the one which comes within this repo (I got it from [apkpure](https://apkpure.com/bejeweled-classic/com.ea.gp.bej3/download))
|
1. Download the apk or use the one which comes within this repo (I got it from [apkpure](https://apkpure.com/bejeweled-classic/com.ea.gp.bej3/download))
|
||||||
2. decompile the apk `apktool d bejeweled_classic_3.8.1.apk -o out`
|
2. decompile the apk `apktool d bejeweled_classic_3.8.1.apk -o out`
|
||||||
3. edit the `out/AndroidManifest.xml` and change in the `<supports-screens>` section the value for the attribute `xlargeScreens` from `false` to `true`
|
3. Run `sh apply_patch.sh`
|
||||||
4. Recompile the apk `apktool b out -o bejeweled_classic_3.8.1_fix.apk`
|
4. Generate a key to sign the apk
|
||||||
5. Generate a key to sign the apk
|
|
||||||
- `keytool -genkeypair -keystore bejeweled-classic.key -alias mykey -keyalg RSA -keysize 2048 -validity 10000`
|
- `keytool -genkeypair -keystore bejeweled-classic.key -alias mykey -keyalg RSA -keysize 2048 -validity 10000`
|
||||||
- Set a password for the key, for example using `openssl rand -hex 20`
|
- Set a password for the key, for example using `openssl rand -hex 20`
|
||||||
- Answer every question, except the organisation (use anything like your nickname or whatever), with a `.` dot and finally confirm with `yes`
|
- Answer every question, except the organisation (use anything like your nickname or whatever), with a `.` dot and finally confirm with `yes`
|
||||||
6. Sign the apk `apksigner sign --ks bejeweled-classic.key bejeweled_classic_3.8.1_fix.apk`
|
5. Recompile and sign the apk with `sh recompile_and_sign.sh`
|
||||||
7. Install the `bejeweled_classic_3.8.1_fix.apk` by transfering it to your phone or via adb, make sure to uninstall the existing app beforehand
|
- Alternativly run `sh recompile_and_install.sh` for directly installing it via adb
|
||||||
|
6. Install the `bejeweled_classic_fix.apk` by transfering it to your phone or via adb, make sure to uninstall the existing app beforehand
|
||||||
|
|
||||||
### XML Line
|
### Patching
|
||||||
|
|
||||||
```xml
|
#### Apply patch
|
||||||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:requiresSmallestWidthDp="240" android:smallScreens="true" android:xlargeScreens="false"/>
|
```sh
|
||||||
|
sh apply_patch.sh
|
||||||
```
|
```
|
||||||
Needs to be changed to
|
|
||||||
```xml
|
#### Generate `changes.patch`
|
||||||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:requiresSmallestWidthDp="240" android:smallScreens="true" android:xlargeScreens="true"/>
|
Decompile the same APK to `./out_orig/` and do you chancges in `./out/`
|
||||||
|
```sh
|
||||||
|
sh generate_patch_diff.sh
|
||||||
```
|
```
|
||||||
|
You may want to add a different app version like `android:versionCode='18101' android:versionName='3.8.1_2026.7.7'` to the `AndroidManifest.xml` file, otherwise the version which will be displayed in app info will be `3.8.1`.
|
||||||
|
|
||||||
|
## Docker
|
||||||
|
|
||||||
|
The docker image contains all needed tools to decompile/compile an APK.
|
||||||
|
|
||||||
|
- Build the image: `docker compose build`
|
||||||
|
- Run the container: `docker compose up -d`
|
||||||
|
- Enter the container: `docker compose exec bejeweled-env bash`
|
||||||
10
compose.yml
Normal file
10
compose.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
services:
|
||||||
|
bejeweled-env:
|
||||||
|
container_name: bejeweled_env
|
||||||
|
image: bejeweled-env:1.0
|
||||||
|
stop_grace_period: "1s"
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
volumes:
|
||||||
|
- ./src:/data:rw
|
||||||
2
src/apply_patch.sh
Normal file
2
src/apply_patch.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd out && patch -p1 < ../changes.patch && cd -
|
||||||
55
src/changes.patch
Normal file
55
src/changes.patch
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
diff -ru out_orig/AndroidManifest.xml out/AndroidManifest.xml
|
||||||
|
--- out_orig/AndroidManifest.xml 2026-07-07 19:54:08.644033630 +0200
|
||||||
|
+++ out/AndroidManifest.xml 2026-07-07 21:06:25.467129268 +0200
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="34" android:compileSdkVersionCodename="14" android:installLocation="auto" package="com.ea.gp.bej3" platformBuildVersionCode="34" platformBuildVersionName="14">
|
||||||
|
- <supports-screens android:largeScreens="true" android:normalScreens="true" android:requiresSmallestWidthDp="240" android:smallScreens="true" android:xlargeScreens="false"/>
|
||||||
|
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode='18101' android:versionName='3.8.1_2026.7.7' android:compileSdkVersion="34" android:compileSdkVersionCodename="14" android:installLocation="auto" package="com.ea.gp.bej3" platformBuildVersionCode="34" platformBuildVersionName="14">
|
||||||
|
+ <supports-screens android:largeScreens="true" android:normalScreens="true" android:requiresSmallestWidthDp="240" android:smallScreens="true" android:xlargeScreens="true"/>
|
||||||
|
<uses-feature android:glEsVersion="0x20000"/>
|
||||||
|
<queries>
|
||||||
|
<package android:name="com.ea.gp.bejeweledskies"/>
|
||||||
|
Nur in out/: build.
|
||||||
|
diff -ru out_orig/smali_classes2/com/ea/EAMIO/StorageDirectory.smali out/smali_classes2/com/ea/EAMIO/StorageDirectory.smali
|
||||||
|
--- out_orig/smali_classes2/com/ea/EAMIO/StorageDirectory.smali 2026-07-07 19:54:03.076990838 +0200
|
||||||
|
+++ out/smali_classes2/com/ea/EAMIO/StorageDirectory.smali 2026-07-07 20:24:46.756970752 +0200
|
||||||
|
@@ -20,35 +20,15 @@
|
||||||
|
.method public static GetInternalStorageDirectory()Ljava/lang/String;
|
||||||
|
.locals 1
|
||||||
|
|
||||||
|
- sget-object v0, Lcom/ea/EAMIO/StorageDirectory;->sActivity:Landroid/app/Activity;
|
||||||
|
-
|
||||||
|
- .line 30
|
||||||
|
- invoke-virtual {v0}, Landroid/app/Activity;->getFilesDir()Ljava/io/File;
|
||||||
|
-
|
||||||
|
- move-result-object v0
|
||||||
|
-
|
||||||
|
- invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
|
||||||
|
-
|
||||||
|
- move-result-object v0
|
||||||
|
+ const-string v0, "/storage/emulated/0/Android/media/com.ea.gp.bej3/files_internal/"
|
||||||
|
|
||||||
|
return-object v0
|
||||||
|
.end method
|
||||||
|
|
||||||
|
.method public static GetPrimaryExternalStorageDirectory()Ljava/lang/String;
|
||||||
|
- .locals 2
|
||||||
|
-
|
||||||
|
- sget-object v0, Lcom/ea/EAMIO/StorageDirectory;->sActivity:Landroid/app/Activity;
|
||||||
|
-
|
||||||
|
- const/4 v1, 0x0
|
||||||
|
-
|
||||||
|
- .line 40
|
||||||
|
- invoke-virtual {v0, v1}, Landroid/app/Activity;->getExternalFilesDir(Ljava/lang/String;)Ljava/io/File;
|
||||||
|
-
|
||||||
|
- move-result-object v0
|
||||||
|
-
|
||||||
|
- invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
|
||||||
|
+ .locals 1
|
||||||
|
|
||||||
|
- move-result-object v0
|
||||||
|
+ const-string v0, "/storage/emulated/0/Android/media/com.ea.gp.bej3/files_external/"
|
||||||
|
|
||||||
|
return-object v0
|
||||||
|
.end method
|
||||||
2
src/generate_patch_diff.sh
Normal file
2
src/generate_patch_diff.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
diff -ru out_orig out/ > changes.patch
|
||||||
2
src/recompile_and_install.sh
Executable file
2
src/recompile_and_install.sh
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
sh ./recompile_and_sign.sh && adb install bejeweled_classic_fix.apk
|
||||||
3
src/recompile_and_sign.sh
Normal file
3
src/recompile_and_sign.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
apktool b out -o bejeweled_classic_fix.apk && \
|
||||||
|
apksigner sign --ks bejeweled-classic.key bejeweled_classic_fix.apk
|
||||||
Reference in New Issue
Block a user