diff options
| author | mosimchah <mosimchah@gmail.com> | 2025-12-06 07:56:58 -0500 |
|---|---|---|
| committer | mosimchah <mosimchah@gmail.com> | 2025-12-06 07:56:58 -0500 |
| commit | 85195f64e931ca22fac0d6fc4c179f7d551b2ccc (patch) | |
| tree | f9ed69fa8107d1aacf6749e95ea602a1fda20df6 | |
| parent | d6868c9729377c2d608d2ab1234475df44097e34 (diff) | |
aicp: add our tools from w16.0_pre-rebase_12-3-25
https://github.com/AICP/vendor_aicp/tree/w16.0_pre-rebase-12-3-25
commit 38010c07dcc599723511274259e61cf9623e199d
Author: LuK1337 <priv.luk@gmail.com>
Date: Mon Nov 10 10:26:28 2025 +0100
Move APNs data to vendor/apn
Change-Id: I4b939bf232a33d82664f890e33f47e22c1f72cee
commit 5c9d7ad67e2ee54687e7fdbbc9f9e8c1afaa50ac
Author: Sebastiano Barezzi <seba@sebaubuntu.dev>
Date: Mon Jul 22 01:45:20 2024 +0200
apns: Add a XML schema and check apns-conf.xml against it
Change-Id: Id115dd7beeafffcdf24e9ff1732490f0ca808279
commit de32553732b4c01efcc575a48ad45bd89bc99f7f
Author: LuK1337 <priv.luk@gmail.com>
Date: Thu Mar 7 10:31:13 2024 +0100
kernel: Add clean headers script to workaround conflicts with bionic
After the "Avoid multiple definitions of sigaction." change in bionic,
we ought to modify our kernel headers to make sure that sigaction struct
is not present in uapi headers.
Change-Id: I15645480e013e79cbcafaac99253368b646b6b11
commit f8461ec54c7f16121e4f60248baa200818caf476
Author: Alexander Grund <flamefire89@gmail.com>
Date: Sun Nov 13 18:05:16 2022 +0100
Use a RegEx to get carrier instead of XML parsing
As we later do literal matches against the lines XML parsing is the
wrong approach as e.g. XML excapes will not be found which causes custom
APNs with e.g. `&` to be ignored, i.e. they will not overwrite the
default ones and will be fully missing from the output file.
Change-Id: I2bc575d4bbdc5d802c5d5b3420ee6b536a5a18fc
commit 05b5f8bb7ae9515f7c3eb1b9aedcd3698fa2cd15
Author: Alexander Grund <flamefire89@gmail.com>
Date: Fri Oct 28 18:28:32 2022 +0200
Include `carrier=` in carrier match string
Avoid random matches for generic carrier names such as `"3"`
Change-Id: I6bd2f3b9268ce2fb4754a170e1c359cb22fb2a60
commit ee2cc8369facd994e2295f2ece90fd9a64147804
Author: Alexander Grund <flamefire89@gmail.com>
Date: Fri Oct 28 17:41:06 2022 +0200
Fix custom_apns script
Removing an element from the list that is currently iterated does not
work. At least it may skip the next element.
Also the handling of duplicate APN names was broken: It would output the
lines containing duplicate APN names times the number of the
duplication, i.e. the exact same line would be duplicated.
So use a `set` for storing apn names.
Change-Id: Id54d245dc935117cd4640ae0f1f30b8608c87459
commit bc97d8d7cc12b8eb5fb94090408eea7af304e958
Author: Erfan Abdi <erfangplus@gmail.com>
Date: Thu Jun 24 07:19:38 2021 +0430
Add double quote in custom APN name check
* This fixes the case of have having APNs with same the name,
such as:
“Sprint EHRPD”
"Sprint EHRPD ota"
“Sprint EHRPD internet”
* But we want to replace only “Sprint EHRPD”, not all matches.
Change-Id: Ic3139c5d73a8c3c8667ac2bc527abc1a85541361
commit b5f796879601a53dce41a0677fefb01e2fa0f379
Author: Julian Veit <claymore1298@gmail.com>
Date: Mon Nov 2 22:17:29 2020 +0100
aicp: adapt Changelog handling in Makefile [2/2]
due the fact google is resetting all env variables, we handle
skipping the Changelog by setting USER_BUILD_NO_CHANGELOG=1 in Makefile.
Also of this, we can't read env. variable $OUT in script directly
anymore, so we add this as an argument to the script.
Same goes for the command date, so we need to add the PATH variable.
Change-Id: Id70bd968e54084d642c7c60b32166d36001510db
commit 389f82c56a6ca052f8ec347617b4f5c01f253f59
Author: Tom Marshall <tdm.code@gmail.com>
Date: Thu Aug 13 07:42:26 2020 -0700
aicp: changelog: Only rebuild changelog when needed, and cleanup
If we have built the changelog on a prior build and it is still up to
date, skip building the changelog again.
In order to detect whether the changelog is up to date, we write a
revisioned manifest. If the manifest exists (from a prior run), it is
not newer than the changelog, and it matches the current repo state,
then the changelog is up to date and we don't need to do anything.
When we do need to write a changelog, we remove the old manifest, write
the changelog, then update the manifest. This ensures that if any repo
command fails, the manifest will not exist and the changelog will be
written again on the next run.
Also do some cleanup:
* Use 'set -e' to detect failure in repo commands.
* Write changelog to $OUT, not the build topdir.
* Exit early when USER_BUILD_NO_CHANGELOG is set.
* Use quotes around variable references.
* Make all local shell variables lower case.
* Do not export variables needlessly.
Finally note that most or all of this could have been done in directly
in the core build system as make rules. But let's leave that change
for another time.
Change-Id: Ib390007cda3f8148e96ceeca23db97bde3fcc15c
commit 85fae7319c35f1dde75f66edf83154b0d7fe35a7
Author: SpiritCroc <dev@spiritcroc.de>
Date: Thu Apr 9 18:08:35 2020 +0200
vendor_aicp: Fix changelog with broken repo forall -p
Change-Id: Ia95cf5103fc7ed665f6cafb3c93f8adaca469d1e
commit 47fc02266f9cb20963567b886027dd1cce1d2ff4
Author: Michele Bono <bono.michele94@gmail.com>
Date: Wed Sep 4 11:58:16 2019 +0200
vendor_aicp: Rework for Android10
Change-Id: I5c4b1b42be11bd1840705edcc9cb41b5781666de
commit afe725436f7be4f81cbda9c26ac652ab8f4a5c8b
Author: Ralf Luther <luther.ralf@gmail.com>
Date: Fri Oct 19 20:35:43 2018 +0200
vendor_aicp: change LCD density custom prop
change gzosp property to default on, when specific dpi is set up.
Change-Id: Iedafe465ff8a9d236c7b43c03f37306e259deeef
commit f08123a1036be7d1f3821af5fac45477d9b7d03a
Author: Akhil Narang <akhilnarang.1999@gmail.com>
Date: Mon Jun 15 20:08:27 2015 +0530
vendor_aicp: build changelog [2/2]
Squash of the following:
vendor: add changelog generator, squisher, opticharger (1/2)
Change-Id: I625ff7a0c3b08d0b3cf5eaa73e9110121d94769f
Signed-off-by: Akhil Narang <akhilnarang.1999@gmail.com>
Remove squisher and opticharger
Do edits for changelog only
Change-Id: I9f1660ea5182bdd51abef442c38f1729a6f73be5
vendor: only populate changelog for RELEASE/NIGHTLY builds.
Change-Id: I2415b17bf2bb4994d55f615414f3dd7bb3b6f307
vendor: modified changlog to use sh style command, not bash.
Change-Id: I5e080d1527d31cf846c22665602f6924222cd7b7
changelog: remove unnecessary l.o.c
*this suppresses the "mv: same path blah blah" warning during build.
Change-Id: Ibbae6261a04a7fcd0b58cac4110ae5231d03cbc4
vendor_aicp: Change to changelog
1.- We dont need Color
Change-Id: I4b29fc670c3923a5357cd0aff3fff8c1848705c0
Changelog: Show on terminal if skipped
Change-Id: I7f00de49df6c17c75727ba47627c31e7fa6ceee1
vendor: changelog: fix bash quirk
Change-Id: I2e8ad017789bdc6b69a11592bb7aff1f9efbb730
vendor: changelog: proper changelog creation handling
avoid this exeption, if env variable USER_BUILD_NO_CHANGELOG isn't set:
./vendor/aicp/tools/changelog: 20: [: Illegal number:
Change-Id: I6dab7b0e7a7d2993240a16d87083752a37f0c8a0
commit 3e86bfbdaf7e1b5c522a33e844fd4823c91439c7
Author: SpiritCroc <dev@spiritcroc.de>
Date: Wed Oct 3 11:22:37 2018 +0200
vendor/aicp: AICPfy
Change-Id: If1aea5e4f84f7cfa84b80b939f67c9137297a421
commit 33193269c3ab80aed338fde72d99948716528a99
Author: theringmaster <gzroms@hotmail.com>
Date: Mon Sep 25 11:31:15 2017 -0400
Put roomservice in the correct folder
commit 21612f10a3d4910a1c442defa765b4732af65fc9
Author: theringmaster <gzroms@hotmail.com>
Date: Mon Sep 25 11:29:20 2017 -0400
Make roomservice executable
commit 761bb24445eccd3bb6c9acdae4df9a257870a4ef
Author: theringmaster <gzroms@hotmail.com>
Date: Mon Sep 25 11:02:50 2017 -0400
Add roomservice
commit 8fa96782bc3404d278ba5bdd3f7d171b4411f107
Author: Prema Chand Alugu <premaca@gmail.com>
Date: Tue Aug 22 17:55:38 2017 +0530
Start Gzosp vendor
Change-Id: Ia7b08b942d146d8c75282081a5a7d9118ade387f
| -rwxr-xr-x | tools/changelog | 79 | ||||
| -rwxr-xr-x | tools/custom_apns.py | 61 |
2 files changed, 140 insertions, 0 deletions
diff --git a/tools/changelog b/tools/changelog new file mode 100755 index 000000000..0749a6c81 --- /dev/null +++ b/tools/changelog @@ -0,0 +1,79 @@ +#!/bin/sh + +export PATH=/bin:$BIN:$PATH +set -e + +usage() { + cat <<EOM + Usage: $(basename $0) <Path to output directory, typically \$OUT variable> +EOM + exit 1 +} + +[ $# -ne 1 ] && usage +# set path to output directory, typical $OUT variable +OUT="$1" + +if [ ! -d "$OUT" ];then + echo "specified OUT-directory: $OUT does not exist!" + exit 1 +fi + +# Store the main manifest and changelog in $OUT. +# Copy the main manifest to the target system/etc. +manifest="$OUT/manifest.xml" +changelog="$OUT/Changelog.txt" +system_changelog="$OUT/system/etc/Changelog.txt" + +repo manifest -r > "$manifest.tmp" +if [ -f "$manifest" -a ! "$manifest" -nt "$changelog" ]; then + diff=0 + cmp "$manifest" "$manifest.tmp" >/dev/null 2>&1 || diff=1 + if [ $diff -eq 0 ]; then + # The changelog is up to date. + # Cleanup and copy it over to system. + echo ${buildppl}"Changelog up to date"${txtrst} + rm -f "$manifest.tmp" + mkdir -p $(dirname "$system_changelog") + cp "$changelog" "$system_changelog" + exit 0 + fi +fi + +# Print something to build output +echo ${bldppl}"Generating changelog..."${txtrst} + +# Delete the existing manifest so that if we fail, the next build +# will not think it is up to date. +rm -f "$manifest" + +rm -f "$changelog" +touch "$changelog" +for i in $(seq 1 10); +do + after_date=`date --date="$i days ago" +%m-%d-%Y` + k=$((i - 1)) + until_date=`date --date="$k days ago" +%m-%d-%Y` + + # Line with after --- until was too long for a small ListView + echo "====================" >> "$changelog" + echo " $until_date" >> "$changelog" + echo "====================" >> "$changelog" + echo >> "$changelog" + + # Cycle through every repo to find commits between 2 dates + current_path="$(realpath `pwd`)" + + repo forall -c "GIT_LOG=\`git log --oneline --after=$after_date --until=$until_date\` ; if [ ! -z \"\$GIT_LOG\" ]; then printf '\n * '; realpath \`pwd\` | sed 's|^$current_path/||' ; echo \"\$GIT_LOG\"; fi" >> "$changelog" + echo >> "$changelog" +done + +sed -i 's/^project/ */g' "$changelog" + +# Now that we have successfully generated the changelog, move the +# manifest into position and copy the changelog to the target. +mv "$manifest.tmp" "$manifest" +mkdir -p $(dirname "$system_changelog") +cp "$changelog" "$system_changelog" + +exit 0 diff --git a/tools/custom_apns.py b/tools/custom_apns.py new file mode 100755 index 000000000..d8c1c7ad5 --- /dev/null +++ b/tools/custom_apns.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# +# Copyright (C) 2018 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import re +import sys + +def main(argv): + reload(sys) + sys.setdefaultencoding('utf8') + original_file = 'vendor/aicp/prebuilt/common/etc/apns-conf.xml' + + if len(argv) == 3: + output_file_path = argv[1] + custom_override_file = argv[2] + else: + raise ValueError("Wrong number of arguments %s" % len(argv)) + + custom_apn_names = set() + with open(custom_override_file, 'r') as f: + for line in f: + custom_apn_names.add(re.search(r'carrier="[^"]+"', line).group(0)) + + with open(original_file, 'r') as input_file: + with open(output_file_path, 'w') as output_file: + for line in input_file: + found_custom_apns = set() + for apn in custom_apn_names: + if apn in line: + with open(custom_override_file, 'r') as custom_file: + for override_line in custom_file: + if apn in override_line: + output_file.write(override_line) + found_custom_apns.add(apn) + if found_custom_apns: + custom_apn_names -= found_custom_apns + else: + if "</apns>" in line: + if custom_apn_names: + for apn in custom_apn_names: + with open(custom_override_file, 'r') as custom_file: + for override_line in custom_file: + if apn in override_line: + output_file.write(override_line) + output_file.write(line) + +if __name__ == '__main__': + main(sys.argv) |
