Initial commit

This commit is contained in:
Rainer Killinger
2021-12-08 17:26:11 +01:00
commit 3afeb0e936
24 changed files with 668 additions and 0 deletions

View File

@@ -0,0 +1 @@
json_key_file("../../../playstore_api_key.json") # Don't Change

View File

@@ -0,0 +1,34 @@
# This file contains the fastlane.tools configuration for Android
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
default_platform(:android)
platform :android do
desc "Runs all the tests"
lane :test do
gradle(task: "test")
end
desc "Submit a new Beta Build to Crashlytics Beta"
lane :beta do
gradle(task: "clean assembleRelease")
end
desc "Deploy a new version to the Google Play"
lane :release do
gradle(task: "clean assembleRelease")
#upload_to_play_store
end
end

View File

View File

@@ -0,0 +1,38 @@
# This file contains the fastlane.tools configuration for iOS
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
default_platform(:ios)
platform :ios do
desc "Push a new release build to the App Store"
lane :release do
set_info_plist_value(
path: "App/Info.plist",
key: "NSLocationAlwaysAndWhenInUseUsageDescription",
value: ENV['LOCATION_USAGE_DESCRIPTION']
)
update_build_settings(
use_automatic_signing: false,
path: "App.xcodeproj",
team_id: ENV['TEAM_ID'],
bundle_identifier: ENV['IOS_APP_IDENTIFIER'],
profile_name: ENV['PROVISIONING_PROFILE_NAME'],
entitlements_file_path: "App/App.entitlements"
)
build_app(workspace: "App.xcworkspace", scheme: "App")
# upload_to_app_store(skip_metadata: true, skip_screenshots: true)
end
end

View File

@@ -0,0 +1,213 @@
require 'xcodeproj'
module Fastlane
module Actions
class UpdateBuildSettingsAction < Action
def self.run(params)
FastlaneCore::PrintTable.print_values(config: params, title: "Summary for code signing settings")
path = params[:path]
path = File.join(File.expand_path(path), "project.pbxproj")
project = Xcodeproj::Project.open(params[:path])
UI.user_error!("Could not find path to project config '#{path}'. Pass the path to your project (not workspace)!") unless File.exist?(path)
UI.message("Updating the Automatic Codesigning flag to #{params[:use_automatic_signing] ? 'enabled' : 'disabled'} for the given project '#{path}'")
unless project.root_object.attributes["TargetAttributes"]
UI.user_error!("Seems to be a very old project file format - please open your project file in a more recent version of Xcode")
return false
end
changed_targets = []
changed_build_configurations = []
project.targets.each do |target|
if params[:targets]
unless params[:targets].include?(target.name)
UI.important("Skipping #{target.name} not selected (#{params[:targets].join(',')})")
next
end
end
target.build_configurations.each do |config|
if params[:build_configurations]
unless params[:build_configurations].include?(config.name)
UI.important("Skipping #{config.name} not selected (#{params[:build_configurations].join(',')})")
next
end
end
style_value = params[:use_automatic_signing] ? 'Automatic' : 'Manual'
set_build_setting(config, "CODE_SIGN_STYLE", style_value)
if params[:team_id]
set_build_setting(config, "DEVELOPMENT_TEAM", params[:team_id])
UI.important("Set Team id to: #{params[:team_id]} for target: #{target.name} for build configuration: #{config.name}")
end
if params[:code_sign_identity]
set_build_setting(config, "CODE_SIGN_IDENTITY", params[:code_sign_identity])
UI.important("Set Code Sign identity to: #{params[:code_sign_identity]} for target: #{target.name} for build configuration: #{config.name}")
end
if params[:profile_name]
set_build_setting(config, "PROVISIONING_PROFILE_SPECIFIER", params[:profile_name])
UI.important("Set Provisioning Profile name to: #{params[:profile_name]} for target: #{target.name} for build configuration: #{config.name}")
end
if params[:entitlements_file_path]
set_build_setting(config, "CODE_SIGN_ENTITLEMENTS", params[:entitlements_file_path])
UI.important("Set Entitlements file path to: #{params[:entitlements_file_path]} for target: #{target.name} for build configuration: #{config.name}")
end
# Since Xcode 8, this is no longer needed, you simply use PROVISIONING_PROFILE_SPECIFIER
if params[:profile_uuid]
set_build_setting(config, "PROVISIONING_PROFILE", params[:profile_uuid])
UI.important("Set Provisioning Profile UUID to: #{params[:profile_uuid]} for target: #{target.name} for build configuration: #{config.name}")
end
if params[:bundle_identifier]
set_build_setting(config, "PRODUCT_BUNDLE_IDENTIFIER", params[:bundle_identifier])
UI.important("Set Bundle identifier to: #{params[:bundle_identifier]} for target: #{target.name} for build configuration: #{config.name}")
end
changed_build_configurations << config.name
end
changed_targets << target.name
end
project.save
if changed_targets.empty?
UI.important("None of the specified targets has been modified")
UI.important("available targets:")
project.targets.each do |target|
UI.important("\t* #{target.name}")
end
else
UI.success("Successfully updated project settings to use Code Sign Style = '#{params[:use_automatic_signing] ? 'Automatic' : 'Manual'}'")
UI.success("Modified Targets:")
changed_targets.each do |target|
UI.success("\t * #{target}")
end
UI.success("Modified Build Configurations:")
changed_build_configurations.each do |name|
UI.success("\t * #{name}")
end
end
params[:use_automatic_signing]
end
def self.set_build_setting(configuration, name, value)
# Iterate over any keys that start with this name
# This will also set keys that have filtering like [sdk=iphoneos*]
keys = configuration.build_settings.keys.select { |key| key.to_s.match(/#{name}.*/) }
keys.each do |key|
configuration.build_settings[key] = value
end
# Explicitly set the key with value if keys don't exist
configuration.build_settings[name] = value
end
def self.description
"Configures Xcode's Codesigning options"
end
def self.details
"Configures Xcode's Codesigning options of all targets in the project"
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :path,
env_name: "FL_PROJECT_SIGNING_PROJECT_PATH",
description: "Path to your Xcode project",
code_gen_sensitive: true,
default_value: Dir['*.xcodeproj'].first,
default_value_dynamic: true,
verify_block: proc do |value|
UI.user_error!("Path is invalid") unless File.exist?(File.expand_path(value))
end),
FastlaneCore::ConfigItem.new(key: :use_automatic_signing,
env_name: "FL_PROJECT_USE_AUTOMATIC_SIGNING",
description: "Defines if project should use automatic signing",
type: Boolean,
default_value: false),
FastlaneCore::ConfigItem.new(key: :team_id,
env_name: "FASTLANE_TEAM_ID",
optional: true,
description: "Team ID, is used when upgrading project"),
FastlaneCore::ConfigItem.new(key: :targets,
env_name: "FL_PROJECT_SIGNING_TARGETS",
optional: true,
type: Array,
description: "Specify targets you want to toggle the signing mech. (default to all targets)"),
FastlaneCore::ConfigItem.new(key: :build_configurations,
env_name: "FL_PROJECT_SIGNING_BUILD_CONFIGURATIONS",
optional: true,
type: Array,
description: "Specify build_configurations you want to toggle the signing mech. (default to all configurations)"),
FastlaneCore::ConfigItem.new(key: :code_sign_identity,
env_name: "FL_CODE_SIGN_IDENTITY",
description: "Code signing identity type (iPhone Developer, iPhone Distribution)",
optional: true),
FastlaneCore::ConfigItem.new(key: :entitlements_file_path,
env_name: "FL_CODE_SIGN_ENTITLEMENTS_FILE_PATH",
description: "Path to your entitlements file",
optional: true),
FastlaneCore::ConfigItem.new(key: :profile_name,
env_name: "FL_PROVISIONING_PROFILE_SPECIFIER",
description: "Provisioning profile name to use for code signing",
optional: true),
FastlaneCore::ConfigItem.new(key: :profile_uuid,
env_name: "FL_PROVISIONING_PROFILE",
description: "Provisioning profile UUID to use for code signing",
optional: true),
FastlaneCore::ConfigItem.new(key: :bundle_identifier,
env_name: "FL_APP_IDENTIFIER",
description: "Application Product Bundle Identifier",
optional: true)
]
end
def self.output
end
def self.example_code
[
' # manual code signing
update_code_signing_settings(
use_automatic_signing: false,
path: "demo-project/demo/demo.xcodeproj"
)',
' # automatic code signing
update_code_signing_settings(
use_automatic_signing: true,
path: "demo-project/demo/demo.xcodeproj"
)',
' # more advanced manual code signing
update_code_signing_settings(
use_automatic_signing: true,
path: "demo-project/demo/demo.xcodeproj",
team_id: "QABC123DEV",
bundle_identifier: "com.demoapp.QABC123DEV",
profile_name: "Demo App Deployment Profile",
entitlements_file_path: "Demo App/generated/New.entitlements"
)'
]
end
def self.category
:code_signing
end
def self.return_value
"The current status (boolean) of codesigning after modification"
end
def self.authors
["mathiasAichinger", "hjanuschka", "p4checo", "portellaa", "aeons", "att55", "abcdev"]
end
def self.is_supported?(platform)
[:ios, :mac].include?(platform)
end
end
end
end

35
static/scripts/android.sh Executable file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/env sh
DEFAULT_APP_LINK_URL="your.deep.link.host.tld"
APP_LINK_URL="${APP_LINK_URL:-$DEFAULT_APP_LINK_URL}"
if [ -n "$(xmlstarlet sel -T -t -v "/manifest/application/activity[intent-filter/@android:autoVerify='true']" app/android/app/src/main/AndroidManifest.xml)" ]; then
echo "Deep link capability already defined in AndroidManifest.xml"
else
echo "Adding deep link capability to AndroidManifest.xml"
xmlstarlet edit -L -s /manifest/application/activity -t elem -n tmpElement -v "" \
-i //tmpElement -t attr -n "android:autoVerify" -v "true" \
-r //tmpElement -v intent-filter \
app/android/app/src/main/AndroidManifest.xml
xmlstarlet edit -L -s "/manifest/application/activity/intent-filter[@android:autoVerify='true']" -t elem -n tmpElement -v "" \
-i //tmpElement -t attr -n "android:name" -v "android.intent.action.VIEW" \
-r //tmpElement -v action \
app/android/app/src/main/AndroidManifest.xml
xmlstarlet edit -L -s "/manifest/application/activity/intent-filter[@android:autoVerify='true']" -t elem -n tmpElement -v "" \
-i //tmpElement -t attr -n "android:name" -v "android.intent.action.DEFAULT" \
-r //tmpElement -v category \
app/android/app/src/main/AndroidManifest.xml
xmlstarlet edit -L -s "/manifest/application/activity/intent-filter[@android:autoVerify='true']" -t elem -n tmpElement -v "" \
-i //tmpElement -t attr -n "android:name" -v "android.intent.action.BROWSABLE" \
-r //tmpElement -v category \
app/android/app/src/main/AndroidManifest.xml
xmlstarlet edit -L -s "/manifest/application/activity/intent-filter[@android:autoVerify='true']" -t elem -n tmpElement -v "" \
-i //tmpElement -t attr -n "android:scheme" -v "https" \
-i //tmpElement -t attr -n "android:host" -v "$APP_LINK_URL" \
-r //tmpElement -v data \
app/android/app/src/main/AndroidManifest.xml
fi

18
static/scripts/clone_app.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env sh
# get semantical versioning string linke 2.0.0 (if $1 is v2.0.0) or $1
DEFAULT_VERSION="0.0.0"
APP_VERSION="${APP_VERSION:-$DEFAULT_VERSION}"
if echo -n $1 | grep -Eq 'v[0-9]+\.[0-9]+\.[0-9]+'; then
APP_VERSION=$(echo -n "$1" | cut -c 2-);
else
APP_VERSION=$1;
fi
if [ "$APP_VERSION" = "0.0.0" ]; then
echo "Unsupported app version was set!"
return 1
fi
git clone --depth 1 --branch $APP_VERSION https://gitlab.com/openstapps/app.git app

35
static/scripts/ionic.sh Executable file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/env sh
DEFAULT_APP_NAME="Open StApps"
DEFAULT_APP_DISPLAY_NAME="StApps"
DEFAULT_APP_ID="de.any_school.app"
APP_NAME="${APP_NAME:-$DEFAULT_APP_NAME}"
APP_DISPLAY_NAME="${APP_DISPLAY_NAME:-$DEFAULT_APP_DISPLAY_NAME}"
APP_ID="${APP_ID:-$DEFAULT_APP_ID}"
APP_VERSION=$(jq '.version' app/package.json)
# ionic config
cat app/ionic.config.json | jq '.name = $newName' --arg newName "$APP_NAME" > tmp.$$.json && mv tmp.$$.json app/ionic.config.json
# capacitor config
awk "/appName:.*,/ && !done { gsub(/appName:.*,/, \"appName: '$APP_NAME',\"); done=1}; 1" app/capacitor.config.ts > tmp.$$.json && mv tmp.$$.json app/capacitor.config.ts
awk "/appId:.*,/ && !done { gsub(/appId:.*,/, \"appId: '$APP_ID',\"); done=1}; 1" app/capacitor.config.ts > tmp.$$.json && mv tmp.$$.json app/capacitor.config.ts
# cordova config
xmlstarlet edit -L --update "/widget/@id" --value "$APP_ID" app/config.xml
xmlstarlet edit -L --update "/widget/@version" --value "$APP_VERSION" app/config.xml
xmlstarlet edit -L -N x="http://www.w3.org/ns/widgets" --update "//x:name" --value "$APP_NAME" app/config.xml
if [ -n $(xmlstarlet sel -N x="http://www.w3.org/ns/widgets" -T -t -v "//x:name[@short]" app/config.xml) ]; then
#insert
xmlstarlet edit -L -N x="http://www.w3.org/ns/widgets" -s "//x:name" -t attr -n "short" -v "$APP_DISPLAY_NAME" app/config.xml
else
#update
xmlstarlet edit -L -N x="http://www.w3.org/ns/widgets" --update "//x:name[@short]" -v "$APP_DISPLAY_NAME" app/config.xml
fi
# environment config
awk "/backend_url:.*,/ && !done { gsub(/backend_url:.*,/, \"backend_url: '$BACKEND_URL',\"); done=1}; 1" app/src/environments/environment.prod.ts > tmp.$$.json && mv tmp.$$.json app/src/environments/environment.prod.t
awk "/backend_version:.*,/ && !done { gsub(/backend_version:.*,/, \"backend_version: '$BACKEND_VERSION',\"); done=1}; 1" app/src/environments/environment.prod.t > tmp.$$.json && mv tmp.$$.json app/src/environments/environment.prod.t

9
static/scripts/ios.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env sh
DEFAULT_APP_LINK_URL="your.deep.link.host.tld"
APP_LINK_URL="${APP_LINK_URL:-$DEFAULT_APP_LINK_URL}"
ENTITLEMENTS_FILE="app/ios/App/App/App.entitlements"
/usr/libexec/PlistBuddy -c "Delete :com.apple.developer.associated-domains string $APP_LINK_URL" $ENTITLEMENTS_FILE
/usr/libexec/PlistBuddy -c "Add :com.apple.developer.associated-domains array" $ENTITLEMENTS_FILE
/usr/libexec/PlistBuddy -c "Add :com.apple.developer.associated-domains:0 string $APP_LINK_URL" $ENTITLEMENTS_FILE