Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ android {
applicationId "git.artdeell.skymodloader"
minSdk 26
targetSdk 34
versionCode 56
versionName "1.7.1"
versionCode 57
versionName "1.7.1a"

externalNativeBuild {
cmake {
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/java/com/tgc/sky/SystemUI_android.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ void Update() {
// this.m_arCameraHandler.update();
}


void AttemptRotationToDeviceOrientation() {
int i = this.m_useSensorOrientation ? 4 : 6;
if (i == this.m_activity.getRequestedOrientation() || this.m_activity.portraitOnResume || IsOrientationLocked()) {
Expand Down Expand Up @@ -358,7 +357,6 @@ public int ShowTextFieldDialog(String str, String str2, String str3, String str4
}
dialogInterface.dismiss();
});

builder.setNegativeButton(LocalizeString4, (dialogInterface, i3) -> {
SystemUI_android.this.SetResult(null, 0, true);
dialogInterface.dismiss();
Expand Down Expand Up @@ -419,7 +417,6 @@ public void run() {
SystemUI_android.this.SetResult(null, 0, true);
dialogInterface.dismiss();
});

builder.setOnCancelListener(dialogInterface -> SystemUI_android.this.SetResult(null, 0, true));
AlertDialog create = builder.create();
GameActivity.hideNavigationFullScreen(Objects.requireNonNull(create.getWindow()).getDecorView());
Expand Down Expand Up @@ -1234,6 +1231,10 @@ public boolean IsVietnameseBuild() {
return IsPreferredSupportedLanguageVietnamese();
}

public boolean IsVietnameseBuildOrLanguage() {
return false;
}

public void SetGameInputConfig(boolean z, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7, String[] strArr, String[] strArr2) {
this.m_localizationManager.SetGameInputConfig(z, z2, z3, z4, z5, z6, z7);
this.m_markup.SetGamepadButtonMap(strArr, strArr2);
Expand Down Expand Up @@ -1512,4 +1513,4 @@ String GetDateTimeString(long j) {
String GetDateString(long j) {
return DateFormat.getDateInstance(0, Locale.getDefault()).format(new Date(j * 1000));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,31 @@

import androidx.appcompat.app.AppCompatActivity;

import com.tgc.sky.BuildConfig;

import java.io.File;

public class SettingsActivity extends AppCompatActivity {
private static final String TAG = "ClearAppData";
private Switch skipUpdateSwitch;
private Switch hideCanvasMenuSwitch;
private Switch ceserverSwitch;
private Switch customServerSwitch;
private Switch buildKeySwitch;
private Switch logcatSwitch;
private EditText serverUrlInput;
private EditText buildKeyInput;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.setting_layout);

ImageView backButton = findViewById(R.id.back_button);
skipUpdateSwitch = findViewById(R.id.mm_enableSkipUpdate);
hideCanvasMenuSwitch = findViewById(R.id.mm_hideCanvasMenu);
ceserverSwitch = findViewById(R.id.mm_enableCeserver);
customServerSwitch = findViewById(R.id.mm_enableCustomServer);
buildKeySwitch = findViewById(R.id.mm_enableBuildKey);
logcatSwitch = findViewById(R.id.mm_enableLogcat);
serverUrlInput = findViewById(R.id.server_url_input);
buildKeyInput = findViewById(R.id.build_key_input);
Button btnClearAppData = findViewById(R.id.btn_clear_app_data);

backButton.setOnClickListener(v -> finish());

skipUpdateSwitch.setChecked(getSharedPreferences("package_configs", MODE_PRIVATE)
.getBoolean("skip_updates", false));
skipUpdateSwitch.setOnCheckedChangeListener((buttonView, isChecked) ->
getSharedPreferences("package_configs", MODE_PRIVATE)
.edit().putBoolean("skip_updates", isChecked).apply()
);

hideCanvasMenuSwitch.setChecked(getSharedPreferences("package_configs", MODE_PRIVATE)
.getBoolean("hide_canvas_menu", false));
hideCanvasMenuSwitch.setOnCheckedChangeListener((buttonView, isChecked) ->
Expand Down Expand Up @@ -92,46 +77,6 @@ public void afterTextChanged(Editable s) {
}
});

buildKeySwitch.setChecked(getSharedPreferences("package_configs", MODE_PRIVATE)
.getBoolean("custom_build_key", false));
buildKeySwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
getSharedPreferences("package_configs", MODE_PRIVATE)
.edit().putBoolean("custom_build_key", isChecked).apply();
if (isChecked) {
String buildKey = buildKeyInput.getText().toString().trim();
if (buildKey.isEmpty()) {
Toast.makeText(this, "Please enter a build key first", Toast.LENGTH_SHORT).show();
buildKeySwitch.setChecked(false);
return;
}

applyBuildKey(buildKey);
} else {
BuildConfig.SKY_BUILD_ACCESS_KEY = "";
Toast.makeText(this, "Build key disabled", Toast.LENGTH_SHORT).show();
}
});

buildKeyInput.setText(getSharedPreferences("package_configs", MODE_PRIVATE)
.getString("build_access_key", ""));
buildKeyInput.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {}

@Override
public void afterTextChanged(Editable s) {
String buildKey = s.toString().trim();
getSharedPreferences("package_configs", MODE_PRIVATE)
.edit().putString("build_access_key", buildKey).apply();
if (buildKeySwitch.isChecked() && !buildKey.isEmpty()) {
applyBuildKey(buildKey);
}
}
});

logcatSwitch.setChecked(getSharedPreferences("package_configs", MODE_PRIVATE)
.getBoolean("logcat_enabled", false));
logcatSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
Expand All @@ -155,12 +100,6 @@ public void afterTextChanged(Editable s) {
btnClearAppData.setOnClickListener(v -> clearAppDataComplete());
}

private void applyBuildKey(String buildKey) {
BuildConfig.SKY_BUILD_ACCESS_KEY = buildKey;
Log.i("BuildKey", "Applied build key: " + buildKey.substring(0, Math.min(20, buildKey.length())) + "...");
Toast.makeText(this, "Build key applied", Toast.LENGTH_SHORT).show();
}

private void clearAppDataComplete() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("⚠️ Clear App Data");
Expand All @@ -171,9 +110,7 @@ private void clearAppDataComplete() {
int deletedFiles = 0;
int deletedDirs = 0;
try {
Log.i(TAG, "========================================");
Log.i(TAG, "Starting Complete Clear App Data");
Log.i(TAG, "========================================");

File externalFilesDir = getExternalFilesDir(null);
if (externalFilesDir != null) {
Expand All @@ -198,9 +135,7 @@ private void clearAppDataComplete() {

final int totalFiles = deletedFiles;
final int totalDirs = deletedDirs;
Log.i(TAG, "========================================");
Log.i(TAG, "TOTAL DELETED: " + totalFiles + " files, " + totalDirs + " dirs");
Log.i(TAG, "========================================");

runOnUiThread(() -> {
String message = "Cleared " + totalFiles + " files, " + totalDirs + " dirs\nRestarting...";
Expand Down Expand Up @@ -328,4 +263,4 @@ private int[] deleteRecursiveCount(File fileOrDirectory) {
}
return new int[]{fileCount, dirCount};
}
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/layout/mod_manager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
android:layout_marginBottom="7dp"
android:background="@drawable/buttons"
android:gravity="center"
android:text="Cửa Hàng Play | VIETNAMESE VERSION\nphát"
android:text="Cửa Hàng Play | VIETNAMESE VERSION\nchơi"
android:textSize="12sp"
android:maxLines="2" />

Expand Down
75 changes: 0 additions & 75 deletions app/src/main/res/layout/setting_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,30 +65,6 @@
android:letterSpacing="0.1"
android:alpha="0.5" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="@drawable/buttons"
android:orientation="horizontal"
android:padding="14dp">

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:text="Skip update screen"
android:textSize="15sp" />

<Switch
android:id="@+id/mm_enableSkipUpdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -199,57 +175,6 @@
android:textSize="14sp" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="@drawable/buttons"
android:orientation="horizontal"
android:padding="14dp">

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:text="Sky Build Key"
android:textSize="15sp" />

<Switch
android:id="@+id/mm_enableBuildKey"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="@drawable/buttons"
android:orientation="vertical"
android:padding="14dp">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Build Access Key"
android:textSize="13sp"
android:alpha="0.6"
android:layout_marginBottom="6dp" />

<EditText
android:id="@+id/build_key_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="insert-build-key"
android:singleLine="true"
android:inputType="text"
android:textSize="13sp"
android:fontFamily="monospace" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
Loading