Skip to content

Commit

Permalink
Implement a feature to login as a PC
Browse files Browse the repository at this point in the history
  • Loading branch information
Chipppppppppp committed Mar 17, 2024
1 parent 44e3a88 commit fa642f3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 6 additions & 5 deletions app/src/main/java/io/github/chipppppppppp/lime/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
XposedHelpers.findAndHookMethod(hookTarget, "b", new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
param.setResult("ANDROIDSECONDARY");
param.setResult("DESKTOPWIN");
}
});
}
Expand Down Expand Up @@ -167,7 +167,8 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
builder.setPositiveButton(R.string.positive, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(activity.getApplicationContext(), activity.getString(R.string.restarting), Toast.LENGTH_SHORT).show();
prefs.edit().putBoolean("spoof_android_id", true).apply();
Toast.makeText(activity.getApplicationContext(), activity.getString(R.string.need_refresh), Toast.LENGTH_SHORT).show();
activity.finish();
}
});
Expand All @@ -176,10 +177,10 @@ public void onClick(DialogInterface dialog, int which) {

switchSpoofAndroidId.setChecked(prefs.getBoolean("spoof_android_id", false));
switchSpoofAndroidId.setOnCheckedChangeListener((buttonView, isChecked) -> {
prefs.edit().putBoolean("spoof_android_id", isChecked).apply();
if (isChecked) dialog.show();
else {
Toast.makeText(activity.getApplicationContext(), activity.getString(R.string.restarting), Toast.LENGTH_SHORT).show();
prefs.edit().putBoolean("spoof_android_id", false).apply();
Toast.makeText(activity.getApplicationContext(), activity.getString(R.string.need_refresh), Toast.LENGTH_SHORT).show();
activity.finish();
}
});
Expand All @@ -189,7 +190,7 @@ public void onClick(DialogInterface dialog, int which) {
switchAndroidSecondary.setChecked(prefs.getBoolean("android_secondary", false));
switchAndroidSecondary.setOnCheckedChangeListener((buttonView, isChecked) -> {
prefs.edit().putBoolean("android_secondary", isChecked).apply();
Toast.makeText(activity.getApplicationContext(), activity.getString(R.string.restarting), Toast.LENGTH_SHORT).show();
Toast.makeText(activity.getApplicationContext(), activity.getString(R.string.need_refresh), Toast.LENGTH_SHORT).show();
activity.finish();
});

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
<string name="module_not_enabled_text">モジュールが有効化されていません!</string>
<string name="options_title">設定</string>
<string name="restarting">アプリを再起動しています...</string>
<string name="need_refresh">強制停止とキャッシュの削除が必要です</string>
<string name="switch_spoof_android_id">Android ID を偽装</string>
<string name="spoof_android_id_risk">Android ID の偽装は自己責任です</string>
<string name="switch_android_secondary">ANDROIDSECONDARY に偽装 (機能しません)</string>
<string name="switch_android_secondary">PC (DESKTOPWIN) に偽装</string>
<string name="switch_unembed_options">設定を LINE に埋め込まない (設定は同期されません)</string>
<string name="switch_delete_voom">VOOM アイコンを削除</string>
<string name="switch_delete_wallet">ウォレットアイコンを削除</string>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
<string name="module_not_enabled_text">Module not enabled!</string>
<string name="options_title">Options</string>
<string name="restarting">Restarting now...</string>
<string name="need_refresh">Forced stop and cache clearing are required</string>
<string name="switch_spoof_android_id">Spoof Android ID</string>
<string name="spoof_android_id_risk">Spoofing Android ID is at your own risk</string>
<string name="switch_android_secondary">Spoof as ANDROIDSECONDARY (does not work)</string>
<string name="switch_android_secondary">Spoof as a PC (DESKTOPWIN)</string>
<string name="switch_unembed_options">Do not embed options in LINE (options will not be synchronized)</string>
<string name="switch_delete_voom">Delete the VOOM icon</string>
<string name="switch_delete_wallet">Delete the wallet icon</string>
Expand Down

0 comments on commit fa642f3

Please sign in to comment.