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

Commit

Permalink
service fix and device_prefs
Browse files Browse the repository at this point in the history
  • Loading branch information
0x11DFE committed Mar 13, 2022
1 parent 17daa8a commit 1bf1031
Show file tree
Hide file tree
Showing 19 changed files with 441 additions and 130 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
**2022-03-13 (22031300)**
- Made a device_prefs directory where all the device preferences are stored and used by both the service and installer.
- 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.
- The installer now backs up Utils to the root MODPATH as it is used by the service.
- If does not have package the package is removed from the module.

**2022-03-03 (22030300)**
- 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.
- Added more flags to the [service.sh](https://github.com/Pixel-Props/pixel.features/blob/main/system/product/etc/sysconfig/service.sh)
Expand Down
5 changes: 0 additions & 5 deletions common/adaptive_audio.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/system/bin/sh

packageName="com.google.android.platform.device_personalization_services"
download_size "$MusicDetector_download" file_size

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

# Adding flags
ui_print ' [+] Adding flags...'
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"

# Done
ui_print " [✓] Installed"
ui_print ''
Expand Down
8 changes: 8 additions & 0 deletions common/addon/Utils/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ install_package() {
rm -rf "$2"
}

grep_prop() {
REGEX="s/^$1=//p"
shift
FILES=$*
[ -z "$FILES" ] && FILES='/system/build.prop'
cat $FILES 2>/dev/null | dos2unix | sed -n "$REGEX" | head -n 1
}

# Get the download size of a website using wget
download_size() {
[ "$1" ] && url=$1 || url="https://example.com"
Expand Down
1 change: 1 addition & 0 deletions common/device_personalization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if [ "$API" -ge 31 ]; then
if has_package "$packageName"; then
ui_print " [?] Android System Intelligence is already installed on this device."
ui_print ''
rm -rf "$MODPATH"/system/product/priv-app/DevicePersonalization*
else
ui_print " [?] Android System Intelligence is not installed on this device."
fi
Expand Down
13 changes: 3 additions & 10 deletions common/gboard.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/system/bin/sh

packageName="com.google.android.inputmethod.latin#com.google.android.inputmethod.latin"

if selector "Enable Pixel GBoard Features ?" "$useRecommendedSettings" "Enable" "Disable"; then
ui_print ' [+] Adding flags...'
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"
insert_gms_features "FlagOverrides" $packageName 0 4 null null null 1 "inline_suggestion_experiment_version"
insert_gms_features "FlagOverrides" $packageName 0 1 null null null 1 "user_history_learning_strategies"

# Done
ui_print " [✓] Installed"
ui_print ' [+] Flags kept...'
ui_print ''
else
ui_print " [~] Ignoring"
ui_print " [~] Flags removed from module..."
ui_print ''
rm -rf "$MODPATH"/device_prefs/*/gboard.ini
fi
13 changes: 3 additions & 10 deletions common/google_dialer.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/system/bin/sh

packageName="com.google.android.dialer"

if selector "Enable Pixel Google Dialer Features ?" "$useRecommendedSettings" "Enable" "Disable"; then
ui_print ' [+] Adding flags...'
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"
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"
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"

# Done
ui_print " [✓] Installed"
ui_print ' [+] Flags kept...'
ui_print ''
else
ui_print " [~] Removing from module"
ui_print " [~] Flags removed from module..."
ui_print ''
rm -rf "$MODPATH"/device_prefs/*/google_dialer.ini
fi
1 change: 1 addition & 0 deletions common/nga_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if [ "$API" -ge 31 ]; then
if has_package "$packageName"; then
ui_print " [?] NgaResources is already installed on this device."
ui_print ''
rm -rf "$MODPATH"/system/product/app/NgaResources*
else
ui_print " [?] NgaResources is not installed on this device."
fi
Expand Down
1 change: 1 addition & 0 deletions common/pixel_wallpapers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if [ "$API" -ge 31 ]; then
if has_package "$packageName"; then
ui_print " [?] PixelWallpapers2021 is already installed on this device."
ui_print ''
rm -rf "$MODPATH"/system/product/app/PixelWallpapers2021*
else
ui_print " [?] PixelWallpapers2021 is not installed on this device."
fi
Expand Down
2 changes: 1 addition & 1 deletion common/unlimited_gphoto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ui_print "[?+] Keeping *breaks* Unlimited GPhoto."
ui_print "[?-] Removing *removes* some new features."
if selector "keep 2020 and later sysconfigs ?" null "Keep" "Remove"; then
if selector "Keep 2020 and later sysconfigs ?" null "Keep" "Remove"; then
ui_print " [+] Keeping 2020 and later pixel experience xml"
ui_print ''
else
Expand Down
8 changes: 4 additions & 4 deletions customize.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/system/bin/sh

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

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

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

# Remove comments from files and place them, add blank line to end if not already present
for file in $(find "$MODPATH" -type f -name "*.sh" -o -name "*.prop" -o -name "*.rule"); do
[ -f "$file" ] && {
sed -i -e "/#/d" -e "/^ *$/d" "$file"
sed -i -e "/^[[:blank:]]*#/d" -e "/^ *$/d" "$file"
[ "$(tail -1 "$file")" ] && echo "" >>"$file"
}
done
Expand Down
5 changes: 5 additions & 0 deletions device_prefs/boolean/adaptive_charging.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
db_pref_packageName="com.google.android.apps.turbo"
db_pref_path="/data/user/0/com.google.android.gms/databases/phenotype.db"
xml_pref_path="/data/data/com.google.android.apps.turbo/shared_prefs/phenotypeFlags.xml"
AdaptiveCharging__enabled=true
AdaptiveCharging__v1_enabled=true
103 changes: 103 additions & 0 deletions device_prefs/boolean/gboard.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
db_pref_packageName="com.google.android.inputmethod.latin#com.google.android.inputmethod.latin"
db_pref_path="/data/user/0/com.google.android.gms/databases/phenotype.db"
xml_pref_path="/data/data/com.google.android.inputmethod.latin/shared_prefs/flag_value.xml"
material3_theme=true
enable_fetch_lm_v2=true
populate_ngram_count_in_dynamic_lms=true
lm_personalization_enabled=true
normalize_lm_score_for_nearby_key=true
enable_more_candidates_view_for_multilingual=true
enable_crank_for_primary_locale_in_multilingual=true
enable_crank_for_first_supported_locale_in_multilingual=true
enable_shared_multilingual_user_history_lm=true
enable_multilingual_emoji_search=true
enable_multilingual_sequential_decoding=true
crank_trigger_decoder_inline_completion_first=true
crank_trigger_decoder_inline_prediction_first=true
enable_core_typing_experience_indicator_on_candidates=true
enable_core_typing_experience_indicator_on_composing_text=true
enable_email_provider_completion=true
enable_floating_keyboard_v2=true
enable_inline_suggestions_on_client_side=true
enable_inline_suggestions_on_decoder_side=true
enable_inline_suggestions_space_tooltip=true
enable_inline_suggestions_tooltip_v2=true
enable_matched_predictions_as_inline_from_crank_cifg=true
enable_twiddler_multiword_engine=true
enable_multiword_predictions=true
enable_multiword_predictions_as_inline_from_crank_cifg=true
enable_multiword_predictions_from_user_history=true
enable_multiword_suggestions_as_inline_from_crank_cifg=true
enable_multiword_suggestions_from_user_history=true
enable_next_generation_hwr_support=true
enable_nga=true
enable_nga_undo_for_japanese=true
nga_enable_firstrun_flow=true
enable_single_word_predictions_as_inline_from_crank_cifg=true
enable_single_word_suggestions_as_inline_from_crank_cifg=true
enable_user_history_predictions_as_inline_from_crank_cifg=true
nga_enable_mic_button_when_dictation_eligible=true
nga_enable_mic_onboarding_animation=true
nga_enable_spoken_emoji_sticky_variant=true
nga_enable_sticky_mic=true
nga_enable_undo_delete=true
silk_on_all_devices=true
silk_on_all_pixel=true
silk_key_press=true
silk_popup_modal_backdrop=true
silk_theme=true
use_silk_theme_by_default=true
silk_popup=true
enable_lens=true
enable_logging_agsa_search_queries_to_training_cache=true
enable_link_suggestion_in_agsa=true
force_autocorrection_in_agsa=true
enable_nwp_tflite_engine=true
enable_emoji_predictor_tflite_engine=true
enable_tflite_triggering_model=true
tiresias_log_training_context=true
tiresias_enabled=true
tiresias_speech_personalization_enabled=false
tiresias_training_requires_idle=true
tiresias_enable_voice_logging=true
tiresias_lm_personalization_enabled=false
keyboard_redesign_google_sans=true
keyboard_redesign_forbid_key_shadows=true
keyboard_redesign_platform_google_sans=true
translate_new_ui=true
auto_show_translate=true
offline_translate=true
enable_voice_promo=true
enable_voice_in_chinese=true
enable_voice_in_japanese=true
enable_voice_in_korean=true
enable_voice_donation_flow=true
enable_voice_ellipsis=true
enable_voice_clear_button=true
enable_voice_in_handwriting=true
enable_feature_cards=true
log_auto_space=true
pill_shaped_key=true
enable_fast_access_bar=true
fast_access_bar_internal_dialog_enabled=true
fast_access_bar_disable_access_point=true
fast_access_bar_enable_frequently_used=true
fast_access_bar_enable_designated_variant=true
enable_fast_access_bar_auto_add_space=true
fast_access_bar_enable_offboarding_tooltip=true
fast_access_bar_enable_onboarding_tooltip_v2=true
fast_access_bar_enable_variants_popup_view=true
fast_access_bar_disable_settings_button_when_onboarding=true
fast_access_bar_enable_instantly_remove=true
enable_dynamic_trainer=true
enable_trainer_manager_v2=true
enable_preemptive_decode=true
enable_matrializer_manager=true
use_scrollable_candidate_for_voice=true
enable_inline_suggestions_on_client_side=true
enable_training_cache_metrics_processors=true
show_voice_reconversion_suggestion_as_chip=true
enable_show_inline_suggestions_in_popup_view=true
show_suggestions_for_selected_text_while_dictating=true
enable_expression_candidate_precaching_for_bitmoji=true
show_branding_on_space=false
77 changes: 77 additions & 0 deletions device_prefs/boolean/google_dialer.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
db_pref_packageName="com.google.android.dialer"
db_pref_path="/data/user/0/com.google.android.gms/databases/phenotype.db"
xml_pref_path="/data/data/com.google.android.dialer/shared_prefs/dialer_phenotype_flags.xml"
CallLogInformationArchitecture__enable_call_log_information_architecture=true
CallRecording__enable_call_recording_for_fi=true
G__always_enable_new_call_log_framework_and_fragment=true
G__answer_false_touch_detection_enabled=true
G__are_embeddings_jobs_enabled=true
G__bypass_revelio_roaming_check=true
G__call_screen_audio_listener_enabled=true
G__config_caller_id_enabled=true
G__enable_after_call_spam_blocking_promo=true
G__enable_atlas=true
G__enable_call_recording=true
G__enable_call_screen_audio_stitching=true
G__enable_call_screen_data_in_call_log=true
G__enable_call_screen_saving_audio=true
G__enable_duplicates_promo_v2_ui=true
G__enable_embedding_spam_revelio=true
G__enable_embedding_spam_revelio=true
G__enable_new_voicemail_tab=true
G__enable_patronus_spam=true
G__enable_pendingcall=true
G__enable_phone_number_classification_spam=true
G__enable_reject_embedding_spam_calls=true
G__enable_revelio=true
G__enable_revelio_on_bluetooth=true
G__enable_revelio_on_wired_headset=true
G__enable_revelio_r_api=true
G__enable_rtt_visibility_setting_part2=true
G__enable_spam_blocking_promo=true
G__enable_speak_easy_is_spam_survey=true
G__enable_speakeasy_details=true
G__enable_video_share=true
G__enable_wifi_calling_icons_all_carriers=true
G__force_disable_enriched_call=true
G__force_within_call_recording_geofence_value=true
G__force_within_crosby_geofence_value=true
G__is_call_log_item_anim_null=true
G__new_call_log_fragment_enabled=true
G__new_voicemail_fragment_enabled=true
G__show_call_screen_recording_player_in_call_log=true
G__speak_easy_bypass_locale_check=true
G__speak_easy_enable_listen_in_button=true
G__speak_easy_enabled=true
G__speak_easy_use_soda_asr=true
G__use_call_recording_geofence_overrides=true
G__voicemail_change_greeting_enabled=true
G_answer_proximity_sensor_enabled=true
G_call_screen_audio_listener_enabled=true
Scooby__are_spam_jobs_enabled=true
Scooby__enable_same_prefix_logging=true
atlas_use_soda_for_transcription=true
enable_android_s_notifications=true
enable_atlas_on_tidepods_voice_screen=true
enable_dialer_hold_handling=true
enable_dialpad_v2_ux=true
enable_hold_detection=true
enable_precall_dialpad_v2=true
enable_revelio_transcript=true
enable_smart_reply=true
enable_stir_shaken_call_log=true
enable_theme_pushing=true
enable_video_call_landscape=true
enable_video_handover_dialog=true
enable_voice_autofill=true
enable_xatu=true
enable_xatu_music_detection=true
force_flip_to_silence=true
show_atlas_hold_for_me_confirmation_dialog=true
G__enable_pride_month_celebration=false
G__enable_primes=false
G__enable_primes_crash_metric=false
G__enable_primes_timer_metric=false
G__enable_tidepods_video=false
enable_profile_photo_for_on_hold_video_call=false

11 changes: 11 additions & 0 deletions device_prefs/integer/gboard.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
db_pref_packageName="com.google.android.inputmethod.latin#com.google.android.inputmethod.latin"
db_pref_path="/data/user/0/com.google.android.gms/databases/phenotype.db"
xml_pref_path="/data/data/com.google.android.inputmethod.latin/shared_prefs/flag_value.xml"
inline_suggestion_experiment_version=1
user_history_learning_strategies=1
crank_min_char_num_limit=10
crank_max_char_num_limit=100
branding_fadeout_delay_ms=900
show_branding_interval_seconds=0
mutex_profiler_inverse_stack_trace_freq=4096
max_chars_to_read_before_and_after_cursor=1024
Loading

0 comments on commit 1bf1031

Please sign in to comment.