Skip to content

Commit d25ce3d

Browse files
Fix compile scripts to spoof Realme RMX3661 fingerprint
Hard-code -qgki-gc916795b189b suffix in setlocalversion Inject user/host/timestamp/Android tag/clang/LLD into mkcompile_sh Ensure banner reads exactly the target fingerprint for RMX3661
2 parents d7beb0b + 403bd4d commit d25ce3d

File tree

4 files changed

+33
-67
lines changed

4 files changed

+33
-67
lines changed

KernelSU-Next

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit f7a3699fe38d7f610f4bbb90be631b39f7e4363a
1+
Subproject commit 5ee435638b1d407378c50845123b60b8bf782089

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ $(sort $(vmlinux-deps)): descend ;
13171317

13181318
filechk_kernel.release = \
13191319
echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion \
1320-
$(srctree) $(BRANCH) $(KMI_GENERATION))"
1320+
$(srctree) android12 0)"
13211321

13221322
# Store (new) KERNELRELEASE string in include/config/kernel.release
13231323
include/config/kernel.release: FORCE

scripts/mkcompile_h

Lines changed: 30 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,33 @@ fi
2525
# Do not expand names
2626
set -f
2727

28-
# Fix the language to get consistent output
29-
LC_ALL=C
30-
export LC_ALL
3128

3229
if [ -z "$KBUILD_BUILD_VERSION" ]; then
3330
VERSION=$(cat .version 2>/dev/null || echo 1)
3431
else
3532
VERSION=$KBUILD_BUILD_VERSION
3633
fi
34+
VERSION=1
35+
# ── Spoofed build metadata: exact values ─────────────────────────────
36+
TIMESTAMP="Fri Apr 18 11:04:11 CST 2025"
37+
LINUX_COMPILE_BY="root"
38+
LINUX_COMPILE_HOST="kvm-slave-build-s-vendor-04946496"
3739

38-
if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then
39-
TIMESTAMP=`date`
40-
else
41-
TIMESTAMP=$KBUILD_BUILD_TIMESTAMP
42-
fi
43-
if test -z "$KBUILD_BUILD_USER"; then
44-
LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/')
45-
else
46-
LINUX_COMPILE_BY=$KBUILD_BUILD_USER
47-
fi
48-
if test -z "$KBUILD_BUILD_HOST"; then
49-
LINUX_COMPILE_HOST=`uname -n`
50-
else
51-
LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST
52-
fi
40+
# Always SMP PREEMPT, no initcall_debug here
41+
PREEMPT=CONFIG_FLAGS="SMP PREEMPT"
42+
43+
# Android tag (if you need it, else leave blank)
44+
LINUX_COMPILER=ANDROID_INFO="(Android (6877366 based on r383902b1) "
45+
46+
# Compiler versions
47+
CC_VERSION="clang version 11.0.2 (https://android.googlesource.com/toolchain/llvm-project b397f81060ce6d701042b782172ed13bee898b79)"
48+
LD="LLD 11.0.2 (https://android.googlesource.com/toolchain/llvm-project b397f81060ce6d701042b782172ed13bee898b79)"
5349

54-
UTS_VERSION="#$VERSION"
55-
CONFIG_FLAGS=""
56-
if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
57-
if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
58-
if [ -n "$PREEMPT_RT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"; fi
50+
51+
# append real-time preempt if requested
52+
if [ -n "$PREEMPT_RT" ] ; then
53+
CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT_RT"
54+
fi
5955
UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
6056

6157
# Truncate to maximum length
@@ -65,45 +61,15 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
6561

6662
# Generate a temporary compile.h
6763

68-
{ echo /\* This file is auto generated, version $VERSION \*/
69-
if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi
70-
71-
echo \#define UTS_MACHINE \"$ARCH\"
72-
73-
echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
74-
75-
echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\"
76-
echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\"
77-
78-
LD_VERSION=$($LD -v | head -n1 | sed 's/(compatible with [^)]*)//' \
79-
| sed 's/[[:space:]]*$//')
80-
printf '#define LINUX_COMPILER "%s"\n' "$CC_VERSION, $LD_VERSION"
64+
{
65+
echo "/* This file is auto generated, version $VERSION */"
66+
if [ -n "$CONFIG_FLAGS" ]; then
67+
echo "/* $CONFIG_FLAGS */"
68+
fi
69+
echo "#define UTS_MACHINE \"arm64\"";
70+
echo "#define UTS_VERSION \"#1 SMP PREEMPT Fri Apr 18 11:04:11 CST 2025\"";
71+
echo "#define LINUX_COMPILE_BY \"root\"";
72+
echo "#define LINUX_COMPILE_HOST \"kvm-slave-build-s-vendor-04946496\"";
73+
printf '#define LINUX_COMPILER "%s"\n' "$CC_VERSION, $LD_VERSION";
8174
} > .tmpcompile
82-
83-
# Only replace the real compile.h if the new one is different,
84-
# in order to preserve the timestamp and avoid unnecessary
85-
# recompilations.
86-
# We don't consider the file changed if only the date/time changed,
87-
# unless KBUILD_BUILD_TIMESTAMP was explicitly set (e.g. for
88-
# reproducible builds with that value referring to a commit timestamp).
89-
# A kernel config change will increase the generation number, thus
90-
# causing compile.h to be updated (including date/time) due to the
91-
# changed comment in the
92-
# first line.
93-
94-
if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then
95-
IGNORE_PATTERN="UTS_VERSION"
96-
else
97-
IGNORE_PATTERN="NOT_A_PATTERN_TO_BE_MATCHED"
98-
fi
99-
100-
if [ -r $TARGET ] && \
101-
grep -v $IGNORE_PATTERN $TARGET > .tmpver.1 && \
102-
grep -v $IGNORE_PATTERN .tmpcompile > .tmpver.2 && \
103-
cmp -s .tmpver.1 .tmpver.2; then
104-
rm -f .tmpcompile
105-
else
106-
vecho " UPD $TARGET"
107-
mv -f .tmpcompile $TARGET
108-
fi
109-
rm -f .tmpver.1 .tmpver.2
75+
mv -f .tmpcompile $TARGET

scripts/setlocalversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,4 +215,4 @@ else
215215
fi
216216
fi
217217

218-
res=$(echo $res | cut -d- -f1-2)-OP-Wild;echo "$res";
218+
echo "-qgki-gc916795b189b"

0 commit comments

Comments
 (0)