Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import p2p keys #8771

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
01c1f2f
NTP: background is clickable when it is a branded wallpaper
petemill Apr 20, 2021
5f1a745
remove CallJavascriptFunctionUnsafe from brave://adblock webui
antonok-edm May 5, 2021
4862615
Fixes omnibox text selection color.
mkarolin May 7, 2021
315277a
Fix "verify wallet" button on tip dialog rewards onboarding
zenparsing May 10, 2021
2389e59
Adds event emitter to window.ethereum object
SergeyZhukovsky May 5, 2021
e572fb1
Renames web3 provider generated resources
SergeyZhukovsky May 5, 2021
af6e4d0
Executes events emit via v8 instead of direct ExecuteScript
SergeyZhukovsky May 7, 2021
4911e5d
Fix unsafe javascript calls in brave://rewards
wchen342 May 6, 2021
5d9ebac
Add back IsJavascriptAllowed checks
wchen342 May 7, 2021
60ec2da
Invalidate weak_factory_ in OnJavascriptDisallowed()
wchen342 May 10, 2021
0dc6140
Merge pull request #8571 from brave/ntp-bg-visitable
bsclifton May 10, 2021
d53e692
Implement custom ad notification field trials
tmancey May 5, 2021
ab419e3
Merge pull request #8761 from brave/ksmith-jp-tip-verify-button
zenparsing May 10, 2021
450d811
Format fix
wchen342 May 10, 2021
c49c0d0
Merge pull request #8749 from brave/maxk-fix-omnibox-selection-color
mkarolin May 10, 2021
b81f3d4
Merge pull request #8716 from brave/remove-brave-adblock-call-js-unsafe
antonok-edm May 10, 2021
2fc1c62
Corrects a build of brave wallet after cr91
SergeyZhukovsky May 11, 2021
0fde59c
Fixed crypto.com widget shows invalid price
simonhong May 4, 2021
967d6fe
Merge pull request #8740 from brave/fix-unsafe-javascript-call-reward…
wchen342 May 11, 2021
35cffb9
Merge pull request #8691 from brave/fix_crypto_widget_bug
simonhong May 11, 2021
bd79a49
Merge pull request #8718 from brave/web3_event_emitter
SergeyZhukovsky May 11, 2021
c18081d
Bump hosted-git-info from 2.8.8 to 2.8.9 (#8756)
dependabot[bot] May 11, 2021
7777b94
Merge pull request #8705 from brave/issues/15624
tmancey May 11, 2021
fe0c84b
Remove BAP deprecation modal (#8762)
deeppandya May 11, 2021
0d8223e
Implemented IPFS import refactoring
spylogsster May 11, 2021
fa257e9
Added IPNS keys manager UI to IPFS Settings
spylogsster May 5, 2021
b7de530
Remove keys submenu for tabs
spylogsster May 6, 2021
28c91c6
Added keys import
spylogsster May 11, 2021
1072b1e
resolved conflicts
spylogsster May 11, 2021
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
5 changes: 0 additions & 5 deletions android/brave_java_resources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,6 @@ brave_java_resources = [
"java/res/drawable/ic_toggle_up.xml",
"java/res/drawable/ic_wallet_add.xml",
"java/res/drawable/ic_warning_circle.xml",
"java/res/drawable/ic_warning_triangle.xml",
"java/res/drawable/ic_warning_triangle_2.xml",
"java/res/drawable/image_credit_rounded_shape.xml",
"java/res/drawable/modern_toolbar_background_grey_end_segment.xml",
"java/res/drawable/ntp_widget_indicator_bg.xml",
Expand All @@ -634,8 +632,6 @@ brave_java_resources = [
"java/res/drawable/rewards_button_purple_border.xml",
"java/res/drawable/rewards_button_summary.xml",
"java/res/drawable/rewards_image_button.xml",
"java/res/drawable/rewards_modal_background.xml",
"java/res/drawable/rewards_tooltip_background.xml",
"java/res/drawable/rounded_corners.xml",
"java/res/drawable/rounded_filled.xml",
"java/res/drawable/rounded_filled_binance.xml",
Expand Down Expand Up @@ -721,7 +717,6 @@ brave_java_resources = [
"java/res/layout/fragment_brave_rewards_onboarding.xml",
"java/res/layout/fragment_cross_promotional_modal_dialog.xml",
"java/res/layout/fragment_crypto_widget_bottom_sheet_dialog.xml",
"java/res/layout/fragment_deprecate_bap_modal_dialog.xml",
"java/res/layout/fragment_onboarding_v2.xml",
"java/res/layout/fragment_qr_code_share.xml",
"java/res/layout/fragment_rate_dialog.xml",
Expand Down
1 change: 0 additions & 1 deletion android/brave_java_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ brave_java_sources = [
"../../brave/android/java/org/chromium/chrome/browser/BraveSyncReflectionUtils.java",
"../../brave/android/java/org/chromium/chrome/browser/BraveUphold.java",
"../../brave/android/java/org/chromium/chrome/browser/CrossPromotionalModalDialogFragment.java",
"../../brave/android/java/org/chromium/chrome/browser/DeprecateBAPModalDialogFragment.java",
"../../brave/android/java/org/chromium/chrome/browser/InternetConnection.java",
"../../brave/android/java/org/chromium/chrome/browser/QRCodeShareDialogFragment.java",
"../../brave/android/java/org/chromium/chrome/browser/SetDefaultBrowserActivity.java",
Expand Down
12 changes: 0 additions & 12 deletions android/java/org/chromium/chrome/browser/BraveRewardsHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public class BraveRewardsHelper implements LargeIconBridge.LargeIconCallback{
private static final String PREF_SHOW_ONBOARDING_MINI_MODAL = "show_onboarding_mini_modal";
private static final String PREF_NEXT_REWARDS_ONBOARDING_MODAL_DATE =
"next_rewards_onboarding_modal_date";
private static final String PREF_NEXT_BAP_MODAL_DATE = "next_bap_modal_date";
private static final String PREF_REWARDS_ENV_CHANGE = "rewards_env_change";
private static final String PREF_REWARDS_ONBOARDING_MODAL = "rewards_onboarding_modal";
private static final int FAVICON_CIRCLE_MEASUREMENTS = 70; // dp
Expand Down Expand Up @@ -103,17 +102,6 @@ public static void setNextRewardsOnboardingModalDate(long nextDate) {
sharedPreferencesEditor.apply();
}

public static long getNextBAPModalDate() {
return ContextUtils.getAppSharedPreferences().getLong(PREF_NEXT_BAP_MODAL_DATE, 0);
}

public static void setNextBAPModalDate(long nextDate) {
SharedPreferences.Editor sharedPreferencesEditor =
ContextUtils.getAppSharedPreferences().edit();
sharedPreferencesEditor.putLong(PREF_NEXT_BAP_MODAL_DATE, nextDate);
sharedPreferencesEditor.apply();
}

public static void setRewardsOnboardingModalShown(boolean isShown) {
SharedPreferences.Editor sharedPreferencesEditor =
ContextUtils.getAppSharedPreferences().edit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2066,6 +2066,7 @@ public void updateDrawState(@NonNull TextPaint ds) {
loginPopupWindow.setContentView(loginPopupView);

view.post(new Runnable() {
@Override
public void run() {
if (SysUtils.isLowEndDevice()) {
loginPopupWindow.setAnimationStyle(0);
Expand Down

This file was deleted.

121 changes: 1 addition & 120 deletions android/java/org/chromium/chrome/browser/app/BraveActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,19 @@
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ApplicationLifetime;
import org.chromium.chrome.browser.BraveConfig;
import org.chromium.chrome.browser.BraveFeatureList;
import org.chromium.chrome.browser.BraveHelper;
import org.chromium.chrome.browser.BraveRelaunchUtils;
import org.chromium.chrome.browser.BraveRewardsHelper;
import org.chromium.chrome.browser.BraveRewardsNativeWorker;
import org.chromium.chrome.browser.BraveRewardsObserver;
import org.chromium.chrome.browser.BraveSyncReflectionUtils;
import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.CrossPromotionalModalDialogFragment;
import org.chromium.chrome.browser.DeprecateBAPModalDialogFragment;
import org.chromium.chrome.browser.LaunchIntentDispatcher;
import org.chromium.chrome.browser.SetDefaultBrowserActivity;
import org.chromium.chrome.browser.bookmarks.BookmarkBridge;
import org.chromium.chrome.browser.bookmarks.BookmarkModel;
import org.chromium.chrome.browser.brave_stats.BraveStatsUtil;
import org.chromium.chrome.browser.dependency_injection.ChromeActivityComponent;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.informers.BraveAndroidSyncDisabledInformer;
import org.chromium.chrome.browser.notifications.BraveSetDefaultBrowserNotificationService;
Expand Down Expand Up @@ -111,8 +107,7 @@
* Brave's extension for ChromeActivity
*/
@JNINamespace("chrome::android")
public abstract class BraveActivity<C extends ChromeActivityComponent>
extends ChromeActivity implements BraveRewardsObserver {
public abstract class BraveActivity<C extends ChromeActivityComponent> extends ChromeActivity {
public static final int SITE_BANNER_REQUEST_CODE = 33;
public static final int VERIFY_WALLET_ACTIVITY_REQUEST_CODE = 34;
public static final int USER_WALLET_ACTIVITY_REQUEST_CODE = 35;
Expand Down Expand Up @@ -145,12 +140,9 @@ public abstract class BraveActivity<C extends ChromeActivityComponent>
public static final String ANDROID_PACKAGE_NAME = "android";
public static final String BRAVE_BLOG_URL = "http://www.brave.com/blog";

private static final String JAPAN_COUNTRY_CODE = "JP";

// Explicitly declare this variable to avoid build errors.
// It will be removed in asm and parent variable will be used instead.
protected ObservableSupplier<Profile> mTabModelProfileSupplier;
private BraveRewardsNativeWorker mBraveRewardsNativeWorker;

private static final List<String> yandexRegions =
Arrays.asList("AM", "AZ", "BY", "KG", "KZ", "MD", "RU", "TJ", "TM", "UZ");
Expand All @@ -164,20 +156,6 @@ public BraveActivity() {
public void onResumeWithNative() {
super.onResumeWithNative();
BraveActivityJni.get().restartStatsUpdater();
if (ChromeFeatureList.isEnabled(BraveFeatureList.BRAVE_REWARDS)
&& !BravePrefServiceBridge.getInstance().getSafetynetCheckFailed()) {
if (mBraveRewardsNativeWorker == null)
mBraveRewardsNativeWorker = BraveRewardsNativeWorker.getInstance();
mBraveRewardsNativeWorker.AddObserver(this);
}
}

@Override
public void onPauseWithNative() {
super.onPauseWithNative();
if (mBraveRewardsNativeWorker != null) {
mBraveRewardsNativeWorker.RemoveObserver(this);
}
}

@Override
Expand Down Expand Up @@ -410,69 +388,6 @@ public void finishNativeInitialization() {
calender.getTimeInMillis());
}
checkSetDefaultBrowserModal();
if (mBraveRewardsNativeWorker != null && mBraveRewardsNativeWorker.isRewardsEnabled()
&& ChromeFeatureList.isEnabled(BraveFeatureList.BRAVE_REWARDS)
&& !BravePrefServiceBridge.getInstance().getSafetynetCheckFailed()) {
mBraveRewardsNativeWorker.StartProcess();
}
}

@Override
public void OnRewardsParameters(int errorCode) {
if (errorCode == BraveRewardsNativeWorker.LEDGER_OK && mBraveRewardsNativeWorker != null
&& mBraveRewardsNativeWorker.GetWalletBalance() != null
&& mBraveRewardsNativeWorker.GetWalletBalance().getTotal() > 0) {
checkForDeprecateBAPDialog();
}
}

@Override
public void OnStartProcess() {
mBraveRewardsNativeWorker.GetRewardsParameters();
}

private void checkForDeprecateBAPDialog() {
String countryCode = Locale.getDefault().getCountry();
if (countryCode.equals(JAPAN_COUNTRY_CODE) && !isRewardsPanelOpened()
&& System.currentTimeMillis() > BraveRewardsHelper.getNextBAPModalDate()) {
Calendar toDayCalendar = Calendar.getInstance();
Date todayDate = toDayCalendar.getTime();

Calendar march6Calendar = Calendar.getInstance();
march6Calendar.set(Calendar.DAY_OF_MONTH, 6);
march6Calendar.set(Calendar.YEAR, 2021);
march6Calendar.set(Calendar.MONTH, 2);
march6Calendar.set(Calendar.HOUR_OF_DAY, 0);
march6Calendar.set(Calendar.MINUTE, 0);
march6Calendar.set(Calendar.SECOND, 0);
march6Calendar.set(Calendar.MILLISECOND, 0);
Date march6Date = march6Calendar.getTime();

Calendar march13Calendar = Calendar.getInstance();
march13Calendar.set(Calendar.DAY_OF_MONTH, 13);
march13Calendar.set(Calendar.YEAR, 2021);
march13Calendar.set(Calendar.MONTH, 2);
march13Calendar.set(Calendar.HOUR_OF_DAY, 0);
march13Calendar.set(Calendar.MINUTE, 0);
march13Calendar.set(Calendar.SECOND, 0);
march13Calendar.set(Calendar.MILLISECOND, 0);
Date march13Date = march13Calendar.getTime();

boolean shouldSetNextDate = false;
if (todayDate.compareTo(march6Date) < 0) {
showRewardsTooltip();
shouldSetNextDate = true;
} else if (todayDate.compareTo(march6Date) > 0
&& todayDate.compareTo(march13Date) < 0) {
showDeprecateBAPDialog();
shouldSetNextDate = true;
}
if (shouldSetNextDate) {
Calendar calender = toDayCalendar;
calender.add(Calendar.DATE, DAYS_1);
BraveRewardsHelper.setNextBAPModalDate(calender.getTimeInMillis());
}
}
}

private void checkSetDefaultBrowserModal() {
Expand Down Expand Up @@ -587,14 +502,6 @@ public void hideRewardsOnboardingIcon() {
}
}

public void showRewardsTooltip() {
BraveToolbarLayout layout = (BraveToolbarLayout) findViewById(R.id.toolbar);
assert layout != null;
if (layout != null) {
layout.showRewardsTooltip();
}
}

private void createNotificationChannel() {
Context context = ContextUtils.getApplicationContext();
// Create the NotificationChannel, but only on API 26+ because
Expand Down Expand Up @@ -715,24 +622,6 @@ public void openRewardsPanel() {
}
}

public boolean isRewardsPanelOpened() {
BraveToolbarLayout layout = (BraveToolbarLayout) findViewById(R.id.toolbar);
assert layout != null;
if (layout != null) {
return layout.isRewardsPanelOpened();
}
return false;
}

public boolean isShieldsTooltipShown() {
BraveToolbarLayout layout = (BraveToolbarLayout) findViewById(R.id.toolbar);
assert layout != null;
if (layout != null) {
return layout.isShieldsTooltipShown();
}
return false;
}

public Tab selectExistingTab(String url) {
Tab tab = getActivityTab();
if (tab != null && tab.getUrlString().equals(url)) {
Expand Down Expand Up @@ -777,14 +666,6 @@ private void showCrossPromotionalDialog() {
mCrossPromotionalModalDialogFragment.show(getSupportFragmentManager(), "CrossPromotionalModalDialogFragment");
}

public void showDeprecateBAPDialog() {
DeprecateBAPModalDialogFragment mDeprecateBAPModalDialogFragment =
new DeprecateBAPModalDialogFragment();
mDeprecateBAPModalDialogFragment.setCancelable(false);
mDeprecateBAPModalDialogFragment.show(
getSupportFragmentManager(), "DeprecateBAPModalDialogFragment");
}

static public ChromeTabbedActivity getChromeTabbedActivity() {
for (Activity ref : ApplicationStatus.getRunningActivities()) {
if (!(ref instanceof ChromeTabbedActivity)) continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ public enum ShieldsTooltipEnum {
HTTPS_UPGRADE_TOOLTIP(ShieldsTooltipEnumConstants.HTTPS_UPGRADE_TOOLTIP,
R.string.tooltip_title_4, R.string.tooltip_text_4,
R.color.shields_tooltip_arrow_color_2, R.drawable.shields_tooltip_background_2),
BAP_DEPRECATION_TOOLTIP(ShieldsTooltipEnumConstants.BAP_DEPRECATION_TOOLTIP,
R.string.rewards_tooltip_title, R.string.rewards_tooltip_text,
R.color.rewards_tooltip_arrow_color, R.drawable.rewards_tooltip_background),
BRAVE_SHARE_STATS_TIER1_TOOLTIP(ShieldsTooltipEnumConstants.BRAVE_SHARE_STATS_TIER1_TOOLTIP,
R.string.brave_stats_share_tooltip_tier1_title,
R.string.brave_stats_share_tooltip_special_text, R.color.shields_tooltip_arrow_color_2,
Expand Down Expand Up @@ -102,7 +99,6 @@ interface ShieldsTooltipEnumConstants {
static final int VIDEO_ADS_BLOCKED_TOOLTIP = 1;
static final int ADS_TRACKER_BLOCKED_TOOLTIP = 2;
static final int HTTPS_UPGRADE_TOOLTIP = 3;
static final int BAP_DEPRECATION_TOOLTIP = 4;
static final int BRAVE_SHARE_STATS_TIER1_TOOLTIP = 5;
static final int BRAVE_SHARE_STATS_TIER2_TOOLTIP = 6;
static final int BRAVE_SHARE_STATS_TIER3_TOOLTIP = 7;
Expand Down
Loading