Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Windows
Thumbs.db
ehthumbs.db
Desktop.ini
4 changes: 4 additions & 0 deletions adbreak/adbreak.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@
alert("Version number is: " + ver);

var entry = offsets[ver];
if (!entry) {
alert("This build is not in AdBreak's offset table: " + ver + "\nCheck firmware is 5.18.1-5.18.5 and that AdBreak supports your device.");
throw new Error("unsupported build");
}
var memcpy_got = entry.memcpy_got;
var xml_got = entry.xml_got;
var memcpy_offset = entry.memcpy_offset;
Expand Down
2 changes: 1 addition & 1 deletion adbreak/guide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Requirements:
7. Download and extract "adbreak.zip", copy the contents to the ".assets" folder on your desktop.

8. Replace the contents of all "details.html" files with the contents of "adbreak.html":
Windows: Double click on "replace.bat"
Windows: Double click on "replace.bat" (it searches from its own folder; you should see a list of each Replaced: path, or a message if none were found)
Linux/Mac CLI: find . -name 'details.html' -exec cp adbreak.html {} \;

9. Delete the original .assets folder on the Kindle and replace it with our modified copy.
Expand Down
23 changes: 20 additions & 3 deletions adbreak/replace.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
@echo off
setlocal
for /r "." %%F in (details.html) do (
setlocal EnableDelayedExpansion
rem Always search from this script's folder. "Run as administrator" and some
rem launch methods leave the current directory as System32, so for /r "."
rem would find nothing and fail silently.
set "_root=%~dp0"
set /a _count=0
Comment on lines +2 to +7
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EnableDelayedExpansion isn't needed here (you never read _count inside the for block), and it can break when %~dp0 or any matched path contains ! (literal exclamation marks get treated as delayed-expansion delimiters after %_root% is expanded). Consider dropping delayed expansion and using %_count% for the final summary (or enabling delayed expansion only in the narrowest scope where it's required).

Copilot uses AI. Check for mistakes.
for /r "%_root%" %%F in (details.html) do (
if exist "%%~fF" (
copy /y "%~dp0adbreak.html" "%%~fF" >nul
copy /y "%_root%adbreak.html" "%%~fF" >nul
if not errorlevel 1 (
set /a _count+=1
echo Replaced: %%~fF
)
)
)
if !_count! equ 0 (
echo No details.html files found under:
echo %_root%
echo Put replace.bat next to adbreak.html inside your copied .assets tree, then run again.
Comment on lines +8 to +20
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The final summary uses _count (successful copies) to decide whether to print "No details.html files found". If details.html files exist but the copy fails (e.g., adbreak.html missing or permissions issue), _count stays 0 and the script reports that no files were found, which is misleading. Consider separately counting matches vs. successful replacements and/or checking %_root%adbreak.html exists up front; also emit an explicit error when a copy fails so users can diagnose why nothing was replaced.

Copilot uses AI. Check for mistakes.
) else (
echo.
echo Done. Replaced !_count! file^(s^).
)
endlocal
Loading