Skip to content
This repository was archived by the owner on Nov 10, 2024. It is now read-only.

Commit 1bf1031

Browse files
committed
service fix and device_prefs
1 parent 17daa8a commit 1bf1031

19 files changed

Lines changed: 441 additions & 130 deletions

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
**2022-03-13 (22031300)**
2+
- Made a device_prefs directory where all the device preferences are stored and used by both the service and installer.
3+
- Fixed a bug where [busybox](https://github.com/topjohnwu/Magisk/issues/5540#issuecomment-1059940824) could not read from a string (creating temp file instead). Which resulted in a fix of the [service.sh](https://github.com/Pixel-Props/pixel.features/blob/main/system/product/etc/sysconfig/service.sh) script.
4+
- The installer now backs up Utils to the root MODPATH as it is used by the service.
5+
- If does not have package the package is removed from the module.
6+
17
**2022-03-03 (22030300)**
28
- Fixed [insert_gms_features()](https://github.com/Pixel-Props/pixel.features/blob/main/addon/SQLite3/install.sh) where variables were not defined which caused the service to not install flags properly.
39
- Added more flags to the [service.sh](https://github.com/Pixel-Props/pixel.features/blob/main/system/product/etc/sysconfig/service.sh)

common/adaptive_audio.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/system/bin/sh
22

3-
packageName="com.google.android.platform.device_personalization_services"
43
download_size "$MusicDetector_download" file_size
54

65
if [ -f "$MusicDetector_location" ] &&
@@ -15,10 +14,6 @@ if [ -f "$MusicDetector_location" ] &&
1514
tar -xf "$MusicDetector_location" -C "$MODPATH/system/product/etc/"
1615
rm "$MusicDetector_location"
1716

18-
# Adding flags
19-
ui_print ' [+] Adding flags...'
20-
insert_gms_features "FlagOverrides" $packageName 0 null 1 null null 1 "Echo__enable_headphones_suggestions_from_agsa" "Echo__smartspace_enable_doorbell" "Echo__smartspace_enable_earthquake_alert_predictor" "Echo__smartspace_enable_echo_settings" "Echo__smartspace_enable_light_predictor" "Echo__smartspace_enable_paired_device_predictor" "Echo__smartspace_enable_safety_check_predictor" "NowPlaying__ambient_music_on_demand_enabled" "NowPlaying__cloud_api_allowed" "NowPlaying__enable_usage_fa" "NowPlaying__favorites_enabled" "NowPlaying__handle_ambient_music_results_with_history" "NowPlaying__youtube_export_enabled" "Overview__enable_lens_r_overview_long_press" "Overview__enable_lens_r_overview_select_mode" "Overview__enable_lens_r_overview_translate_action"
21-
2217
# Done
2318
ui_print " [✓] Installed"
2419
ui_print ''

common/addon/Utils/install.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ install_package() {
4545
rm -rf "$2"
4646
}
4747

48+
grep_prop() {
49+
REGEX="s/^$1=//p"
50+
shift
51+
FILES=$*
52+
[ -z "$FILES" ] && FILES='/system/build.prop'
53+
cat $FILES 2>/dev/null | dos2unix | sed -n "$REGEX" | head -n 1
54+
}
55+
4856
# Get the download size of a website using wget
4957
download_size() {
5058
[ "$1" ] && url=$1 || url="https://example.com"

common/device_personalization.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ if [ "$API" -ge 31 ]; then
77
if has_package "$packageName"; then
88
ui_print " [?] Android System Intelligence is already installed on this device."
99
ui_print ''
10+
rm -rf "$MODPATH"/system/product/priv-app/DevicePersonalization*
1011
else
1112
ui_print " [?] Android System Intelligence is not installed on this device."
1213
fi

common/gboard.sh

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
#!/system/bin/sh
22

3-
packageName="com.google.android.inputmethod.latin#com.google.android.inputmethod.latin"
4-
53
if selector "Enable Pixel GBoard Features ?" "$useRecommendedSettings" "Enable" "Disable"; then
6-
ui_print ' [+] Adding flags...'
7-
insert_gms_features "FlagOverrides" $packageName 0 null 1 null null 1 "crank_trigger_decoder_inline_completion_first" "crank_trigger_decoder_inline_prediction_first" "enable_core_typing_experience_indicator_on_candidates" "enable_core_typing_experience_indicator_on_composing_text" "enable_email_provider_completion" "enable_floating_keyboard_v2" "enable_inline_suggestions_on_client_side" "enable_inline_suggestions_on_decoder_side" "enable_inline_suggestions_space_tooltip" "enable_inline_suggestions_tooltip_v2" "enable_matched_predictions_as_inline_from_crank_cifg" "enable_multiword_predictions_as_inline_from_crank_cifg" "enable_multiword_predictions_from_user_history" "enable_multiword_suggestions_as_inline_from_crank_cifg" "enable_next_generation_hwr_support" "enable_nga" "enable_single_word_predictions_as_inline_from_crank_cifg" "enable_single_word_suggestions_as_inline_from_crank_cifg" "enable_user_history_predictions_as_inline_from_crank_cifg" "nga_enable_mic_button_when_dictation_eligible" "nga_enable_mic_onboarding_animation" "nga_enable_spoken_emoji_sticky_variant" "nga_enable_sticky_mic" "nga_enable_undo_delete" "silk_on_all_devices" "silk_on_all_pixel"
8-
insert_gms_features "FlagOverrides" $packageName 0 4 null null null 1 "inline_suggestion_experiment_version"
9-
insert_gms_features "FlagOverrides" $packageName 0 1 null null null 1 "user_history_learning_strategies"
10-
11-
# Done
12-
ui_print " [✓] Installed"
4+
ui_print ' [+] Flags kept...'
135
ui_print ''
146
else
15-
ui_print " [~] Ignoring"
7+
ui_print " [~] Flags removed from module..."
168
ui_print ''
9+
rm -rf "$MODPATH"/device_prefs/*/gboard.ini
1710
fi

common/google_dialer.sh

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
#!/system/bin/sh
22

3-
packageName="com.google.android.dialer"
4-
53
if selector "Enable Pixel Google Dialer Features ?" "$useRecommendedSettings" "Enable" "Disable"; then
6-
ui_print ' [+] Adding flags...'
7-
insert_gms_features "FlagOverrides" $packageName 0 null 1 null null 1 "CallLogInformationArchitecture__enable_call_log_information_architecture" "CallRecording__enable_call_recording_for_fi" "G__always_enable_new_call_log_framework_and_fragment" "G__answer_false_touch_detection_enabled" "G__are_embeddings_jobs_enabled" "G__bypass_revelio_roaming_check" "G__call_screen_audio_listener_enabled" "G__config_caller_id_enabled" "G__enable_after_call_spam_blocking_promo" "G__enable_atlas" "G__enable_call_recording" "G__enable_call_screen_audio_stitching" "G__enable_call_screen_data_in_call_log" "G__enable_call_screen_saving_audio" "G__enable_duplicates_promo_v2_ui" "G__enable_embedding_spam_revelio" "G__enable_embedding_spam_revelio" "G__enable_new_voicemail_tab" "G__enable_patronus_spam" "G__enable_pendingcall" "G__enable_phone_number_classification_spam" "G__enable_reject_embedding_spam_calls" "G__enable_revelio" "G__enable_revelio_on_bluetooth" "G__enable_revelio_on_wired_headset" "G__enable_revelio_r_api" "G__enable_rtt_visibility_setting_part2" "G__enable_spam_blocking_promo" "G__enable_speak_easy_is_spam_survey" "G__enable_speakeasy_details" "G__enable_video_share" "G__enable_wifi_calling_icons_all_carriers" "G__force_disable_enriched_call" "G__force_within_call_recording_geofence_value" "G__force_within_crosby_geofence_value" "G__is_call_log_item_anim_null" "G__new_call_log_fragment_enabled" "G__new_voicemail_fragment_enabled" "G__show_call_screen_recording_player_in_call_log" "G__speak_easy_bypass_locale_check" "G__speak_easy_enable_listen_in_button" "G__speak_easy_enabled" "G__speak_easy_use_soda_asr" "G__use_call_recording_geofence_overrides" "G__voicemail_change_greeting_enabled" "G_answer_proximity_sensor_enabled" "G_call_screen_audio_listener_enabled" "Scooby__are_spam_jobs_enabled" "Scooby__enable_same_prefix_logging" "atlas_use_soda_for_transcription" "enable_android_s_notifications" "enable_atlas_on_tidepods_voice_screen" "enable_dialer_hold_handling" "enable_dialpad_v2_ux" "enable_hold_detection" "enable_precall_dialpad_v2" "enable_revelio_transcript" "enable_smart_reply" "enable_stir_shaken_call_log" "enable_theme_pushing" "enable_video_call_landscape" "enable_video_handover_dialog" "enable_voice_autofill" "enable_xatu" "enable_xatu_music_detection" "force_flip_to_silence" "show_atlas_hold_for_me_confirmation_dialog"
8-
insert_gms_features "FlagOverrides" $packageName 0 null 0 null null 1 "G__enable_pride_month_celebration" "G__enable_primes" "G__enable_primes_crash_metric" "G__enable_primes_timer_metric" "G__enable_tidepods_video" "enable_profile_photo_for_on_hold_video_call"
9-
insert_gms_features "FlagOverrides" $packageName 0 null null null "" 1 "CallRecording__call_recording_countries" "CallRecording__call_recording_countries_with_built_in_audio_file" "CallRecording__call_recording_force_enable_built_in_audio_file_countries" "CallRecording__call_recording_force_enable_tts_countries" "CallRecording__crosby_countries" "G__assisted_dialing_csv_country_codes"
10-
11-
# Done
12-
ui_print " [✓] Installed"
4+
ui_print ' [+] Flags kept...'
135
ui_print ''
146
else
15-
ui_print " [~] Removing from module"
7+
ui_print " [~] Flags removed from module..."
168
ui_print ''
9+
rm -rf "$MODPATH"/device_prefs/*/google_dialer.ini
1710
fi

common/nga_resources.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ if [ "$API" -ge 31 ]; then
77
if has_package "$packageName"; then
88
ui_print " [?] NgaResources is already installed on this device."
99
ui_print ''
10+
rm -rf "$MODPATH"/system/product/app/NgaResources*
1011
else
1112
ui_print " [?] NgaResources is not installed on this device."
1213
fi

common/pixel_wallpapers.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ if [ "$API" -ge 31 ]; then
77
if has_package "$packageName"; then
88
ui_print " [?] PixelWallpapers2021 is already installed on this device."
99
ui_print ''
10+
rm -rf "$MODPATH"/system/product/app/PixelWallpapers2021*
1011
else
1112
ui_print " [?] PixelWallpapers2021 is not installed on this device."
1213
fi

common/unlimited_gphoto.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
ui_print "[?+] Keeping *breaks* Unlimited GPhoto."
44
ui_print "[?-] Removing *removes* some new features."
5-
if selector "keep 2020 and later sysconfigs ?" null "Keep" "Remove"; then
5+
if selector "Keep 2020 and later sysconfigs ?" null "Keep" "Remove"; then
66
ui_print " [+] Keeping 2020 and later pixel experience xml"
77
ui_print ''
88
else

customize.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#!/system/bin/sh
22

33
# Running installer
4-
[ -f "$MODPATH/common/install.sh" ] && . "$MODPATH/common/install.sh"
4+
[ -f "$MODPATH/common/install.sh" ] && . "$MODPATH"/common/install.sh
55

6-
# Cleanup
7-
[ -d "$MODPATH/common" ] && rm -rf "$MODPATH/common"
6+
# Cleanup common install files
7+
[ -d "$MODPATH/common" ] && rm -rf "$MODPATH"/common/*.sh
88

99
# Fixing permission
1010
chmod 0644 "$MODPATH/system/product/app/*/*.apk"
1111

1212
# Remove comments from files and place them, add blank line to end if not already present
1313
for file in $(find "$MODPATH" -type f -name "*.sh" -o -name "*.prop" -o -name "*.rule"); do
1414
[ -f "$file" ] && {
15-
sed -i -e "/#/d" -e "/^ *$/d" "$file"
15+
sed -i -e "/^[[:blank:]]*#/d" -e "/^ *$/d" "$file"
1616
[ "$(tail -1 "$file")" ] && echo "" >>"$file"
1717
}
1818
done

0 commit comments

Comments
 (0)