cap sync writes into android/ in two ways only: the copy step replaces assets/public/ and the two JSON files beside it, and the update step rewrites capacitor.settings.gradle, app/capacitor.build.gradle, capacitor.plugins.json and the Cordova 129 plugin module. Only cap add writes appId and appName into MainActivity, build.gradle and strings.xml. To prove it, start from the committed customizations of MainActivity and AppDelegate and Gradle Files, hand-add an androidx.webkit dependency to capacitor.build.gradle, change appName in capacitor.config.json to "BookNest Mobile", and install a plugin:
npm install @capacitor/preferences
grep -n implementation android/app/capacitor.build.gradle
npx cap sync android
git status --short android
grep -n implementation android/app/capacitor.build.gradle
grep app_name android/app/src/main/res/values/strings.xml$ grep -n implementation android/app/capacitor.build.gradle
12: implementation "androidx.webkit:webkit:1.14.0"
$ npx cap sync android
...
[info] Found 1 Capacitor plugin for android:
@capacitor/preferences@8.0.1
✔ update android in 78.32ms
[info] Sync finished in 0.195s
$ git status --short android
M android/app/capacitor.build.gradle
M android/capacitor.settings.gradle
$ grep -n implementation android/app/capacitor.build.gradle
12: implementation project(':capacitor-preferences')
$ grep app_name android/app/src/main/res/values/strings.xml
<string name="app_name">BookNest Shop</string>The manifest, MainActivity and Gradle 19,597 edits are absent from the status: sync left them alone. The hand-added dependency is gone, and capacitor.settings.gradle now includes :capacitor-preferences from ../node_modules/@capacitor/preferences/android. That folder holds the plugin's native code, compiled as a Gradle module and never copied into your project. The new appName did not reach strings.xml.
The project still builds, with the plugin as its own Gradle module, and the APK keeps the native identity:
cd android && ./gradlew assembleDebug --no-daemon
aapt2 dump badging app/build/outputs/apk/debug/app-debug.apk | grep -E "^(package|application):"... > Task :capacitor-preferences:assembleDebug UP-TO-DATE BUILD SUCCESSFUL in 24s package: name='com.example.booknest' versionCode='3' versionName='1.2.0' ... application: label='BookNest Shop' icon='res/mipmap-anydpi-v26/ic_launcher.xml'
So: put dependencies in app/build.gradle, never in the generated files; change the name, ID and version in the native files; commit before every cap migrate or plugin upgrade and read the diff after. To script edits you repeat across apps, Ionic 20,753 's MIT-licensed Trapeze 377 (github.com/ionic-team/trapeze (https://github.com/ionic-team/trapeze 377 )) applies manifest, Gradle and Info.plist changes from a YAML file.