Generic01

Untitled

Apr 11th, 2021
643
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DEVICE=$1
  2. ROMDIR=~/$2
  3. MAINTAINER=$3
  4. MAINTAINER_URL=$4
  5. FORUM_URL=$5
  6.  
  7. # Ensures that mandatory parameters are entered
  8. if [ $# -lt 5 ]; then
  9.     echo "Missing mandatory parameters"
  10.     exit 1
  11. fi
  12.  
  13. cd $ROMDIR
  14. DATETIME=$(grep "org.pixelexperience.build_date_utc=" out/target/product/$DEVICE/system/build.prop | cut -d "=" -f 2)
  15. FILENAME=$(find out/target/product/$DEVICE/PixelExperience*.zip | cut -d "/" -f 5)
  16. ID=$(md5sum out/target/product/$DEVICE/PixelExperience*.zip | cut -d " " -f 1)
  17. FILEHASH=$ID
  18. SIZE=$(wc -c out/target/product/$DEVICE/PixelExperience*.zip | awk '{print $1}')
  19. URL="https://sourceforge.net/projects/pixelextended/files/$DEVICE/$FILENAME/download"
  20. VERSION="10"
  21. DONATE_URL="https://www.paypal.me/aryan65"
  22. WEBSITE_URL="https://pixelextended.me/"
  23. NEWS_URL="https:\/\/t.me\/pexupdates"
  24. JSON_FMT='{\n"error":false,\n"filename": %s,\n"datetime": %s,\n"size":%s, \n"url":"%s", \n"filehash":"%s", \n"version": "%s", \n"id": "%s",\n"donate_url": "%s",\n"website_url":"%s",\n"news_url":"%s",\n"maintainer":"%s",\n"maintainer_url":"%s",\n"forum_url":"%s"\n}'
  25. printf "$JSON_FMT" "$FILENAME" "$DATETIME" "$SIZE" "$URL" "$FILEHASH" "$VERSION" "$ID" "$DONATE_URL" "$WEBSITE_URL" "$NEWS_URL" "$MAINTAINER" "$MAINTAINER_URL" "$FORUM_URL" > $ROMDIR/OTA/builds/$DEVICE.json
  26. echo $ROMDIR/OTA/builds/$DEVICE.json file created
  27.  
  28. BUILD_DATE=$(echo $FILENAME | cut -d "-" -f 3)
  29. BUILD_YEAR=${BUILD_DATE:0:4}
  30. BUILD_MONTH=${BUILD_DATE:4:2}
  31. BUILD_DAY=${BUILD_DATE:6:2}
  32. CHANGELOG_DATE=$(echo $BUILD_YEAR/$BUILD_MONTH/$BUILD_DAY)
  33. CHANGELOG="Changelog - %s\n\n"
  34. printf "$CHANGELOG_DATE" > $ROMDIR/OTA/changelogs/$DEVICE/$FILENAME.txt
  35. echo $ROMDIR/OTA/changelogs/$DEVICE/$FILENAME.txt file created
  36.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×